Pages: [1]   Go Down
Author Topic: Auto Format Error  (Read 828 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
God Member
*****
Karma: 0
Posts: 593
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

When I do an auto format, it gives me an error:
"String index out of range: 1020"

And the output windows shows:
Code:
java.lang.StringIndexOutOfBoundsException: String index out of range: 1020
      at java.lang.String.charAt(String.java:687)
      at processing.app.tools.AutoFormat.getchr(AutoFormat.java:313)
      at processing.app.tools.AutoFormat.show(AutoFormat.java:499)
      at processing.app.Editor$15.actionPerformed(Editor.java:728)
      at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
      at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
      at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
      at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
      at javax.swing.AbstractButton.doClick(AbstractButton.java:357)
      at javax.swing.AbstractButton.doClick(AbstractButton.java:337)
      at javax.swing.plaf.basic.BasicMenuItemUI$Actions.actionPerformed(BasicMenuItemUI.java:1185)
      at javax.swing.SwingUtilities.notifyAction(SwingUtilities.java:1636)
      at javax.swing.JComponent.processKeyBinding(JComponent.java:2849)
      at javax.swing.JMenuBar.processBindingForKeyStrokeRecursive(JMenuBar.java:670)
      at javax.swing.JMenuBar.processBindingForKeyStrokeRecursive(JMenuBar.java:678)
      at javax.swing.JMenuBar.processBindingForKeyStrokeRecursive(JMenuBar.java:678)
      at javax.swing.JMenuBar.processKeyBinding(JMenuBar.java:649)
      at javax.swing.KeyboardManager.fireBinding(KeyboardManager.java:267)
      at javax.swing.KeyboardManager.fireKeyboardAction(KeyboardManager.java:254)
      at javax.swing.JComponent.processKeyBindingsForAllComponents(JComponent.java:2926)
      at javax.swing.JComponent.processKeyBindings(JComponent.java:2918)
      at javax.swing.JComponent.processKeyEvent(JComponent.java:2812)
      at java.awt.Component.processEvent(Component.java:5815)
      at java.awt.Container.processEvent(Container.java:2058)
      at java.awt.Component.dispatchEventImpl(Component.java:4410)
      at java.awt.Container.dispatchEventImpl(Container.java:2116)
      at java.awt.Component.dispatchEvent(Component.java:4240)
      at java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1848)
      at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(DefaultKeyboardFocusManager.java:697)
      at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(DefaultKeyboardFocusManager.java:962)
      at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:834)
      at java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:661)
      at java.awt.Component.dispatchEventImpl(Component.java:4282)
      at java.awt.Container.dispatchEventImpl(Container.java:2116)
      at java.awt.Window.dispatchEventImpl(Window.java:2429)
      at java.awt.Component.dispatchEvent(Component.java:4240)
      at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
      at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
      at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
      at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
      at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
      at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
      at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)

This only happens on one particular file, and it compiles without trouble.
The file is too big for me to post.

Does anybody know what it means?

I'm using Arduino 0010 on Ubuntu 7.10
Logged

Freelance engineer, consultant, contractor. Graduated from UW in 2013.

Forum Administrator
Cambridge, MA
Offline Offline
Faraday Member
*****
Karma: 12
Posts: 3538
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Looks like you found a bug in the auto-format code.  smiley

Can you post the code on a website somewhere or email it to me at dam at mellis dot org?
Logged

0
Offline Offline
God Member
*****
Karma: 0
Posts: 593
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Particular file that's giving me the problem
http://franksjunk.thespudmall.com/etherduinoFuncts

entire project
http://franksjunk.thespudmall.com/Etherduino
Logged

Freelance engineer, consultant, contractor. Graduated from UW in 2013.

Forum Administrator
Cambridge, MA
Offline Offline
Faraday Member
*****
Karma: 12
Posts: 3538
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hmm, I downloaded the whole project, and the auto-format seems to work fine.  You had all the tabs open, I assume.  Which file were you trying to auto-format?  Did you change the file since you saw that error?  
Logged

New Zealand
Offline Offline
God Member
*****
Karma: 0
Posts: 999
Arduino pebbles
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
By any chance is this to interface the Arduino to the WIZnet WIZ810MJ module?

If so, have you seen this "Arduino and WIZ810MJ ethernet module status update" thread?

I started by implementing an Arduino SPI software driver but then discovered porting the existing driver would probably be faster and have a better result.

I ported the driver successfully and am currently in the process of creating a library to enable easy access to the module.

Just in case you're not doing this for your own interest, I thought I'd point out you might want to skip implementing some of the lower level stuff. An active user would also provide me some added motivation to get the library interface finished. :-) (The code's licensed under the LGPL so you're free to use provided you return changes to the library code itself.)

--Phil.
Logged

Pages: [1]   Go Up
Jump to: