JDK-8005653 : Lambdas containing inner classes referencing external type variables do not correctly parameterize the inner class
  • Type: Bug
  • Component: tools
  • Sub-Component: javac
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2013-01-03
  • Updated: 2013-06-06
  • Resolved: 2013-02-16
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
8 b82Fixed
Related Reports
Blocks :  
Relates :  
Description
Below is a portion of such a class file (source attached).  Note paramterized field but no parameter on class.:

Classfile /home/robert/work/try/tv/src/TV$1.class
  Last modified Jan 2, 2013; size 532 bytes
  MD5 checksum 2cc5fa9202a02a874483b46b9c1984f5
  Compiled from "TV.java"
class TV$1 extends C
  SourceFile: "TV.java"
  EnclosingMethod: #23.#24                // TV.lambda$0
  InnerClasses:
       #5; //class TV$1
  minor version: 0
  major version: 52
  flags: ACC_SUPER
Constant pool:
...
{
  R cr;
    Signature: Ljava/lang/Object;
    flags:
    Signature: #10                          // TR;
...

----------------------------------
This bug can also be seen by making interface I, Serializable.  In that case the compiler assertion below is triggerred on compilation (assertion has been annotated to show the offending type, a type variable):
% javac TV.java
An exception has occurred in the compiler (1.8.0-internal). Please file a bug at the Java Developer Connection (http://java.sun.com/webapps/bugreport)  after checking the Bug Parade for duplicates. Include your program and the following diagnostic in your report.  Thank you.
java.lang.AssertionError: xClassName t:R
        at com.sun.tools.javac.jvm.ClassWriter.xClassName(ClassWriter.java:447)
        at com.sun.tools.javac.jvm.ClassWriter.writePool(ClassWriter.java:560)
        at com.sun.tools.javac.jvm.ClassWriter.writeClassFile(ClassWriter.java:1638)
        at com.sun.tools.javac.jvm.ClassWriter.writeClass(ClassWriter.java:1510)
        at com.sun.tools.javac.main.JavaCompiler.genCode(JavaCompiler.java:753)
        at com.sun.tools.javac.main.JavaCompiler.generate(JavaCompiler.java:1522)
        at com.sun.tools.javac.main.JavaCompiler.generate(JavaCompiler.java:1486)
        at com.sun.tools.javac.main.JavaCompiler.compile2(JavaCompiler.java:908)
        at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:867)
        at com.sun.tools.javac.main.Main.compile(Main.java:482)
        at com.sun.tools.javac.main.Main.compile(Main.java:363)
        at com.sun.tools.javac.main.Main.compile(Main.java:352)
        at com.sun.tools.javac.main.Main.compile(Main.java:343)
        at com.sun.tools.javac.Main.compile(Main.java:76)
        at com.sun.tools.javac.Main.main(Main.java:61)

Comments
verified in jdk8 b92
06-06-2013