Go Down

Topic: Auto Format Error (Read 923 times) previous topic - next topic

frank26080115

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

And the output windows shows:
Code: [Select]
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
Freelance engineer, consultant, contractor. Graduated from UW in 2013.

mellis

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

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

frank26080115

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

entire project
http://franksjunk.thespudmall.com/Etherduino
Freelance engineer, consultant, contractor. Graduated from UW in 2013.

mellis

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?  

follower

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

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.

Go Up