Summary: | [1.5] ClassFormatError when running simple example | ||
---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Kasper Nielsen <news> |
Component: | Core | Assignee: | Philipe Mulet <philippe_mulet> |
Status: | VERIFIED FIXED | QA Contact: | |
Severity: | normal | ||
Priority: | P3 | ||
Version: | 3.0 | ||
Target Milestone: | 3.1 M3 | ||
Hardware: | PC | ||
OS: | Windows XP | ||
Whiteboard: |
Description
Kasper Nielsen
2004-08-07 03:30:01 EDT
Here is the disassembled output of this .class file: // Compiled from ErrorTest.java (version 1.5 : 49.0, super bit) // Signature: Ljava/util/AbstractSet<Ljava/lang/Runnable;>; public class ErrorTest extends java.util.AbstractSet { // Method descriptor #6 ()V // Stack: 1, Locals: 1 public ErrorTest(); 0 aload_0 1 invokespecial #10 <Method java/util/AbstractSet.<init>()V> 4 return Line numbers: [pc: 0, line: 3] Local variable table: [pc: 0, pc: 5] local: this index: 0 type: LErrorTest; // Method descriptor #16 ([Ljava/lang/String;)V // Stack: 2, Locals: 2 public static void main(String[] args); 0 new #2 ErrorTest 3 dup 4 invokespecial #17 <Method ErrorTest.<init>()V> 7 astore_1 8 aload_1 9 aconst_null 10 invokevirtual #21 <Method ErrorTest.add(Ljava/lang/Runnable;)Z> 13 pop 14 return Line numbers: [pc: 0, line: 6] [pc: 8, line: 7] [pc: 14, line: 8] Local variable table: [pc: 0, pc: 15] local: args index: 0 type: [Ljava/lang/String; [pc: 8, pc: 15] local: t index: 1 type: LErrorTest; // Method descriptor #19 (Ljava/lang/Runnable;)Z // Stack: 2, Locals: 2 public boolean add(Runnable run); 0 getstatic #30 <Field java/lang/System.out Ljava/io/PrintStream;> 3 ldc #32 <String "success"> 5 invokevirtual #38 <Method java/io/PrintStream.println(Ljava/lang/String;)V> 8 iconst_1 9 ireturn Line numbers: [pc: 0, line: 11] [pc: 8, line: 12] Local variable table: [pc: 0, pc: 10] local: this index: 0 type: LErrorTest; [pc: 0, pc: 10] local: run index: 1 type: Ljava/lang/Runnable; // Method descriptor #42 ()Ljava/util/Iterator; // Stack: 1, Locals: 1 public Iterator iterator(); 0 aconst_null 1 areturn Line numbers: [pc: 0, line: 14] Local variable table: [pc: 0, pc: 2] local: this index: 0 type: LErrorTest; // Method descriptor #44 ()I // Stack: 1, Locals: 1 public int size(); 0 iconst_0 1 ireturn Line numbers: [pc: 0, line: 15] Local variable table: [pc: 0, pc: 2] local: this index: 0 type: LErrorTest; // Method descriptor #45 (Ljava/lang/Object;)Z // Stack: 2, Locals: 2 public bridge synthetic boolean add(Object arg); 0 aload_0 1 aload_1 2 checkcast #47 java/lang/Runnable 5 invokevirtual #21 <Method ErrorTest.add(Ljava/lang/Runnable;)Z> 8 ireturn Line numbers: [pc: 0, line: 1] // Method descriptor #45 (Ljava/lang/Object;)Z // Stack: 2, Locals: 2 public bridge synthetic boolean add(Object arg); 0 aload_0 1 aload_1 2 checkcast #47 java/lang/Runnable 5 invokevirtual #21 <Method ErrorTest.add(Ljava/lang/Runnable;)Z> 8 ireturn Line numbers: [pc: 0, line: 1] } We can see that the last method is twice in the class file. What drop are you running on? sorry, Version: 3.1.0 Build id: 200408010010 Released a temporary fix in Head. Moving to philippe so we can discuss a better solution when he returns. Fixed in HEAD. Test case added: GenericTypeTest#test379 Verified for 3.1 M3 with build I200411040800 |