Bug 119923 [clean up][infrastructure] ConvertForLoop should use ContextSensitiveImportRewriteContext
Version: 3.2.0 Build id: I20051206-1200
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/ConvertForLoopProposal.java
private final ITypeBinding fToImport;
		private final ITypeBinding fErasure;
		private final CompilationUnit fUnit;
		
		public NewImportRewriteContext(ITypeBinding toImport, CompilationUnit unit) {
			fToImport= toImport;
			fErasure= toImport.getErasure();
			fUnit= unit;
		}
		public int findInContext(String qualifier, final String name, int kind) {
			List list= fUnit.types();
			for (Iterator iter= list.iterator(); iter.hasNext();) {
				AbstractTypeDeclaration typeDecl= (AbstractTypeDeclaration)iter.next();
				if (doesDeclare(fToImport, typeDecl.resolveBinding())) {
					return RES_NAME_FOUND;
				}
			}
			final boolean[] conflict= new boolean[1];
			fUnit.accept(new GenericVisitor(){
				
				protected boolean visitNode(ASTNode node) {
					if (conflict[0]) 
						return false;
					
					return super.visitNode(node);
				}