JDK-8064857 : javac generates LVT entry with length 0 for local variable
  • Type: Bug
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 8,9
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2014-11-14
  • Updated: 2015-09-29
  • Resolved: 2015-01-06
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 JDK 9
8u60Fixed 9 b46Fixed
Related Reports
Relates :  
Relates :  
Description
When compiling this test case:

class Test {
  int m(boolean flag) {
    int myInt;
    label:
    {
      if (flag) {
        myInt = 1;
      } else {
        break label;
      }

      return myInt;
    }
    return -1;
  }
}

javac generates this incorrect LVT table for method m:

LocalVariableTable:
        Start  Length  Slot  Name   Signature
            6       0     2 myInt   I                        <--------------  length is set to 0
            0      10     0  this   LTest;
            0      10     1  flag   Z

reported in compiler-dev: http://mail.openjdk.java.net/pipermail/compiler-dev/2014-November/009141.html