Community
Participate
Working Groups
Build Identifier: Version: Indigo Service Release 2 Build id: 20120216-1857 Here is a sample code: public class Remove { public void foo() { byte value; value = (byte) getInt(); } long getInt() { return 2; } } I have turned on settings in Window -> Preferences -> Java -> Editor -> Save Actions -> Additional Actions[x] -> Configure -> Unnecessary Code -> Remove unused local variables [x]. And when I save the file, it generates code like this, where I get syntax error on line that has "(byte) getInt();". public class Remove { public void foo() { (byte) getInt(); } long getInt() { return 2; } } Note that writing the code like this: byte value = (byte) getInt(); Generates output that compiles. Reproducible: Always Steps to Reproduce: Steps can be found from the Details.
Moving to JDT/UI
*** This bug has been marked as a duplicate of bug 251471 ***