Bug 210518 - [batch][compiler][options] -warn:unused wrongly behaves as -warn:+unused
Summary: [batch][compiler][options] -warn:unused wrongly behaves as -warn:+unused
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.4   Edit
Hardware: PC All
: P3 normal (vote)
Target Milestone: 3.4 M5   Edit
Assignee: Maxime Daniel CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 168604
  Show dependency tree
 
Reported: 2007-11-21 05:37 EST by Maxime Daniel CLA
Modified: 2008-02-04 09:02 EST (History)
6 users (show)

See Also:
kent_johnson: review+


Attachments
Fix + test case (5.18 KB, patch)
2007-11-29 07:40 EST, Maxime Daniel CLA
no flags Details | Diff
Renumbered test cases (2.23 KB, patch)
2008-01-03 02:25 EST, Maxime Daniel CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Maxime Daniel CLA 2007-11-21 05:37:20 EST
Build id: I20071120-1300
See also discussion in bug 168604.

On the following source code:
public class X {
	public static void foo() {
     String s = null;
     s.toString();
     String u;
   }
}

the batch compiler launched with -warn:null -warn:unused should, according to its documentation, only report one warning. It reports two, as if passed -warn:null -warn:+unused. Entered BatchCompilerTest#156 (inactive) and 157.
Comment 1 Maxime Daniel CLA 2007-11-28 09:20:29 EST
I'll fix that in 3.4 cycle, except if someone opposes to it.
Comment 2 Philipe Mulet CLA 2007-11-28 10:04:34 EST
Pls double check on consequences to our clients, like releng scripts (Olivier may help there).
I agree on the principle, but in practice, this may be creating more troubles than  benefits.

Comment 3 Maxime Daniel CLA 2007-11-29 07:40:17 EST
Created attachment 84054 [details]
Fix + test case

I initially thought that this proposal was too hard when barking at people using things like -warn:null,+unused or -warn:null,-unused, but... the former would at best translate into -warn:null,unused, which is more concise hence better, and the latter would equate to -warn:null, and there is no point in using it instead.
Hence the current proposal, which does not accept pluses or minuses in a -warn:something,another,yetanother series that does not start with a plus or a minus.

Will post to the news to get users' feelings.

Olivier, please yell if releng (or others you know of) are badly impacted.

Kent, would you please review this patch?
Comment 4 Maxime Daniel CLA 2007-12-04 00:25:09 EST
So far no-one protested in the news.

Philippe demanded yesterday that I directly got in touch with a few people.
Comment 5 Maxime Daniel CLA 2007-12-04 00:38:18 EST
By cc, Andrew, Tim, Tom, would any of you get badly broken if we aligned the implementation with the spec here? If there is any strong supporter of the implementation vs the spec, would he be kind enough to suggest a satisfactory wording for an aligned spec?
Comment 6 Andrew Niefer CLA 2007-12-04 12:01:29 EST
Build supports setting warning levels as well as passing custom batch compiler arguments, therefore it is possible that a releng team would pass what effectively was
-warn:<custom options> -warn:<build.property warning options>

This change could affect any bundle specifying warning levels, however I have no real problem since we are changing to match the docs and (without really thinking about it) I had always personally assumed the build.properties would override everything else.  The build.properties option is not surfaced in the UI and would therefore only be used by people who read the docs.
Comment 7 Maxime Daniel CLA 2008-01-03 02:25:08 EST
Created attachment 86074 [details]
Renumbered test cases
Comment 8 Maxime Daniel CLA 2008-01-03 03:36:35 EST
Released for 3.4 M5.
Comment 9 Eric Jodet CLA 2008-02-04 09:02:52 EST
Verified for 3.4M5 using build I20080204-0010