JDK-6403456 : -Werror should work with annotation processing
  • Type: Bug
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 6
  • Priority: P4
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2006-03-24
  • Updated: 2011-03-07
  • Resolved: 2011-03-07
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 7
7 b105Fixed
Related Reports
Relates :  
Description
Currently, the knowledge that warnings have occurred is lost across annotation processing rounds. This means that -Werror does not detect warnings that were generated in prior processing rounds.

Comments
EVALUATION See test test/tools/javac/processing/filer/TestLastRound.java to be added as part of fix for CR 6966604
23-07-2010

EVALUATION -Werror is a hidden option that is just provided to simplify some types of regression testing. Any more sophisticated behavior (such as treating warnings as errors before, during or after annotation processing) can be better achieved through JSR199, and DiagnosticListeners, possibly in conjunction with a compiler TaskListener. Therefore there would not seem to be any requirement to make -Werror more sophisicated. However, it does seem reasonable to at least make -Werror work according to its current minimal spec (warnings cause a non-zero exit code) even in the face of annotation processing.
14-07-2006