Community
Participate
Working Groups
I20060628-1135 The fix for bug 144858 has introduced improved bindings for duplicate local variables. However, there are now cases where bindings share the same key although they are not identical and not isEqualTo(..) each other, e.g. the two 'local' here: class Try { void m() { int local; System.out.println(local); String local; System.out.println(local); } } See also bug 110976 for similar problems inside duplicate methods.
*** Bug 155858 has been marked as a duplicate of this bug. ***
Once fixed, tests org.eclipse.jdt.core.tests.dom.ASTConverterTestAST3_2#test0660/0663 need to be updated.
Reproduced with 3.3 RC4
Created attachment 71771 [details] Proposed fix and regression tests The existing tests have been updated, and the corresponding assertion in test660/663 have been uncommented.
Fix and tests released for 3.4M1 in HEAD
Reverted the fix as it breaks the invariant that says that a key can be used to compare bindings from different clusters.
Created attachment 72870 [details] New proposed fix and regression test This fix doesn't use source position, but it uses the occurrence count of the variable in the block.
Created attachment 72935 [details] Fix *and* tests (previous patch did not contain the tests
Fix and tests released for 3.4M1 in HEAD.
Verified for 3.4M1 using build I20070802-0800.