Bug 46088 Create method quick fix declares Object as return type [quick fix]
When you write the following code Bla var = getMyBla(); and press Ctrl-1, you can have the method "getMyBla" created. However, if the type Bla is not (yet) known, the method gets declared as private Object getMyBla() { ... } If you press Ctrl-1 again, the import for Bla is added. If the order of the two quickfixes was reversed, you'd get the correct method declaration.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/NewVariableCompletionProposal.java
fragment.setInitializer(ASTNodeFactory.newDefaultExpression(ast, type, 0));
			}
		
			boolean isAnonymous= newTypeDecl.getNodeType() == ASTNode.ANONYMOUS_CLASS_DECLARATION;
			List decls= isAnonymous ?  ((AnonymousClassDeclaration) newTypeDecl).bodyDeclarations() :  ((TypeDeclaration) newTypeDecl).bodyDeclarations();
							
			decls.add(findFieldInsertIndex(decls, node.getStartPosition()), newDecl);
			rewrite.markAsInserted(newDecl);
			
			if (!isInDifferentCU) {
				markAsLinked(rewrite, node, true, KEY_NAME);
			}
			markAsLinked(rewrite, fragment.getName(), false, KEY_NAME);
			markAsLinked(rewrite, newDecl.getType(), false, KEY_TYPE);
			return rewrite;
		}
		return null;
	}
	
	private int findFieldInsertIndex(List decls, int currPos) {
		for (int i= decls.size() - 1; i >= 0; i--) {
			ASTNode curr= (ASTNode) decls.get(i);
			if (curr instanceof FieldDeclaration) {
				if (currPos > curr.getStartPosition() + curr.getLength()) {
					return i + 1;
				}
			}
		}
		return 0;
	}