| Summary: | Empty string as a program argument not accepted. | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Paul Smith <paul.smith> |
| Component: | Debug | Assignee: | Darin Wright <darin.eclipse> |
| Status: | VERIFIED FIXED | QA Contact: | |
| Severity: | minor | ||
| Priority: | P3 | ||
| Version: | 3.0 | ||
| Target Milestone: | 3.1 M3 | ||
| Hardware: | PC | ||
| OS: | Windows NT | ||
| Whiteboard: | |||
Sorry, I missed out the parameters entered: word1 "" "part1 part2" word2 Fixed in ExecutionArguments. Added 2 tests to LaunchConfigurationArgumentTests. Please verify, Jared. I have downloaded the latest nightly build and found that it now works - thanks very much for the fast resolution. Only committers verify bugs. Thanks for double-checking, though. (marking fixed) Reopening. The implementation doesn't look for an empty string (""), it just looks for an empty buffer at
one point in the parsing process. If you just pass in a *single* double-quote ("), the "parse buffer" also
happens to be empty, so we incorrectly add the second double-quote to the arguments.
Fixed in ExecutionArguments with an explicit check for an empty string argument. Please verify, DW. Verified. (However, external tools now has the same bug - I will file a new bug to consolidate the support). |
I have a collegue who cannot debug (or run) with an empty string argument (i.e. ""). Here's a simple proof of case program: // START public class Test { public static void main(String[] args) { System.out.println("There are " + args.length + " arguments."); for (int i = 0; i < args.length; i++) { System.out.println("arg " + (1 + i) + "=[" + args[i] + "]"); } } } // END In Run -> Debug... -> Arguments [Tab], enter the following in 'Program Arguments': The output from the program in debug or run is as follows. There are 3 arguments. arg 1=[word1] arg 2=[part1 part2] arg 3=[word2] However, running the program from the command line gives: There are 4 arguments. arg 1=[word1] arg 2=[] arg 3=[part1 part2] arg 4=[word2] The JRE for the project being used is 1.4.2_05 This is a minor inconvenience but is a difference to how Java command line performs so I thing it needs to be resolved. Please excuse me if I have missed an option. I have trawled the Web and looked in the bug database without success.