Bug 111420

Summary: Disassembler doesn't generate type parameters
Product: [Eclipse Project] JDT Reporter: Jerome Lanneluc <jerome_lanneluc>
Component: CoreAssignee: Olivier Thomann <Olivier_Thomann>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 3.1   
Target Milestone: 3.2 M3   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Jerome Lanneluc CLA 2005-10-04 06:49:17 EDT
I20050928 + latest JDT Core

When trying to disassemble in working copy mode the .class file coming from the
following source:
public class Y<W> {
  <T> T foo(T t, String... s) {
    return t;
  }
}

we get:
public class Y extends java.lang.Object {

  public Y() {
  }

  java.lang.Object foo(java.lang.Object arg, java.lang.String... arg) {
    return null;
  }
}

Note that the type parameters are not taken into account.
Comment 1 Jerome Lanneluc CLA 2005-10-04 06:50:08 EDT
Also the name of the method parameters are all 'arg'. Then should be 't' and 's'.
Comment 2 Jerome Lanneluc CLA 2005-10-04 06:53:04 EDT
I disabled ClassFileTests#testWorkingCopy10() for now. Please re-enable when
fixing this bug.
Comment 3 Olivier Thomann CLA 2005-10-04 08:41:19 EDT
The name of the parameter can only be retrieved if the .class file is compiled
with debug attributes (local variable table). With it, it is impossible to know
the name. This is why there is the default 'arg' value. I'll see what I can do
in this case to have arg0, arg1, etc.
The type parameters are in the signature attribute. I don't display them for now
in the output string.
Comment 4 Olivier Thomann CLA 2005-10-04 12:57:18 EDT
I will also get rid of extends java.lang.Object. This isn't required.
Comment 5 Olivier Thomann CLA 2005-10-04 14:42:14 EDT
Fixed and released in HEAD.
I changed the generation of the library to generate local variable table in
order to retrieve the argument's names. I also change the argument name to match
's' instead of 'args'.
I reenabled the test specified in comment 2.
Regression tests added in
org.eclipse.jdt.core.tests.compiler.regression.ClassFileReaderTest.test076/077.
Comment 6 David Audel CLA 2005-10-31 06:12:14 EST
Verified for 3.2 M3 using build I20051031-0010