Bug 82536 Surround with doesn't use OLD ast rewrite anymore
therefore the following // SurroundWithTryCatchRefactoring still uses modifying rewrite - pass in a copy ASTParser parser= ASTParser.newParser(ASTProvider.AST_LEVEL); parser.setSource(cu); parser.setResolveBindings(true); parser.setFocalPosition(selectedNode.getStartPosition()); CompilationUnit newRoot= (CompilationUnit) parser.createAST(null); could be removed form LocalCorrectionsSubProcessor
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/LocalCorrectionsSubProcessor.java
CompilationUnit astRoot= context.getASTRoot();
		ASTNode selectedNode= problem.getCoveringNode(astRoot);
		if (selectedNode == null) {
			return;
		}
		while (selectedNode != null && !(selectedNode instanceof Statement)) {
			selectedNode= selectedNode.getParent();
		}
		if (selectedNode == null) {
			return;
		}
		
		int offset= selectedNode.getStartPosition();
		int length= selectedNode.getLength();
		int selectionEnd= context.getSelectionOffset() + context.getSelectionLength();
		if (selectionEnd > offset + length) {
			
			length= selectionEnd - offset;
		}
			
		SurroundWithTryCatchRefactoring refactoring= SurroundWithTryCatchRefactoring.create(cu, offset, length, null);
		if (refactoring == null)
			return;
		
		refactoring.setLeaveDirty(true);
		
		ASTParser parser= ASTParser.newParser(ASTProvider.AST_LEVEL);
		parser.setSource(cu);
		parser.setResolveBindings(true);
		parser.setFocalPosition(selectedNode.getStartPosition());