Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-2209063 | 6u30 | Dmeetry Degrave | P4 | Closed | Fixed | b01 |
JDK-2172177 | OpenJDK6 | Martin Buchholz | P3 | Resolved | Fixed | b16 |
FULL PRODUCT VERSION :
java version "1.6.0"
Java(TM) SE Runtime Environment (build 1.6.0-b105)
Java HotSpot(TM) Client VM (build 1.6.0-b105, mixed mode, sharing)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows XP [Version 5.1.2600]
A DESCRIPTION OF THE PROBLEM :
javac fails with "incompatible types" in combination with (unrelated) annotation processing.
It seems that this only happens for defaults of annotation values.
Effected are at least annotations (see example) and typed Classes (f.e. Class<? extends Enum>).
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. compile test/M.java and test/P.java into a directory "dir"
2. compile test/A.java, test/D.java and test/V.java with
-processor test.P
-cp dir
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
compile without errors
ACTUAL -
compiler error "incompatible types" test.V vs. test.V
ERROR MESSAGES/STACK TRACES THAT OCCUR :
C:\dev\jtools\research\src\test\test\A.java:20: incompatible types
found : test.V
required: test.V
V value() default @V;
^
[javac] 1 error
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
---test/M.java---
package test; public @interface M {}
---test/P.java---
package test;
import java.util.Set;
import javax.annotation.processing.*;
import javax.lang.model.SourceVersion;
import javax.lang.model.element.TypeElement;
@SupportedAnnotationTypes("test.M")
@SupportedSourceVersion(SourceVersion.RELEASE_6)
public class P extends AbstractProcessor {
public boolean process(Set< ? extends TypeElement> arg0, RoundEnvironment arg1) {
return false;
}
}
---test/A.java---
package test;
public @interface A {
V value() default @V;
}
---test/D.java
package test;@M public interface D {}
---test/V.java
package test; public @interface V {}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
run processors separately.
* javac -proc:only
* javac -proc:none
This is not adequate.
java version "1.6.0"
Java(TM) SE Runtime Environment (build 1.6.0-b105)
Java HotSpot(TM) Client VM (build 1.6.0-b105, mixed mode, sharing)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows XP [Version 5.1.2600]
A DESCRIPTION OF THE PROBLEM :
javac fails with "incompatible types" in combination with (unrelated) annotation processing.
It seems that this only happens for defaults of annotation values.
Effected are at least annotations (see example) and typed Classes (f.e. Class<? extends Enum>).
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. compile test/M.java and test/P.java into a directory "dir"
2. compile test/A.java, test/D.java and test/V.java with
-processor test.P
-cp dir
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
compile without errors
ACTUAL -
compiler error "incompatible types" test.V vs. test.V
ERROR MESSAGES/STACK TRACES THAT OCCUR :
C:\dev\jtools\research\src\test\test\A.java:20: incompatible types
found : test.V
required: test.V
V value() default @V;
^
[javac] 1 error
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
---test/M.java---
package test; public @interface M {}
---test/P.java---
package test;
import java.util.Set;
import javax.annotation.processing.*;
import javax.lang.model.SourceVersion;
import javax.lang.model.element.TypeElement;
@SupportedAnnotationTypes("test.M")
@SupportedSourceVersion(SourceVersion.RELEASE_6)
public class P extends AbstractProcessor {
public boolean process(Set< ? extends TypeElement> arg0, RoundEnvironment arg1) {
return false;
}
}
---test/A.java---
package test;
public @interface A {
V value() default @V;
}
---test/D.java
package test;@M public interface D {}
---test/V.java
package test; public @interface V {}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
run processors separately.
* javac -proc:only
* javac -proc:none
This is not adequate.
- backported by
-
JDK-2172177 "incompatible types" after (unrelated) annotation processing
- Resolved
-
JDK-2209063 "incompatible types" after (unrelated) annotation processing
- Closed
- duplicates
-
JDK-6954300 Annotation with generics causes javac to fail when annotation processor present
- Closed
-
JDK-7037412 "incompatible types" Error on Annotations when not using compile time processor
- Closed
-
JDK-6558580 Annotation processing leads to types being incompatible with it self
- Closed
- relates to
-
JDK-6983239 TreeScanner does not scan default value for method
- Closed
(1 relates to)