Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4326648

Regression: Variable table entries not generated for some final locals

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 1.3.1
    • 1.3.0
    • tools
    • ladybird
    • generic
    • generic
    • Verified

        This was originally reported in the debugger category, but appears to be a compiler bug, and a regression from 1.2.2.

        This method:

           public void testMethod1(final int t, int k) {
                String s1 = "first";
                final int z =0;
                if(true) {
                    final float r = 10.00f;
                    boolean b = true;
                    System.out.println(r);
                }
                System.out.println("in testMethod2");
            
            }

        Results in the following variable table, as reported by javap:

        Local variables for method void testMethod1(int, int)
           LocalTest this pc=0, length=23, slot=0
           int t pc=0, length=23, slot=1
           int k pc=0, length=23, slot=2
           java.lang.String s1 pc=3, length=19, slot=3
           boolean b pc=6, length=8, slot=6


        *** Original description follows:
         Method.variables() does not return all the final local variables.
         The returned list contains all the final local variables passed as arguments
         to the method but does not contain final local variables which are declared
         within the method.
         
         Scenario:
         ---------
         Debugger - MethodTest.java
         Debugee - LocalTest.java
         "z" and "r" in testMethod1 are not returned by Method.variables list
         whereas "t" is returned.
         All these variables are final variables. t is an argument to the method.
          
         ***Testing done in JDK1.3.0rc2-Y-Hotspot and Classic VM(WinNT and Solaris2.7)

         Steps to reproduce the bug
         ---------------------------
         The bug can be reproduced using the files in the location
         /net/sqesvr/export/disk5/toolsbugs/4326648
         Follow the instructions in README to reproduce the bug.

              gafter Neal Gafter (Inactive)
              duke J. Duke
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: