Bug 28869 Parse error with final local vars without immediate assignment
Consider this prototype code: void foo() { final PreparedStatement statement; try { statement = xxx.prepareStatement(...) } catch (..) { // handle errors } return statement; } For this kind of thing I often use a final local variable - mostly to enable the compiler to find my errors (like assigning more than once). However, with Eclipse I get parse errors (cursor on the line that declares the local var) when using refactoring functions, such as "Reorganize imports". The Eclipse version used is Eclipse 2.1 M4.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/OrganizeImportsAction.java
status.add(e.getStatus());
				} catch (CoreException e) {
					JavaPlugin.log(e);
					String message= ActionMessages.getFormattedString("OrganizeImportsAction.multi.error.unexpected", e.getStatus().getMessage()); 
					status.add(new Status(Status.ERROR, JavaUI.ID_PLUGIN, Status.ERROR, message, null));					
				}
			}
		} finally {
			monitor.done();
		}
	}
				
	private void runOnSingle(ICompilationUnit cu, boolean doResolve, boolean inEditor) {
		if (!ElementValidator.check(cu, getShell(), ActionMessages.getString("OrganizeImportsAction.error.title"), inEditor))  
			return;
		try {
			IPreferenceStore store= PreferenceConstants.getPreferenceStore();
			String[] prefOrder= JavaPreferencesSettings.getImportOrderPreference(store);
			int threshold= JavaPreferencesSettings.getImportNumberThreshold(store);
			boolean ignoreLowerCaseNames= store.getBoolean(PreferenceConstants.ORGIMPORTS_IGNORELOWERCASE);
			
			if (!cu.isWorkingCopy()) {
				IEditorPart editor= EditorUtility.openInEditor(cu);
				if (editor instanceof JavaEditor) {
					fEditor= (JavaEditor) editor;
				}
				
				cu= JavaModelUtil.toWorkingCopy(cu);
			}