JDK-8026749 : Missing LV table in lambda bodies
  • Type: Bug
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 8
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2013-10-16
  • Updated: 2025-12-17
  • Resolved: 2013-10-18
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 b115Fixed
Related Reports
Causes :  
Cloners :  
Description
When the compiler desugars a lambda body to a method, there is no local variable table generated in the classfile.  This prevents debuggers from being able to examine locals when stepping into lambdas.  

For example, for the following class:

class Foo1 {
    public static void x() { 
        int i = 0;
    }
}

there is an LVTable:

public static void x();
    descriptor: ()V
    flags: ACC_PUBLIC, ACC_STATIC
    Code:
      stack=1, locals=1, args_size=0
         0: iconst_0      
         1: istore_0      
         2: return        
      LineNumberTable:
        line 3: 0
        line 4: 2
      LocalVariableTable:
        Start  Length  Slot  Name   Signature
            2       1     0     i   I

but for 

class Foo2 {
    public static Runnable r = () -> { 
        int i = 0;
    };
}

there is no LVtable:

  private static void lambda$static$0();
    descriptor: ()V
    flags: ACC_PRIVATE, ACC_STATIC, ACC_SYNTHETIC
    Code:
      stack=1, locals=1, args_size=0
         0: iconst_0      
         1: istore_0      
         2: return        
      LineNumberTable:
        line 1: 0
        line 4: 2


Comments
URL: http://hg.openjdk.java.net/jdk8/jdk8/langtools/rev/7de97abc4a5c User: lana Date: 2013-11-05 20:15:34 +0000
05-11-2013

URL: http://hg.openjdk.java.net/jdk8/tl/langtools/rev/7de97abc4a5c User: jjg Date: 2013-10-18 22:05:57 +0000
18-10-2013