Go Down

Topic: IDE error redrawing text when bad keyword style is encountered. (Read 740 times) previous topic - next topic

jpbot

Last week I was working on pulling some of my code together into a library and discovered a bug in the IDE which prevents the window from properly repainting. Looks like an array bounds checking failure. Either this needs to be trapped or checked for in the code. Looks like the problem is in SyntaxUtilities.java. I would look into this more but don't have any experience with the IDE codebase.

The error can be reproduced by authoring (or modifying) a library and making a simple mistake in keywords.txt. If instead of KEYWORD1, KEYWORD2, KEYWORD3 the number is left off (haven't tried, but suspect any unexpected style) the IDE stops painting lines of code as soon as a line with that keyword is encountered.

The error references:
https://github.com/arduino/Arduino/blob/master/app/src/processing/app/syntax/SyntaxUtilities.java#L151

Code: [Select]
Error repainting line range {48,74}:
java.lang.ArrayIndexOutOfBoundsException: 25
at processing.app.syntax.SyntaxUtilities.paintSyntaxLine(SyntaxUtilities.java:151)
at processing.app.syntax.TextAreaPainter.paintSyntaxLine(TextAreaPainter.java:644)
at processing.app.syntax.TextAreaPainter.paintLine(TextAreaPainter.java:603)
at processing.app.syntax.TextAreaPainter.paint(TextAreaPainter.java:415)
at javax.swing.JComponent._paintImmediately(JComponent.java:5098)
at javax.swing.JComponent.paintImmediately(JComponent.java:4882)
at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:812)
at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:714)
at javax.swing.RepaintManager.prePaintDirtyRegions(RepaintManager.java:694)
at javax.swing.RepaintManager.access$700(RepaintManager.java:41)
at javax.swing.RepaintManager$ProcessingRunnable.run(RepaintManager.java:1672)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:677)
at java.awt.EventQueue.access$000(EventQueue.java:85)
at java.awt.EventQueue$1.run(EventQueue.java:638)
at java.awt.EventQueue$1.run(EventQueue.java:636)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:647)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)


Two more forum topics which report this error:
http://arduino.cc/forum/index.php/topic,22943.0.html
http://arduino.cc/forum/index.php/topic,95903.msg

robtillaart


you can check if it is allready in the buglist here - http://code.google.com/p/arduino/issues/list -
if not you can add it
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

Nick Gammon

This is similar:

http://code.google.com/p/arduino/issues/detail?id=895
Please post technical questions on the forum, not by personal message. Thanks!

More info:
http://www.gammon.com.au/electronics

jpbot

similar, but slightly different. I'll add another and reference 546 and 895 which both describe related behaviors.

Go Up