Bug 1067 : ArrayIndexOutOfBoundsException with File > New (Processing 1.0)
Last modified: 2008-11-29 11:52




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

 

Reporter:
num3ric
Assigned To:
fry

Attachment Type Created Size Actions
replacement pde.jar with possible fix application/octet-stream 2008-11-27 18:19 678.55 KB

Description:   Opened: 2008-11-26 12:28
1. Processing 1.0
2. Mac OS X 10.5.5 using MacBookPro Intel
3. Error created by the File --> "New" command (whether through the menu inside the
application window or using cmd+N)
4. Error text generated each time in console:

Exception in thread "AWT-EventQueue-0" java.lang.ArrayIndexOutOfBoundsException: 0
at processing.app.Sketch.setCurrentCode(Sketch.java:1076)
at processing.app.Sketch.load(Sketch.java:212)
at processing.app.Sketch.<init>(Sketch.java:134)
at processing.app.Editor.handleOpenInternal(Editor.java:1899)
at processing.app.Editor.<init>(Editor.java:311)
at processing.app.Base.handleOpen(Base.java:712)
at processing.app.Base.handleOpen(Base.java:682)
at processing.app.Base.handleNew(Base.java:579)
at processing.app.Editor$4.actionPerformed(Editor.java:430)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1882)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2202)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
at javax.swing.AbstractButton.doClick(AbstractButton.java:334)
at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1051)
at
javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:1092
)
at java.awt.Component.processMouseEvent(Component.java:5602)
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:3936)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3866)
at java.awt.Container.dispatchEventImpl(Container.java:2054)
at java.awt.Window.dispatchEventImpl(Window.java:1791)
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)
Additional Comment #1 From num3ric 2008-11-26 13:00
I also noticed that after this error has occured, the "Sketchbook" and "Examples" lines from the
"File" menu disappear. Then if I try to open a file (whether I actually open one or not), the two
options reappear afterwards.
Additional Comment #2 From fry 2008-11-26 15:35
*** Bug 1070 has been marked as a duplicate of this bug. ***
Additional Comment #3 From fry 2008-11-26 15:36
thanks for the report, will look into it.
Additional Comment #4 From fry 2008-11-26 15:40
does this happen all the time? on a fresh startup? what language are the
machines (us or uk english, something else?) i'm not seeing this on two
machines (one running 10.4, the other 10.5).
Additional Comment #5 From andrei.vlsk 2008-11-26 17:22
As i mentioned it in my comment to id=986 bug, I have the same problem on WinXP
(except the menu line disappearance).
Additional Comment #6 From num3ric 2008-11-26 19:09
Yes, it does happen all the time (and only since the last version). I tried to reinstall it and it
yields the same results. My system is in French and I just checked my Java settings : I'm
running on version J2SE 5.0. It could not be related with the fact that I have both 135 and 1.0
installed, no?

I'll email my father now to see if he gets this also.

Thank you for your time,
Eric
Additional Comment #7 From fry 2008-11-26 19:18
Try moving Library > Processing > preferences.txt to the Desktop and then
try to start Processing. Does that work? If it does, please attach the
preferences.txt file to this bug so I can dissect what's going on.
Additional Comment #8 From num3ric 2008-11-26 19:44
Ok, I tried and I makes no difference. After removing it and starting Processing the following
happens:

1) - I get the usual "notification about the menu within the app" window.
- preferences.txt is recreated.
2) - Processing is now running, but there is no window open whatsoever. (This is probably
anormal and related to the problem).
3) - Since I have no menu, I must drag&drop any .pde file on my doc to start programming.
4) - The bug is still present.


Additional Comment #9 From tanepierre 2008-11-27 13:14
(In reply to comment #4)
Same settings than num3ric (#6) except for the system settings, aka:
* MacOS X 10.5.5
* java version "1.5.0_16"
* system settings in US English
... and similar symptoms:
* reinstalling Processing didn't help
* once it fails after attempting File>New (or its shortcut equivalent), it
doesn't open any windows
Additional Comment #10 From fry 2008-11-27 14:35
Hm, two other things to try:

1. Fix permissions with Disk Utility.
2. Make sure that your /tmp folder doesn't have weird permissions. The
error seems to suggest that it couldn't create the temporary sketch file.

In your /tmp folder, it should be creating folders like
"untitled50280.tmp", if it's not there may be a permissions issue. (Check
the time that the folder is created, there should be new ones each time you
use File > New.)
Additional Comment #11 From uqam 2008-11-27 17:52
I think I have found the bug source. It does not seem to be a permission problem. It must be an
identifier issue at the creation of the folder and file within /tmp --> untitled#####.tmp folder.
When we make a new file, it generates a new repertory called sketch_nov.27a. Now, if we
change both the folder and .pde files' name to sketch_nov_27a, it is now possible to open it with
Processing 1.0. Therefore, it must be the dot before the date that causes the problem!
Additional Comment #12 From fry 2008-11-27 17:59
Wow, I don't know what that dot is doing in there, but I wonder if it's a
localization issue. At any rate, that's something that can be fixed fairly
easily and I'll give it a shot asap. Thanks for looking into it!
Additional Comment #13 From fry 2008-11-27 18:18
I've attached a new version of pde.jar, try replacing the version found at
Processing.app/Contents/Resources/Java/pde.jar with the one attached to
this bug report, and see if it starts working.
Additional Comment #14 From fry 2008-11-27 18:19
edit]
replacement pde.jar with possible fix
Additional Comment #15 From uqam 2008-11-27 18:43
Yes, everything is now working fine. No more problem with the new command. With the pde.jar
that you post, the temporary file and folder are written without the dot : as in "sketch_nov27a".
JF
Additional Comment #16 From fry 2008-11-27 19:14
Great! Thanks again for tracking this down, it's enormously helpful (I test
on at least eight different machines on a regular basis, but it still
doesn't catch everything...amazing.) We have a couple other issues like
this one that I'd like to iron out and get a release 1.0.1 out in the next
few days or so.
Additional Comment #17 From tanepierre 2008-11-28 02:23
(In reply to comment #13)

Hi! I can confirm that replacing the pde.jar with your replacement one
fixed the issue on my machine as well. looks like that one has been nailed!

Thanks for the fantastic work done with the development work on Processing
over the years!
Additional Comment #18 From fry 2008-11-29 08:35
Closing the bug and marking as fixed for 1.0.1.
Additional Comment #19 From fry 2008-11-29 11:52
*** Bug 1080 has been marked as a duplicate of this bug. ***