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

Calls to annotate.flush() cause incorrect type annotations to be generated.

XMLWordPrintable

    • b113
    • Not verified

      Calls to annotate.flush() in MemberEnter and ClassReader cause TypeAnnotationPosition to visit some tree nodes before they have been visited by memberEnter. TypeAnnotationPosition handles this case by failing silently, which ultimately cause the annotations it attempts to attach to be incorrectly placed in Runtime[In]VisibleAnnotations attributes as opposed to Runtime[In]VisibleTypeAnnotations.

      Type annotation code needs to be refactored in the following ways:

      1) The silent failures need to be replaced by exceptions. This is a failure condition; it should not simply fail silently.

      2) The code needs to be redesigned to ensure that TypeAnnotationPosition cannot visit a tree node until it has been visited by memberEnter.

      3) Better tests need to be developed.

            emc Eric Mccorkle
            emc Eric Mccorkle
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: