Summary: | AJC behaves different when using @ to supply parameters | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Product: | [Tools] AspectJ | Reporter: | Gerard Davison <Gerard.davison> | ||||||||
Component: | Compiler | Assignee: | Adrian Colyer <adrian.colyer> | ||||||||
Status: | RESOLVED FIXED | QA Contact: | |||||||||
Severity: | normal | ||||||||||
Priority: | P3 | ||||||||||
Version: | 1.2.1 | ||||||||||
Target Milestone: | --- | ||||||||||
Hardware: | PC | ||||||||||
OS: | Windows XP | ||||||||||
Whiteboard: | |||||||||||
Attachments: |
|
Description
Gerard Davison
2004-05-04 08:34:00 EDT
Created attachment 10248 [details]
Batch file with all parameter in-line
Created attachment 10249 [details]
aj2.bat, with @ specified parameters
Created attachment 10250 [details]
aj2.param, external parameters for aj2.bat
I've copied Wes (hope he doesn't mind!) as I'd like his opinion on this - he might have seen some previous bug report along these lines. Basically, if you want to supply these kinds of argument in a .lst file then you need to supply one per line. If your command line was: ajc -sourceroots . -classpath "a.jar;b.jar" then it looks like this in a .lst file: ---------- -sourceroots . -classpath "a.jar;b.jar" ---------- If you put: ---------- -sourceroots . -classpath "a.jar;b.jar" ---------- then the parsing code interprets each of these as a single option and as there is no single option called "-sourceroots ." then it fails. If you put: ---------- -sourceroots . -classpath "a.jar;b.jar" ---------- then the parsing code interprets it as a single option and as there is no single option called '-sourceroots . -classpath "a.jar;b.jar"' then it fails. The code that doesn't break lines in .lst files into pieces is: ConfigParser.parseConfigFileHelper() And there may be a further peculiarity with -verbose ... I think we check for -verbose before even opening the .lst file, so putting it in there rather than directly passing it to ajc is too late for it to 'switch on' verbose output. All true: there should be no difference to ajc between specifying arguments on the command-line or in a .lst file, except (a) relative .lst file arguments are calculated relative to the .lst file, not the current working driectory; and (b) special arguments like -verbose. Also, if there is a problem with the argument, ajc should point to the offending .lst file. If ajc quoted the offending argument, then the error might be clearer: from: error directory does not exist: -inpath mydir to: error directory does not exist: "-inpath mydir" Further, "directory does not exist" is just the last condition and rarely helplful; it could say to: error unrecognized input: "-inpath mydir" These two changes would be harmless but helpful. Okay I suppose that I didn't really know that was a limitation because I think that javac and javadoc allow more than one parameter on a line. But as you say it might be worth improving the error messages, possibly even failing if it detects more than one parameters on a line. I've put in a fix for this - I think its ok - if no-one on the bug complains I'll leave it like this ... Basically I've changed the message and quoted it as per Wes' comment - but I didn't use 'unrecognized input', I used: [error] unrecognized single argument: "-inpath mydir" Is that ok? I did implement a fix that allowed for multiple arguments on each line of a .lst file - but the implementation basically assumed ' ' was an argument boundary (but it allowed for ' ' within an argument if it was quoted). The problem is all the .lst files out there in the wild may have entries like: c:\program files\eclipse\blah.java c:\program files\eclipse\aspect.java which are paths that contain spaces but aren't quoted - so putting in my fix will break people using .lst files with entries like that. Fixed by Andy, closing out since no further comments were added in the last 6 months. |