Description:
StackOverFlow Error while trying to compile the following Cyclic inheritance test code
If the bound to TypeParameter T is commented, Compiler works fine throwing cyclic inheritance error as expected.
<code>
bash-3.00$ cat Cyclic.java
class Cyclic <T extends Cyclic.Inn> extends Cyclic {
class Inn extends Cyclic.Inn{
}
}
</code>
Compilation result is :
<output>
The system is out of resources.
Consult the following stack trace for details.
java.lang.StackOverflowError
at com.sun.tools.javac.code.Type$ClassType.accept(Type.java:568)
at com.sun.tools.javac.code.Types$UnaryVisitor.visit(Types.java:3240)
at com.sun.tools.javac.code.Types.supertype(Types.java:1605)
at com.sun.tools.javac.comp.Resolve.findMemberType(Resolve.java:889)
at com.sun.tools.javac.comp.Resolve.findMemberType(Resolve.java:891)
at com.sun.tools.javac.comp.Resolve.findMemberType(Resolve.java:891)
at com.sun.tools.javac.comp.Resolve.findMemberType(Resolve.java:891)
at com.sun.tools.javac.comp.Resolve.findMemberType(Resolve.java:891)
at com.sun.tools.javac.comp.Resolve.findMemberType(Resolve.java:891)
at com.sun.tools.javac.comp.Resolve.findMemberType(Resolve.java:891)
at com.sun.tools.javac.comp.Resolve.findMemberType(Resolve.java:891)
at com.sun.tools.javac.comp.Resolve.findMemberType(Resolve.java:891)
at com.sun.tools.javac.comp.Resolve.findMemberType(Resolve.java:891)
at com.sun.tools.javac.comp.Resolve.findMemberType(Resolve.java:891)
at com.sun.tools.javac.comp.Resolve.findMemberType(Resolve.java:891)
at com.sun.tools.javac.comp.Resolve.findMemberType(Resolve.java:891)
at com.sun.tools.javac.comp.Resolve.findMemberType(Resolve.java:891)
</output>
<version>
/net/sqindia/export/disk09/jdk/7/latest/binaries/solsparc/bin/java -version
java version "1.7.0-ea"
Java(TM) SE Runtime Environment (build 1.7.0-ea-b24)
Java HotSpot(TM) Client VM (build 12.0-b01, mixed mode)
bash-3.00$ uname -a
SunOS hrajan 5.10 Generic sun4u sparc SUNW,Sun-Blade-100
StackOverFlow Error while trying to compile the following Cyclic inheritance test code
If the bound to TypeParameter T is commented, Compiler works fine throwing cyclic inheritance error as expected.
<code>
bash-3.00$ cat Cyclic.java
class Cyclic <T extends Cyclic.Inn> extends Cyclic {
class Inn extends Cyclic.Inn{
}
}
</code>
Compilation result is :
<output>
The system is out of resources.
Consult the following stack trace for details.
java.lang.StackOverflowError
at com.sun.tools.javac.code.Type$ClassType.accept(Type.java:568)
at com.sun.tools.javac.code.Types$UnaryVisitor.visit(Types.java:3240)
at com.sun.tools.javac.code.Types.supertype(Types.java:1605)
at com.sun.tools.javac.comp.Resolve.findMemberType(Resolve.java:889)
at com.sun.tools.javac.comp.Resolve.findMemberType(Resolve.java:891)
at com.sun.tools.javac.comp.Resolve.findMemberType(Resolve.java:891)
at com.sun.tools.javac.comp.Resolve.findMemberType(Resolve.java:891)
at com.sun.tools.javac.comp.Resolve.findMemberType(Resolve.java:891)
at com.sun.tools.javac.comp.Resolve.findMemberType(Resolve.java:891)
at com.sun.tools.javac.comp.Resolve.findMemberType(Resolve.java:891)
at com.sun.tools.javac.comp.Resolve.findMemberType(Resolve.java:891)
at com.sun.tools.javac.comp.Resolve.findMemberType(Resolve.java:891)
at com.sun.tools.javac.comp.Resolve.findMemberType(Resolve.java:891)
at com.sun.tools.javac.comp.Resolve.findMemberType(Resolve.java:891)
at com.sun.tools.javac.comp.Resolve.findMemberType(Resolve.java:891)
at com.sun.tools.javac.comp.Resolve.findMemberType(Resolve.java:891)
at com.sun.tools.javac.comp.Resolve.findMemberType(Resolve.java:891)
</output>
<version>
/net/sqindia/export/disk09/jdk/7/latest/binaries/solsparc/bin/java -version
java version "1.7.0-ea"
Java(TM) SE Runtime Environment (build 1.7.0-ea-b24)
Java HotSpot(TM) Client VM (build 12.0-b01, mixed mode)
bash-3.00$ uname -a
SunOS hrajan 5.10 Generic sun4u sparc SUNW,Sun-Blade-100
- relates to
-
JDK-7079713 javac hangs when compiling a class that references a cyclically inherited class
- Closed