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

Infinite loop in getAnnotation().

XMLWordPrintable

    • apt
    • b54
    • x86
    • windows_xp


      ###@###.### 2004-05-20

      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):
        Windows XP

      Hardware Configuration Information (be specific):
        Dell Optiplex

      Bug Description:
        Create an annotation with @Inherit added to it e.g.

      @Inherited
      public @MyAnn {}

        Create an annotation processor, and somewhere under the visit() method call

         typeDeclaration.getAnnotation(MyAnn.class);

        If typeDeclaration refers to an Enum, then this method never returns.
        However, but also not seen any stack overflows, so assume it's
        infinite looping.

        If typeDeclaration is not an enum, this returns as expected. If MyAnn is
        not annotated with Inherited, this returns as you'd expect.

        There is some other case where it infinite loops - this requires
        @Inherited, and for the Annotation to be present on typeDeclaration.

            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: