-
Bug
-
Resolution: Fixed
-
P4
-
9, 10, 11
-
b04
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8269632 | 11.0.13-oracle | Adam Sotona | P4 | Resolved | Fixed | b01 |
JDK-8269355 | 11.0.13 | Aleksey Shipilev | P4 | Resolved | Fixed | b01 |
The JDK 9 javac emits annotations.without.processors warnings that were not present with JDK 8, and which appear to be incorrect:
=== P.java
import java.util.Set;
import javax.annotation.processing.AbstractProcessor;
import javax.annotation.processing.RoundEnvironment;
import javax.annotation.processing.SupportedAnnotationTypes;
import javax.lang.model.SourceVersion;
import javax.lang.model.element.TypeElement;
@SupportedAnnotationTypes("*")
public class P extends AbstractProcessor {
@Override
public SourceVersion getSupportedSourceVersion() {
return SourceVersion.latestSupported();
}
@Override
public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) {
return false;
}
}
=== A.java
@Deprecated
class A {
}
===
# JDK 8
$ javac -fullversion -XDrawDiagnostics -Xlint:processing -processor P A.java
javac full version "1.8.0_162-ea-b03"
... no warnings
# JDK 9
javac -fullversion -XDrawDiagnostics -Xlint:processing -processor
P A.java
javac full version "9.0.1+11"
- compiler.warn.proc.annotations.without.processors: java.base/java.lang.Deprecated
1 warning
=== P.java
import java.util.Set;
import javax.annotation.processing.AbstractProcessor;
import javax.annotation.processing.RoundEnvironment;
import javax.annotation.processing.SupportedAnnotationTypes;
import javax.lang.model.SourceVersion;
import javax.lang.model.element.TypeElement;
@SupportedAnnotationTypes("*")
public class P extends AbstractProcessor {
@Override
public SourceVersion getSupportedSourceVersion() {
return SourceVersion.latestSupported();
}
@Override
public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) {
return false;
}
}
=== A.java
@Deprecated
class A {
}
===
# JDK 8
$ javac -fullversion -XDrawDiagnostics -Xlint:processing -processor P A.java
javac full version "1.8.0_162-ea-b03"
... no warnings
# JDK 9
javac -fullversion -XDrawDiagnostics -Xlint:processing -processor
P A.java
javac full version "9.0.1+11"
- compiler.warn.proc.annotations.without.processors: java.base/java.lang.Deprecated
1 warning
- backported by
-
JDK-8269355 Incorrect annotations.without.processors warnings with JDK 9
- Resolved
-
JDK-8269632 Incorrect annotations.without.processors warnings with JDK 9
- Resolved
- relates to
-
JDK-8231443 Add java.io.Serial to list of platform annotations for annotation processing
- Resolved
-
JDK-6999068 -Xlint warns unnecessarily about unclaimed annotations
- Closed
(1 links to)