Bug 1064 : "space-import-space-quote-semicolon" Causes Error in String or Comment
Last modified: 2008-11-29 09:06




Status:
RESOLVED
Resolution:
FIXED -
Priority:
P2
Severity:
normal

 

Reporter:
Young
Assigned To:
fry

Attachment Type Created Size Actions

Description:   Opened: 2008-11-25 13:46
Pr v1.0, Mac OS X 10.5.5

The following line of code caused a syntax error, even when commented out:
println("Starting thread to import data.");

I was able to narrow it down to this:
println(" import ");
and even further to this:
// import ";

This is the output from that last code snippet:
java.lang.StringIndexOutOfBoundsException: String index out of range: -1
at java.lang.String.substring(String.java:1768)
at processing.app.Sketch.preprocess(Sketch.java:1414)
at processing.app.Sketch.build(Sketch.java:1471)
at processing.app.Sketch.compile(Sketch.java:1172)
at processing.app.Editor.handleRun(Editor.java:1632)
at processing.app.EditorToolbar.mousePressed(EditorToolbar.java:318)
at java.awt.Component.processMouseEvent(Component.java:5599)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3135)
at java.awt.Component.processEvent(Component.java:5367)
at java.awt.Container.processEvent(Container.java:2010)
at java.awt.Component.dispatchEventImpl(Component.java:4068)
at java.awt.Container.dispatchEventImpl(Container.java:2068)
at java.awt.Component.dispatchEvent(Component.java:3903)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4256)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3933)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3866)
at java.awt.Container.dispatchEventImpl(Container.java:2054)
at java.awt.Window.dispatchEventImpl(Window.java:1801)
at java.awt.Component.dispatchEvent(Component.java:3903)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:269)
at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:190)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:184)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:176)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
java.lang.StringIndexOutOfBoundsException: String index out of range: -1
at java.lang.String.substring(String.java:1768)
at processing.app.Sketch.preprocess(Sketch.java:1414)
at processing.app.Sketch.build(Sketch.java:1471)
at processing.app.Sketch.compile(Sketch.java:1172)
at processing.app.Editor.handleRun(Editor.java:1632)
at processing.app.EditorToolbar.mousePressed(EditorToolbar.java:318)
at java.awt.Component.processMouseEvent(Component.java:5599)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3135)
at java.awt.Component.processEvent(Component.java:5367)
at java.awt.Container.processEvent(Container.java:2010)
at java.awt.Component.dispatchEventImpl(Component.java:4068)
at java.awt.Container.dispatchEventImpl(Container.java:2068)
at java.awt.Component.dispatchEvent(Component.java:3903)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4256)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3933)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3866)
at java.awt.Container.dispatchEventImpl(Container.java:2054)
at java.awt.Window.dispatchEventImpl(Window.java:1801)
at java.awt.Component.dispatchEvent(Component.java:3903)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:269)
at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:190)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:184)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:176)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)

Other characters can appear within the space-import-space-quote-semicolon sequence and
still cause the error, but take any one of them out and it goes away.
Additional Comment #1 From fry 2008-11-27 14:13
thanks for tracking it down, i know the problem and will try to fix it with
the next release.
Additional Comment #2 From fry 2008-11-29 09:06
fixed in revision 0163 (and therefore 1.0.1 when it's released).