Bug 31554 QuickFix Add catch clause to surrounding try in catch clause incorrect [code manipulation] [refactoring]
With the following code in the editor: try{ someMethod(); //throws SomeException }catch(SomeException e){ someOtherMethod(); //throws SomeException } You will get a QuickFix that suggests to add a catch clause to the surrounding try. There is no surrounding try. It will add another catch(SomeException e) to the try clause above! This catch clause is unreachable (which the editor notices). The exception is still uncaught (which the editor doesn't notice). Build: 2.1-M5
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/LocalCorrectionsSubProcessor.java
public static void addUninitializedLocalVariableProposal(ICorrectionContext context, List proposals) throws CoreException {
		ICompilationUnit cu= context.getCompilationUnit();
		ASTNode selectedNode= context.getCoveringNode();
		if (!(selectedNode instanceof Name)) {
			return;
		}
		Name name= (Name) selectedNode;
		IBinding binding= name.resolveBinding();
		if (!(binding instanceof IVariableBinding)) {
			return;
		}
		IVariableBinding varBinding= (IVariableBinding) binding;
		
		CompilationUnit astRoot= context.getASTRoot();
		ASTNode node= astRoot.findDeclaringNode(binding);
		if (node instanceof VariableDeclarationFragment) {
			ASTRewrite rewrite= new ASTRewrite(node.getParent());
			
			VariableDeclarationFragment fragment= (VariableDeclarationFragment) node;
			if (fragment.getInitializer() != null) {
				return;
			}
			Expression expression= ASTResolving.getInitExpression(astRoot.getAST(), varBinding.getType());
			if (expression == null) {
				return;
			}
			fragment.setInitializer(expression);
			rewrite.markAsInserted(expression);
			String label= CorrectionMessages.getString("LocalCorrectionsSubProcessor.uninitializedvariable.description"); 
			Image image= JavaPluginImages.get(JavaPluginImages.IMG_CORRECTION_CHANGE);