Community
Participate
Working Groups
BETA_JAVA8: The following program triggers an NPE: // --- //import java.util.Map; import java.lang.annotation.*; public class X { void foo(Map<@Marker ? super @Marker Object, @Marker ? extends @Marker String> m){} void goo(Map<@Marker ? extends @Marker Object, @Marker ? super @Marker String> m){} } @Target(ElementType.TYPE_USE) @interface Marker { } If the import is uncommented, it compiles OK.
Likely a duplicate/variant of https://bugs.eclipse.org/bugs/show_bug.cgi?id=403216, I had annotation based null analysis turned on in my workspace. When it is turned off, problem goes away. Stephan, the return from captureTypeAnnotations viz: return scope.environment().createParameterizedType((ReferenceBinding) argType, Binding.NO_TYPES, annotationBits, enclosingType); looks suspect. Please take a look. Thanks.
Another suspicious element: Inside WildcardBinding.signature() the NPE is caused at typeVariable().signature() where typeVariable() is documented to return "null in case of inconsistency", mh... OTOH, the line you quote should indeed not be applied if (argType instanceof WildcardBinding). But let's first settle bug 403216, OK?
One test has already been released via commit 97b509ed0492c1ec5d604a591a307ac7d4bc5ef4 (passing). I'm adding another one (using null annotations) via commit 926127edb74c4e9bf214c4a80335d01c8995a448 Bug 392099 and friends have brought many changes, I'm no longer able to reconstruct even how we got into the NPE. Too bad we didn't record the stack trace ...