Bug 1332 : Creating a new tab and deleting it causes errors when Run is pressed
Last modified: 2009-10-18 11:11



Assigned To:

Attachment Type Created Size Actions
Patch to resolve the Bug patch 2009-09-18 23:37 344 bytes

Description:   Opened: 2009-09-18 22:42
I am working on Processing 1.0.6 found the following bug:

This happens when you work on a Sketch with multiple Tabs (files).
The procedure to replicate the bug is the following:

[1] Add a new Tab (File) with a filename starting with a letter prior of the already existing
For example, if you have the following three tabs: "Main", "Second", "Third" you have to
add a Tab with a filename starting with a letter between 'M' and 'T' or before 'M'. So try to
add "Nine".
[2] Delete the Tab you just inserted.

You will notice that the Sketch does not compile, with the following error: Duplicate nested
type <name of your last Tab>.

This happens every time you delete a Tab which is between another ones, either it had
written anything in it, either not.

You have to restart Processing, in order to get it working.

This happens on a Mac, I don't have any Linux or Windows PC to test it elsewhere.
Additional Comment #1 From Victoras 2009-09-18 23:37
Patch to resolve the Bug

To apply the patch:

cd processing/app/src/processing/app/

patch < Sketch.patch
Additional Comment #2 From Victoras 2009-09-18 23:40
(From update of edit])
><html><body><pre style="word-wrap: break-word; white-space: pre-wrap;">--- Sketch.java 2009-09-19 01:32:33.000000000 -0500
>+++ Sketch.new.java 2009-09-19 01:32:27.000000000 -0500
>@@ -594,7 +594,8 @@
> for (int j = i; j < codeCount-1; j++) {
> code[j] = code[j+1];
> }
>- codeCount--;
>+ code = (SketchCode[]) PApplet.shorten(code); // BUG #1332 Fixed by Victor Mateevitsi
>+ codeCount--;
> return;
> }
> }
Additional Comment #3 From fry 2009-09-19 11:17
Thanks much for looking into it, I'll get that patched for the next
release. 1.0.8 should be coming soon.
Additional Comment #4 From fry 2009-10-18 11:11
applied, along with a related fix, for 1.0.8.