JDK-7116195 : javac gets a stack overflow on generics code
  • Type: Bug
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 7
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_xp
  • CPU: generic
  • Submitted: 2011-11-28
  • Updated: 2011-12-08
  • Resolved: 2011-12-08
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8
8Resolved
Related Reports
Duplicate :  
Description
interface Pong<T> {}
class Ping<T> implements Pong<Pong<? super Ping<Ping<T>>>> {
    static void Ping() {
        Pong<? super Ping<Long>> xxx;
        new Ping<Long>();

        xxx = new Ping<Long>();  // this line causes the overflow
    }
}
Compiling the above with jdk 8 fails with this:
java.lang.StackOverflowError
	at com.sun.tools.javac.code.Types$26.visitType(Types.java:3038)
	at com.sun.tools.javac.code.Types$26.visitType(Types.java:3035)
	at com.sun.tools.javac.code.Type.accept(Type.java:114)
	at com.sun.tools.javac.code.Types$UnaryVisitor.visit(Types.java:3811)
	at com.sun.tools.javac.code.Types$26.visitClassType(Types.java:3043)
	at com.sun.tools.javac.code.Types$26.visitClassType(Types.java:3035)
	at com.sun.tools.javac.code.Type$ClassType.accept(Type.java:583)
	at com.sun.tools.javac.code.Types$UnaryVisitor.visit(Types.java:3811)
	at com.sun.tools.javac.code.Types$26.visitClassType(Types.java:3048)
	at com.sun.tools.javac.code.Types$26.visitClassType(Types.java:3035)
	at com.sun.tools.javac.code.Type$ClassType.accept(Type.java:583)
	at com.sun.tools.javac.code.Types$UnaryVisitor.visit(Types.java:3811)
	at com.sun.tools.javac.code.Types$26.visitClassType(Types.java:3048)
	at com.sun.tools.javac.code.Types$26.visitClassType(Types.java:3035)
	at com.sun.tools.javac.code.Type$ClassType.accept(Type.java:583)
          :
          :

This also occurs with jdk 6 and jdk 7.