-
Bug
-
Resolution: Fixed
-
P4
-
None
-
b73
-
generic
-
generic
-
Not verified
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8136266 | emb-9 | Srikanth Adayapalam | P4 | Resolved | Fixed | team |
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 forJDK-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 forJDK-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.
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
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
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.
- backported by
-
JDK-8136266 Revert fix pushed for JDK-8074346
-
- Resolved
-