Community
Participate
Working Groups
3.2 RC2 The batch compiler help message reads: ... -deprecation + deprecation outside deprecated code which means that adding that option is neutral (on by default). But this is not the case. As documented in the help system, -deprecation is equivalent to -warn:deprecation, in effect disabling other warnings like assertIdentifier, charConcat, etc.
-deprecation should not have any effect on other warnings. This would be a bug.
I will revisit the warning settings post 3.2.
(In reply to comment #1) > -deprecation should not have any effect on other warnings. > This would be a bug. > If we want to follow javac -deprecation semantics, -deprecation should be an alias for -warn:+deprecation indeed.
This is right. But I think we can revisit completely the way we set the warnings to be able to combine + and - inside the same warn option. There is another PR for this.
This is off only if the default warning level is overriden. So this works as designed. I will add a line in the help of the batch compiler.
Created attachment 54608 [details] Proposed fix
Created attachment 54609 [details] Updated regression tests
If your concern is about -deprecation being equivalent to -warn:deprecation instead of -warn:+deprecation, I'll update the help documentation in addition to the patches already submitted. Let me know if this is ok for you.
Released for 3.3M4. Please reopen if the new help contents is still unclear.
Let's step back. From the tests I've just made a minute ago, 3.3 M4 equates -deprecation to -warn:+deprecation. I believe it was not the case for the version I opened the bug for, but that it equated -deprecation to -warn:deprecation, hence my initial request. If this is the current behavior, then it is aligned with the intuitive definition for default warnings, and the following should be enough for the documentation: -deprecation + deprecation outside deprecated code or if you want to be more explicit: -deprecation + deprecation outside deprecated code (equivalent to -warn:+deprecation) The help system contents should also be aligned with the current behavior as well. ('Compiling Java code' article, which says that -deprecation is equivalent to -warn:deprecation.) In other words, given the current behavior, the help message should be reverted, and the the help contents should be aligned on the help message. Does that make sense?
Did you check the help contents before reopening? I modified it to align it with -warn:+deprecation. I can change the printUsage of the batch compiler to be the one you mentionned if you believe this is clearer.
(In reply to comment #11) > Did you check the help contents before reopening? No, at least not the right contents (went to the help system, not to the files in HEAD). Sorry for that. > I modified it to align it with -warn:+deprecation. > I can change the printUsage of the batch compiler to be the one you mentionned > if you believe this is clearer. Yes, please.
Released for 3.3M4. To verify check the help contents + the print usage of the batch compiler.
Verified for 3.3 M4 using build I20061212-0010.