Name: viR10068 Date: 12/10/2003
The spec 'A Program Annotation Facility for the Java Programming Language' says:
"If the member type is an annotation type, the MemberValue must
be an Annotation with the same type. "
But the compiler jdk1.5-b30 does not rejects the invalid java source with
incorrect annotation type.
The following JCK tests are failed due to this bug:
lang/ANNOT/annot039/annot03905/annot03905.html
The source code:
-------------------------- test.java ----------------------------
import java.io.PrintStream;
@interface Annot1 {
float id();
}
@interface Annot2 {
String id();
}
@interface testInter {
Annot1 id();
}
public class test {
@testInter(id = @Annot2) public void m(){
}
public static void main(String argv[]) {
System.exit(run(argv, System.out) + 95/*STATUS_TEMP*/);
}
public static int run(String argv[],PrintStream out) {
return 0/*STATUS_PASSED*/;
}
}
-----------------------------------------------------------------
Execution log:
% jdk1.5.0-b30/solaris-sparc/bin/javac -source 1.5 -target 1.5 -version test.java
javac 1.5.0-beta
%
======================================================================
- duplicates
-
JDK-4951298 compiler: crashes when attributes with same elements are used in place of other
- Resolved