Community
Participate
Working Groups
I20051116-1332 class Test { void m() { error(); new Cloneable() { void xx() {} }; new Cloneable() { void xx() {} }; } } The bindings for the two methods xx() in the anonymous inner classes are #isEqualTo(..) each other if there's an error in the enclosing method. The same problem occurs when the anonymous types cannot be resolved: void m() { new Runnable() { void xx() {} }; new Runnable() { void xx() {} }; }
When the method contains an error before the anonymous declaration, the constant pool name of both anonymous is null. This is why the two methods are considered equal. In this case, I will use the unique key to compare the two anonymous type binding.
Fixed and released in HEAD. Regression test added in org.eclipse.jdt.core.tests.dom.ASTConverterTestAST3_2.test0627
Verified for 3.2 M5 using build I20060215-0010.