Pages: [1]   Go Down
Author Topic: IDE error redrawing text when bad keyword style is encountered.  (Read 714 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
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
Logged

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 227
Posts: 14048
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


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
Logged

Rob Tillaart

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

Global Moderator
Melbourne, Australia
Online Online
Brattain Member
*****
Karma: 511
Posts: 19359
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

This is similar:

http://code.google.com/p/arduino/issues/detail?id=895
Logged

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

Please post technical questions on the forum - not to me by personal message. Thanks a lot.

Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Pages: [1]   Go Up
Jump to: