public static void addSimilarTypeProposals(SimilarElement[] elements, String typeName, ProblemPosition problemPos, ArrayList proposals) throws JavaModelException { ICompilationUnit cu= problemPos.getCompilationUnit(); CodeGenerationSettings settings= JavaPreferencesSettings.getCodeGenerationSettings();
private static void addSimilarTypeProposals(SimilarElement[] elements, ICompilationUnit cu, SimpleName node, ArrayList proposals) throws JavaModelException {  String resolvedTypeName= null; ITypeBinding binding= ASTResolving.guessBindingForTypeReference(node, false); if (binding != null) { if (binding.isArray()) { binding= binding.getElementType(); } resolvedTypeName= Bindings.getFullyQualifiedName(binding); proposals.add(createTypeRefChangeProposal(cu, resolvedTypeName, node, 5)); }
	public static void addSimilarTypeProposals(SimilarElement[] elements, String typeName, ProblemPosition problemPos, ArrayList proposals) throws JavaModelException {		ICompilationUnit cu= problemPos.getCompilationUnit();		CodeGenerationSettings settings= JavaPreferencesSettings.getCodeGenerationSettings();		for (int i= 0; i < elements.length; i++) {			SimilarElement elem= elements[i];			if ((elem.getKind() & SimilarElementsRequestor.ALL_TYPES) == 0) {				continue;			}			String fullName= elem.getName();						ImportEdit importEdit= new ImportEdit(cu, settings);							String simpleName= importEdit.addImport(fullName);									boolean importOnly= simpleName.equals(typeName);						CUCorrectionProposal proposal= new CUCorrectionProposal("", cu, 0); //$NON-NLS-1$			proposals.add(proposal);						TextEdit root= proposal.getRootTextEdit();						if (!importEdit.isEmpty()) {				root.add(importEdit); //$NON-NLS-1$			}			if (!importOnly) {				root.add(SimpleTextEdit.createReplace(problemPos.getOffset(), typeName.length(), simpleName)); //$NON-NLS-1$				proposal.setDisplayName(CorrectionMessages.getFormattedString("UnresolvedElementsSubProcessor.changetype.description", simpleName)); //$NON-NLS-1$				proposal.setRelevance(3);			} else {				proposal.setImage(JavaPluginImages.get(JavaPluginImages.IMG_OBJS_IMPDECL));				proposal.setDisplayName(CorrectionMessages.getFormattedString("UnresolvedElementsSubProcessor.importtype.description", fullName)); //$NON-NLS-1$				proposal.setRelevance(5);			}		}	}