Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-5052662

getAnnotation() proxy fails for elements of Enum array type

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P3 P3
    • None
    • 5.0
    • tools
    • apt
    • x86
    • windows_2000


      ###@###.### 2004-05-24

      J2SE Version (please include all output from java -version flag):
        java version "1.5.0-beta2"
        Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-beta2-b50)
        Java HotSpot(TM) Client VM (build 1.5.0-beta2-b50, mixed mode, sharing)

      Does this problem occur on J2SE 1.4 or 1.4.1 or 1.4.2? Yes / No (pick one)
        N/A

      Operating System Configuration Information (be specific):
        Win 2K

      Hardware Configuration Information (be specific):
        N/A

      Bug Description:
        apt tool and mirror API. When a Annotation proxy returned from
        Declaration.getAnnotation() has a member that returns an array of
        some Enum type, and the element method is called on the proxy, the
       following exception is thrown

      Problem encountered during annotation processing.
      [LMyEnum;.c
      java.lang.EnumConstantNotPresentException: [LMyEnum;.c
              at sun.reflect.annotation.EnumConstantNotPresentExceptionProxy.generateE
      xception(EnumConstantNotPresentExceptionProxy.java:28)
              at sun.reflect.annotation.AnnotationInvocationHandler.invoke(AnnotationI
      nvocationHandler.java:56)
              at $Proxy0.value(Unknown Source)
              at MyProcessor.process(MyProcessor.java:21)
              at com.sun.mirror.util.CompositeAnnotationProcessor.process(CompositeAnn
      otationProcessor.java:51)
              at com.sun.tools.apt.comp.Apt.main(Apt.java:370)
              at com.sun.tools.apt.main.JavaCompiler.compile(JavaCompiler.java:418)
              at com.sun.tools.apt.main.Main.compile(Main.java:939)
              at com.sun.tools.apt.main.Main.compile(Main.java:822)
              at com.sun.tools.apt.Main.compile(Main.java:41)
              at com.sun.tools.apt.Main.main(Main.java:32)

      Steps to Reproduce (be specific):
        - unpack the attached jar file into a working directory
        - compile the source code with javac and tools.jar
        - run the apt tool using the working directory and tools.jar
          as the classpath, and all the source code as arguments.

      The exception is thrown.

      U:>javac -cp "C:\Program Files\Java\jdk1.5.0\lib\tools.jar" *.java

      U:>apt -cp .;"C:\Program Files\Java\jdk1.5.0\lib\tools.jar" *.java
      Note: @MyAnn found on MyAnnTarget
      Problem encountered during annotation processing.
      [LMyEnum;.c
      java.lang.EnumConstantNotPresentException: [LMyEnum;.c
              at sun.reflect.annotation.EnumConstantNotPresentExceptionProxy.generateE
      xception(EnumConstantNotPresentExceptionProxy.java:28)
              at sun.reflect.annotation.AnnotationInvocationHandler.invoke(AnnotationI
      nvocationHandler.java:56)
              at $Proxy0.value(Unknown Source)
              at MyProcessor.process(MyProcessor.java:21)
              at com.sun.mirror.util.CompositeAnnotationProcessor.process(CompositeAnn
      otationProcessor.java:51)
              at com.sun.tools.apt.comp.Apt.main(Apt.java:370)
              at com.sun.tools.apt.main.JavaCompiler.compile(JavaCompiler.java:418)
              at com.sun.tools.apt.main.Main.compile(Main.java:939)
              at com.sun.tools.apt.main.Main.compile(Main.java:822)
              at com.sun.tools.apt.Main.compile(Main.java:41)
              at com.sun.tools.apt.Main.main(Main.java:32)





            sseligmasunw Scott Seligman (Inactive)
            tyao Ting-Yun Ingrid Yao (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: