JDK-6378728 : -proc:only generates classes if no processors found
Type:Bug
Component:core-libs
Sub-Component:javax.annotation.processing
Affected Version:6
Priority:P3
Status:Closed
Resolution:Fixed
OS:generic
CPU:generic
Submitted:2006-01-30
Updated:2010-05-09
Resolved:2006-03-04
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.
If you specify -proc:only and no processors can be found, no processing happens and the compiler proceeds to fully compile the specified classes.
A diagnostic would be a better outcome.
Comments
SUGGESTED FIX
src/share/classes/com/sun/tools/javac/resources>sccs sccsdiff -r1.109 -r1.110 compiler.properties
------- compiler.properties -------
644a645,647
> compiler.warn.proc.proc-only.requested.no.procs=\
> Annotation processing without compilation requested but no processors were found.
>
src/share/classes/com/sun/tools/javac/main>sccs sccsdiff -r1.91 -r1.92 JavaCompiler.java
------- JavaCompiler.java -------
783c783
< }
---
> }
815a816,823
> // If there are no annotation processors present, and
> // annotation processing is to occur with compilation,
> // emit a warning.
> Options options = Options.instance(context);
> if (options.get("-proc:only") != null) {
> log.warning("proc.proc-only.requested.no.procs");
> todo.clear();
> }
822,823c830
< }
< else {
---
> } else {