Bug 328247 - Disassemble fails to disassemble synthetic constructor with varargs arguments
Summary: Disassemble fails to disassemble synthetic constructor with varargs arguments
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.7   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 3.7 M3   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-20 10:17 EDT by Olivier Thomann CLA
Modified: 2010-10-26 08:04 EDT (History)
1 user (show)

See Also:


Attachments
Proposed fix + regression test (3.50 KB, patch)
2010-10-20 10:24 EDT, Olivier Thomann CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Olivier Thomann CLA 2010-10-20 10:17:14 EDT
Compiling the following code:

public class X {
	private static final String CONST = "";

	public static class A {
		A(Integer i, String... tab) {}
	}
	
	Object foo(final Float f) {
		return new A(new Integer(0), CONST) {
			public String toString() {
				return f.toString();
			}
		};
	}
}

and trying to disassemble it fails with an IllegalArgumentException in the Signature class.
Comment 1 Olivier Thomann CLA 2010-10-20 10:21:35 EDT
The stacktrace is:
java.lang.IllegalArgumentException
	at org.eclipse.jdt.core.Signature.appendTypeSignature(Signature.java:2330)
	at org.eclipse.jdt.core.Signature.toCharArray(Signature.java:2207)
	at org.eclipse.jdt.internal.core.util.Disassembler.disassemble(Disassembler.java:526)
	at org.eclipse.jdt.internal.core.util.Disassembler.disassembleTypeMembers(Disassembler.java:1966)
	at org.eclipse.jdt.internal.core.util.Disassembler.disassemble(Disassembler.java:888)
	at org.eclipse.jdt.internal.core.util.Disassembler.disassemble(Disassembler.java:239)
Comment 2 Olivier Thomann CLA 2010-10-20 10:24:14 EDT
Created attachment 181293 [details]
Proposed fix + regression test
Comment 3 Olivier Thomann CLA 2010-10-20 12:35:02 EDT
Released for 3.7M3.
Added regression test in:
org.eclipse.jdt.core.tests.compiler.regression.VarargsTest#test062
Comment 4 Satyam Kandula CLA 2010-10-26 08:04:58 EDT
Verified for 3.7M3 using build I20101025-0901