Community
Participate
Working Groups
The eclipse compiler compiles an anonymous inner of an inner class as if the anonymous inner class was part of the enclosing outer class. For example, public class Foo { class Bar { public ActionListener doSomething() { return new ActionListener() { public void actionPerformed(ActionEvent evt) { System.out.println("foo"); } }; } } public void foo() {} } compiles as 3 classes: Foo.class, Foo$Bar.class and Foo$1.class where Foo$1.class is the anonymous inner class. By contrast javac compiles Foo.class, Foo$Bar.class, and Foo$Bar$1.class which is, I think, the correct behavior. This difference in the class name causes problem with XML serialization tools such as XStream because the eclipse and javac name the class differently.
What compliance are you using? It looks like your are using javac 1.5. If you use the latest version and you set your compliance to 1.5 it should behave the same. Closing as dup of bug 108856. *** This bug has been marked as a duplicate of 108856 ***
Verified in M20060109-0800 for 3.1.2