Bug 66354 [quick fix] incorrect placement of new temp decl [quick fix]
3.0rc1 void foo(Object x) { if (x != null) foo= x.toString(); } select foo, choose 'create local variable foo' you get: void foo(Object x) { if (x != null)String foo = x.toString(); } which is somewhat suboptimal :)
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/NewVariableCompletionProposal.java
TagElement newTagElement= ast.newTagElement();
				newTagElement.setTagName(TagElement.TAG_PARAM);
				newTagElement.fragments().add(newTagRef);
				TextElement commentStart= ast.newTextElement();
				newTagElement.fragments().add(commentStart);
				
				addLinkedPosition(rewrite.track(newTagRef), true, KEY_NAME);
				addLinkedPosition(rewrite.track(commentStart), false, "comment_start"); 
				
				ListRewrite tagsRewriter= rewrite.getListRewrite(javadoc, Javadoc.TAGS_PROPERTY);
				JavadocTagsSubProcessor.insertTag(tagsRewriter, newTagElement, leadingNames);
			}
			return rewrite;
		}
		return null;
	}
	
	private boolean isAssigned(Statement statement, SimpleName name) {
		if (statement instanceof ExpressionStatement) {
			ExpressionStatement exstat= (ExpressionStatement) statement;
			if (exstat.getExpression() instanceof Assignment) {
				Assignment assignment= (Assignment) exstat.getExpression();
				return assignment.getLeftHandSide() == name;
			}
		}
		return false;
	}
	
	private boolean isForStatementInit(Statement statement, SimpleName name) {