JDK-8180660 : missing LNT entry for finally block
  • Type: Bug
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 7
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2017-05-19
  • Updated: 2018-02-08
  • Resolved: 2017-05-22
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 10 JDK 8
10 b09Fixed 8u131Fixed
Related Reports
Relates :  
Description
If this test case is compiled:

import java.util.*;

public class Test {
    void foo() {
        List<String> l = null;
        String first = null;
        try {
            first = l.get(0);
        } finally{
            if (first != null) {
                System.out.println("finalizer");
            }
        }
    }
}

the LNT generate by javac for method foo(), showed along with the code:

void foo();
    descriptor: ()V
    flags: (0x0000)
    Code:
      stack=2, locals=4, args_size=1
         0: aconst_null
         1: astore_1
         2: aconst_null
         3: astore_2
         4: aload_1
         5: iconst_0
         6: invokeinterface #2,  2            // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
        11: checkcast     #3                  // class java/lang/String
        14: astore_2
        15: aload_2
        16: ifnull        45
        19: getstatic     #4                  // Field java/lang/System.out:Ljava/io/PrintStream;
        22: ldc           #5                  // String finalizer
        24: invokevirtual #6                  // Method java/io/PrintStream.println:(Ljava/lang/String;)V
        27: goto          45
        30: astore_3
        31: aload_2
        32: ifnull        43
        35: getstatic     #4                  // Field java/lang/System.out:Ljava/io/PrintStream;
        38: ldc           #5                  // String finalizer
        40: invokevirtual #6                  // Method java/io/PrintStream.println:(Ljava/lang/String;)V
        43: aload_3
        44: athrow
        45: return
      Exception table:
         from    to  target type
             4    15    30   any
      LineNumberTable:
        line 5: 0
        line 6: 2
        line 8: 4
        line 10: 15
        line 11: 19
        line 10: 30
        line 11: 35
        line 14: 45

should contain an entry pointing to bytecode instruction 43