Uploaded image for project: 'Commons BCEL'
  1. Commons BCEL
  2. BCEL-61

LocalVariableTypeTable seems not to be updated like LocalVariableTable

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Reopened
    • Resolution: Unresolved
    • 5.1
    • None
    • Main
    • Operating System: Windows 2000
      Platform: PC

    Description

      Scenario:
      I insert into a method which has a parameterized argument some instructions and
      two local variables.
      The methods signature looks like this:
      public void doSomething( double d, ArrayList<Integer> list )
      The method is situated in the class MyClassFile.

      Result:
      Loading the class MyClassFile which contains the new method 'doSomething'
      results in a ClassFormatError:
      LVTT entry for 'list' in class file MyClassFile does not match any LVT entry

      This error is not produced if the method declaration is done without generics:
      public void doSomething( double d, ArrayList list )

      The difference is the LocalVariableTypeTable. It is not present if I do not use
      generics.
      Due to the insertion of the new instructions the start_pc and the length of the
      local variable have to be updated in the LocalVariableTable, which is done.
      But the corresponding entry in the LocalVariableTypeTable gets not updated its
      start_pc and length entries.

      LocalVariableTable ( BEFORE INSERTION ):
      start_pc, length, index, name
      0, 26, 0, this
      0, 26, 1, d
      0, 26, 3, list
      LocalVariableTypeTable( BEFORE INSERTION ):
      0, 26, 3, list

      LocalVariableTable ( AFTER INSERTION ):
      start_pc, length, index, name
      44, 33, 0, this
      44, 33, 1, d
      44, 33, 3, list
      1, 85, 4, wrapper_argumentlist
      26, 60, 5, wrapper
      LocalVariableTypeTable( AFTER INSERTION ):
      0, 26, 3, list

      The class works fine before the insertion.
      I've done bcel CVS checkout, but it did not help.
      The original instructions of the methods are not modified.
      I simply install a wrapper around the original body.
      I add an exception handler, therefore there is also an additional entry in
      the exceptiontable.
      I can toggle the error behaviour by using or not using the generic argument.
      generic -> error
      no generic -> no error
      I tried JDK 5.0 build 1.5.0-b64 and eclipse 3.1.0 build 200412162000 as a compiler.
      I use the JVR of the above mentioned JDK.

      Attachments

        Activity

          People

            issues@commons.apache.org Apache Commons Developers
            marco.petris@web.de Marco Petris
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: