Project: JDT
Bug 256869 [quick fix] Dead Code Analysis: there is no QuickFix for if/else with DEBUG
Reported: 2008-11-28 05:23:27 | Status: resolved fixed

Build id: N20081126-2000 Dead Code Analysis found an issue in org.eclipse.core.internal.jobs.OrderedLock if (DEBUG && success) System.out.println("[" + Thread.currentThread() + "] Operation started... " + this); //$NON-NLS-1$ //$NON-NLS-2$ else if (DEBUG) System.out.println("[" + Thread.currentThread() + "] Operation timed out... " + this); //$NON-NLS-1$ //$NON-NLS-2$ The two quick fixes that are available for this case are either remove 'success' from 'if (DEBUG && success)' or remove 'System.out.println("[" + Thread.currentThread() + "] Operation started... " + this); //$NON-NLS-1$ //$NON-NLS-2$' It should rather suggest to create two if statements, one for 'DEBUG' another for 'success'.

Files changed in fix:
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/AdvancedQuickAssistProcessor.java org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/LocalCorrectionsSubProcessor.java