-
Bug
-
Resolution: Fixed
-
P4
-
22
-
b04
-
generic
-
generic
Compiling the following source code generates a StackOverflowError:
public class Test1 {
class Inner {
Inner() {
this(() -> new Object() { { Test1.this.hashCode(); } });
}
Inner(Runnable r) {
}
}
}
Verified on JDK 8, 11, 17, 22, and current 24 head.
$ javac -version
javac 22
$ javac Test1.java
The system is out of resources.
Consult the following stack trace for details.
java.lang.StackOverflowError
at jdk.compiler/com.sun.tools.javac.code.Symbol$ClassSymbol.isSubClass(Symbol.java:1403)
at jdk.compiler/com.sun.tools.javac.code.Symbol.isMemberOf(Symbol.java:559)
at jdk.compiler/com.sun.tools.javac.comp.Lower.access(Lower.java:1285)
at jdk.compiler/com.sun.tools.javac.comp.Lower.access(Lower.java:1344)
at jdk.compiler/com.sun.tools.javac.comp.Lower.makeOwnerThisN(Lower.java:1905)
at jdk.compiler/com.sun.tools.javac.comp.Lower.makeOwnerThis(Lower.java:1890)
at jdk.compiler/com.sun.tools.javac.comp.Lower.accessBase(Lower.java:1135)
at jdk.compiler/com.sun.tools.javac.comp.Lower.access(Lower.java:1323)
at jdk.compiler/com.sun.tools.javac.comp.Lower.access(Lower.java:1344)
at jdk.compiler/com.sun.tools.javac.comp.Lower.makeOwnerThisN(Lower.java:1905)
at jdk.compiler/com.sun.tools.javac.comp.Lower.makeOwnerThis(Lower.java:1890)
at jdk.compiler/com.sun.tools.javac.comp.Lower.accessBase(Lower.java:1135)
at jdk.compiler/com.sun.tools.javac.comp.Lower.access(Lower.java:1323)
at jdk.compiler/com.sun.tools.javac.comp.Lower.access(Lower.java:1344)
at jdk.compiler/com.sun.tools.javac.comp.Lower.makeOwnerThisN(Lower.java:1905)
at jdk.compiler/com.sun.tools.javac.comp.Lower.makeOwnerThis(Lower.java:1890)
at jdk.compiler/com.sun.tools.javac.comp.Lower.accessBase(Lower.java:1135)
at jdk.compiler/com.sun.tools.javac.comp.Lower.access(Lower.java:1323)
at jdk.compiler/com.sun.tools.javac.comp.Lower.access(Lower.java:1344)
at jdk.compiler/com.sun.tools.javac.comp.Lower.makeOwnerThisN(Lower.java:1905)
at jdk.compiler/com.sun.tools.javac.comp.Lower.makeOwnerThis(Lower.java:1890)
at jdk.compiler/com.sun.tools.javac.comp.Lower.accessBase(Lower.java:1135)
at jdk.compiler/com.sun.tools.javac.comp.Lower.access(Lower.java:1323)
at jdk.compiler/com.sun.tools.javac.comp.Lower.access(Lower.java:1344)
at jdk.compiler/com.sun.tools.javac.comp.Lower.makeOwnerThisN(Lower.java:1905)
at jdk.compiler/com.sun.tools.javac.comp.Lower.makeOwnerThis(Lower.java:1890)
at jdk.compiler/com.sun.tools.javac.comp.Lower.accessBase(Lower.java:1135)
public class Test1 {
class Inner {
Inner() {
this(() -> new Object() { { Test1.this.hashCode(); } });
}
Inner(Runnable r) {
}
}
}
Verified on JDK 8, 11, 17, 22, and current 24 head.
$ javac -version
javac 22
$ javac Test1.java
The system is out of resources.
Consult the following stack trace for details.
java.lang.StackOverflowError
at jdk.compiler/com.sun.tools.javac.code.Symbol$ClassSymbol.isSubClass(Symbol.java:1403)
at jdk.compiler/com.sun.tools.javac.code.Symbol.isMemberOf(Symbol.java:559)
at jdk.compiler/com.sun.tools.javac.comp.Lower.access(Lower.java:1285)
at jdk.compiler/com.sun.tools.javac.comp.Lower.access(Lower.java:1344)
at jdk.compiler/com.sun.tools.javac.comp.Lower.makeOwnerThisN(Lower.java:1905)
at jdk.compiler/com.sun.tools.javac.comp.Lower.makeOwnerThis(Lower.java:1890)
at jdk.compiler/com.sun.tools.javac.comp.Lower.accessBase(Lower.java:1135)
at jdk.compiler/com.sun.tools.javac.comp.Lower.access(Lower.java:1323)
at jdk.compiler/com.sun.tools.javac.comp.Lower.access(Lower.java:1344)
at jdk.compiler/com.sun.tools.javac.comp.Lower.makeOwnerThisN(Lower.java:1905)
at jdk.compiler/com.sun.tools.javac.comp.Lower.makeOwnerThis(Lower.java:1890)
at jdk.compiler/com.sun.tools.javac.comp.Lower.accessBase(Lower.java:1135)
at jdk.compiler/com.sun.tools.javac.comp.Lower.access(Lower.java:1323)
at jdk.compiler/com.sun.tools.javac.comp.Lower.access(Lower.java:1344)
at jdk.compiler/com.sun.tools.javac.comp.Lower.makeOwnerThisN(Lower.java:1905)
at jdk.compiler/com.sun.tools.javac.comp.Lower.makeOwnerThis(Lower.java:1890)
at jdk.compiler/com.sun.tools.javac.comp.Lower.accessBase(Lower.java:1135)
at jdk.compiler/com.sun.tools.javac.comp.Lower.access(Lower.java:1323)
at jdk.compiler/com.sun.tools.javac.comp.Lower.access(Lower.java:1344)
at jdk.compiler/com.sun.tools.javac.comp.Lower.makeOwnerThisN(Lower.java:1905)
at jdk.compiler/com.sun.tools.javac.comp.Lower.makeOwnerThis(Lower.java:1890)
at jdk.compiler/com.sun.tools.javac.comp.Lower.accessBase(Lower.java:1135)
at jdk.compiler/com.sun.tools.javac.comp.Lower.access(Lower.java:1323)
at jdk.compiler/com.sun.tools.javac.comp.Lower.access(Lower.java:1344)
at jdk.compiler/com.sun.tools.javac.comp.Lower.makeOwnerThisN(Lower.java:1905)
at jdk.compiler/com.sun.tools.javac.comp.Lower.makeOwnerThis(Lower.java:1890)
at jdk.compiler/com.sun.tools.javac.comp.Lower.accessBase(Lower.java:1135)
- relates to
-
JDK-8333313 NullPointerException in lambda instantiating an inner local class in prologue
-
- Resolved
-
-
JDK-8334037 Local class creation in lambda in pre-construction context crashes javac
-
- Resolved
-
-
JDK-8334121 Anonymous class capturing two enclosing instances fails to compile
-
- Resolved
-
-
JDK-8333822 Invalid method reference for this() outer instance method reference
-
- Closed
-
(2 links to)