Project: JDT
Bug 144426 [compiler] Compiler incorrectly reports "assignment to variable has no effect" when it is a duplicate
Reported: 2006-05-30 08:54:51 | Status: verified fixed

Eclipse 3.2RC4 for Win23: eclipse-SDK-3.2RC4-win32.zip Running on Windows XP SP2 public class Test { public static void main(String[] args) { int x = 2; if (true) { int x = 4; } } } "x = 4" is underlined with multiple markers: "The assignment to variable x has no effect", and "Duplicate local variable x". I believe that the first one is incorrect ("has no effect").

Files changed in fix:
org.eclipse.jdt.ui.tests.refactoring/resources/RenameTemp/canRename/A_test62_in.java org.eclipse.jdt.ui.tests.refactoring/resources/RenameTemp/canRename/A_test62_out.java org.eclipse.jdt.ui.tests.refactoring/resources/RenameTemp/canRename/A_test63_in.java org.eclipse.jdt.ui.tests.refactoring/resources/RenameTemp/canRename/A_test63_out.java org.eclipse.jdt.ui.tests.refactoring/resources/RenameTemp/cannotRename/A_testFail32.java org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/RenameTempTests.java