Skip to content

Filenames ending with a "negative" number do not work #4861

@Jebbs

Description

@Jebbs

I work as a grader for an intro CS class that uses Processing. The software that students use to submit their assignments will append numbers to the filename if a student resubmits their assignment, which gives me something like "assignment-1.pde" when I download it.

When I try to run this file using the command line compiler, I get a crash with the following output:

Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0
        at processing.app.Sketch.getCode(Sketch.java:1644)
        at processing.app.Sketch.getMainProgram(Sketch.java:1669)
        at processing.mode.java.JavaBuild.preprocess(JavaBuild.java:216)
        at processing.mode.java.JavaBuild.preprocess(JavaBuild.java:155)
        at processing.mode.java.JavaBuild.build(JavaBuild.java:122)
        at processing.mode.java.Commander.<init>(Commander.java:274)
        at processing.mode.java.Commander.main(Commander.java:86)

When I try to open the file with the IDE, I get an error there as well:
processingissue

I get the same error if I change the ending to "-2", so only it seems that ending in "negative" numbers breaks something. Removing the "-1" causes the error to go away given nothing else is wrong with the filename.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions