Community
Participate
Working Groups
I propose adding a static check in Java code for the following situation: x = 42; // ... no reading of variable 'x' x = 100; Here, variable x is assigned a value '42', which is never read before reassigning the value '100' to x. This is never useful, but sometimes it is a sign of an error. As an example, imagine a JUnit testcase with variables x and y in the testfixture, and the two assignments above within the setUp() routine. Most probably, the author wanted to write x = 42; y = 100; but accidentally assigned value '100' to variable 'x' instead of 'y'. This might become a hard to find error. I propose adding this static check to the Preferences, under Java -> Compiler -> Errors/Warnings -> Unnecessary Code Michael