Community
Participate
Working Groups
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.
Also the name of the method parameters are all 'arg'. Then should be 't' and 's'.
I disabled ClassFileTests#testWorkingCopy10() for now. Please re-enable when fixing this bug.
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.
I will also get rid of extends java.lang.Object. This isn't required.
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.
Verified for 3.2 M3 using build I20051031-0010