Bug 9228 Surround with try-catch works only if the selected code throws a exception
As there are runtime exceptions, wich can be interesting to catch by clients, it would be nice to allow the surround feature on any code snippet. Standard exception could be Throwable.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/LocalCorrectionsSubProcessor.java
res[0]= null;
				
				decl.accept(new GenericVisitor() {
					public boolean visit(ReturnStatement node) {
						if (res[0] == null) {
							Expression expr= node.getExpression();
							if (expr != null) {
								ITypeBinding binding= expr.resolveTypeBinding();
								if (binding != null) {
									res[0]= binding;
								} else {
									res[0]= node.getAST().resolveWellKnownType("java.lang.Object"); 
								}
							} else {
								res[0]= node.getAST().resolveWellKnownType("void"); 
							}
						}
						return false;
					}
				});
				ITypeBinding type= res[0];
				if (type == null) {
					type= decl.getAST().resolveWellKnownType("void"); 
				} 
				
				String str= type.getName() + " "; 
				int pos= ((MethodDeclaration) decl).getName().getStartPosition();
				
				String label= CorrectionMessages.getFormattedString("LocalCorrectionsSubProcessor.missingreturntype.description", type.getName()); 
				InsertCorrectionProposal proposal= new InsertCorrectionProposal(label, cu, pos, str, 1);