-
Bug
-
Resolution: Unresolved
-
P4
-
5.0, 7, 8
-
Fix Understood
Given:
class Hole<T> {
class X extends RuntimeException { X(T t) {...} ... }
... throw new Hole<Integer>().new X(3);
}
The 5.0 compiler accepts this and the 6.0 compiler rejects it, but there is nothing in the JLS to justify the change in compiler behavior. javac now gets this right, but the spec doesn't.
class Hole<T> {
class X extends RuntimeException { X(T t) {...} ... }
... throw new Hole<Integer>().new X(3);
}
The 5.0 compiler accepts this and the 6.0 compiler rejects it, but there is nothing in the JLS to justify the change in compiler behavior. javac now gets this right, but the spec doesn't.
- blocks
-
JDK-8050920 Static nested class allowed to extend non-static inner class
- Open
- relates to
-
JDK-6558505 Creation of generic exceptions
- Closed
-
JDK-8145157 9.1.2: Prohibit references to interface type parameters in static methods
- Closed