Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 323422

Summary: [launcher] --launcher.overrideVmargs/appendVmArgs incorrectly consumed
Product: [Eclipse Project] Equinox Reporter: Andrew Niefer <aniefer>
Component: FrameworkAssignee: equinox.framework-inbox <equinox.framework-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: daniel_megert, tjwatson
Version: 3.6   
Target Milestone: 3.7 M2   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Andrew Niefer CLA 2010-08-23 14:16:29 EDT
Main processes the program arguments  to set some system properties and remove other launcher specific arguments.

If the last argument is a flag without a value, then it does not get processed.  This is because we check flags at args[i - 1] but only loop to i < args.length
Comment 1 Andrew Niefer CLA 2010-08-23 14:23:29 EDT
Sorry, I was wrong about this.

This is a bug in the way we are consuming the --launcher.overrideVmargs and appendVmargs specifically.  These arguments are handled where we are expecting a parameter, they need to be handled earlier when we are checking for flags.
Comment 2 Andrew Niefer CLA 2010-08-23 14:42:10 EDT
fixed
Comment 3 Thomas Watson CLA 2010-08-24 12:01:22 EDT
This is a flag the check so the [i-1] is incorrect and causes this:

java.lang.ArrayIndexOutOfBoundsException: -1
	at org.eclipse.equinox.launcher.Main.processCommandLine(Main.java:1496)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:542)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1409)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1385)
Comment 4 Andrew Niefer CLA 2010-08-30 16:13:45 EDT
this was fixed in v20100824b