Project: JDT
Bug 212015 [quick fix] Inappropriate quick fix for an unecessary else clause
Reported: 2007-12-05 10:38:54 | Status: verified fixed

I20071204-1547 I have the following method: public static String getDefaultLocation() { if (Activator.ctx.getProperty("osgi.dev") == null) //$NON-NLS-1$ return Platform.getInstallLocation().getURL().getPath(); else return Platform.getConfigurationLocation().getURL().getPath() + "selfhostingRoot/"; } And next to the statement of the else block I have the following warning: " Statement unnecessarily nested within else clause. The corresponding then clause does not complete normally". I'm agreeing with this. However I think that two of the 3 following quick fixes will not fix my problem since they will simply create blocks: - change else statement to block - change if-else statements to block - move else clause out of else I would have expected to only get the 3rd quick fix.

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