JDK-5044125 : javac allows cyclic annotation interfaces with arrays
  • Type: Bug
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 5.0
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: solaris_8
  • CPU: generic
  • Submitted: 2004-05-07
  • Updated: 2017-05-19
  • Resolved: 2004-05-28
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.
Other
5.0 b54Fixed
Related Reports
Relates :  
Relates :  
Description
As you can see from the behavior of the following program, this should be prohibited.

import java.lang.annotation.Retention;
import static java.lang.annotation.RetentionPolicy.*;

@Retention(RUNTIME)
@interface A {
    A[] values() default { @A() };
}

@A()
class Main {
    public static void main(String[] args) {
        A a = Main.class.getAnnotation(A.class);
        System.out.println(a);
    }
}

Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: tiger-rc FIXED IN: tiger-rc INTEGRATED IN: tiger-b54 tiger-rc
14-06-2004

PUBLIC COMMENTS ...
10-06-2004

EVALUATION Should be fixed, if so specified. ###@###.### 2004-05-10
10-05-2004