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

Revert fix pushed for JDK-8074346

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 9
    • None
    • tools
    • b73
    • generic
    • generic
    • Not verified

        The fix made for https://bugs.openjdk.java.net/browse/JDK-8074346 is proving to a bit problematic
        due to originally unforeseen side effect.

        More permissively attributing expecting either a package name or a type name - the central idea behind
        the fix for JDK-8074346 - while conceptually is the correct thing to do - implementation wise exhibits
        some problems:

        As an inspection of com.sun.tools.javac.comp.Resolve#findIdent shows, this results in an existing
        type being preferred over a package - but if no existing type is found, a package symbol is created
        and returned without checking if such a package symbol exists in the first place !!!

        So the attempt to attribute SomeException in (the test case for
        https://bugs.openjdk.java.net/browse/JDK-8130401)

        public class ThrowsException {
            public void method() throws @Annot SomeException {}
        }

        returns a valid PackageSymbol for SomeException ! and we then conclude
        that a type annotation cannot be applied to a package component and so
        issue an error about how TAs cannot be applied to scoping constructs.

        This bogus error results in the compilation unit as being containing
        a non-resolution error - thus resulting in annotation processing being
        skipped.

        I propose to revert the fix for JDK-8074346 so that a comprehensive fix for
        https://bugs.openjdk.java.net/browse/JDK-8074346 and
        https://bugs.openjdk.java.net/browse/JDK-8130401 and (possibly)
        https://bugs.openjdk.java.net/browse/JDK-8130386 can be explored.

              sadayapalam Srikanth Adayapalam (Inactive)
              sadayapalam Srikanth Adayapalam (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: