Bug 138018 - When passed unsupported javac -warn warning options, fail gracefully & ignore
Summary: When passed unsupported javac -warn warning options, fail gracefully & ignore
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P3 minor (vote)
Target Milestone: 3.4 M4   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-04-21 14:09 EDT by Nick Boldt CLA
Modified: 2007-12-11 09:33 EST (History)
3 users (show)

See Also:


Attachments
Proposed fix (9.35 KB, patch)
2007-08-01 14:28 EDT, Olivier Thomann CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Boldt CLA 2006-04-21 14:09:02 EDT
This is related to bug 138017, but I'd just like to see better handling of the case where an invalid option is passed to the java -warn: flag.

Thus, instead of:

    [javac] invalid warning: +nls
    [javac] Compile failed; see the compiler error output for details.

We could have:

    [javac] invalid warning: +nls. Ignoring warning & compiling anyway.
Comment 1 Olivier Thomann CLA 2006-04-21 14:54:16 EDT
This is debatable.
What about a compilation that takes 30 minutes? You didn't specify a valid option and the compilation continues anyway. At the end, you have to change it and do it again.
Comment 2 Olivier Thomann CLA 2006-04-25 22:49:03 EDT
Closing as LATER.
I will revisit the warning option on the command line for 3.3. I think we could
improve it with a syntax like this:
-warn:-serial,unusedLocal,+nls

All options after the '-' would be disabled and all the options after the +
would be enabled.
Comment 3 Philipe Mulet CLA 2006-04-26 05:16:30 EDT
I would also favor being resilient to unsupported warning names (a la @SuppressWarnings) to ease adoption.
Comment 4 Nick Boldt CLA 2007-07-30 18:15:36 EDT
Reopen for 3.4?
Comment 5 Olivier Thomann CLA 2007-07-30 18:18:31 EDT
Reopen for consideration in 3.4.
Comment 6 Olivier Thomann CLA 2007-08-01 14:28:23 EDT
Created attachment 75145 [details]
Proposed fix
Comment 7 Olivier Thomann CLA 2007-08-01 14:28:50 EDT
Philippe, please review.
Comment 8 Philipe Mulet CLA 2007-10-29 06:27:57 EDT
Looks good to me.
Comment 9 Olivier Thomann CLA 2007-10-29 12:19:58 EDT
Move to 3.4M4.
This will be released as soon as the 3.4M3 is declared.
Comment 10 Olivier Thomann CLA 2007-11-07 12:01:08 EST
Released for 3.4M4.
In order to verify, invalid options need to be passed to the batch compiler.
Comment 11 Olivier Thomann CLA 2007-11-07 12:02:57 EST
Added regression test org.eclipse.jdt.core.tests.compiler.regression.BatchCompilerTest#test152
Comment 12 David Audel CLA 2007-12-11 09:33:42 EST
Verified for 3.4M4 using build I20071210-1800.