Project: JDT
Bug 87522 [quick fix] remove assignment without sideeffects can have side effects
Reported: 2005-03-09 12:05:56 | Status: resolved fixed

When eclipse reports an unused variable and offers to remove the variable and all assignments without side effects, it can have side effects. For instance MyDialog d; d = new MyDialog(); In this case it would remove the constructor "new MyDialog()". However the constructor could be doing something useful, such as displaying itself. Thus removing it will have side effects. If it just changed it to this: new MyDialog(); it would not have side effects.

Files changed in fix:
org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/LocalCorrectionsQuickFixTest.java org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/fix/AbstractFix.java org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/fix/FixMessages.java org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/fix/UnusedCodeFix.java org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/fix/UnusedCodeCleanUp.java org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/FixCorrectionProposal.java org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/LocalCorrectionsSubProcessor.java