determineImportDifferences(fImportsStructure.getCreatedImports(), oldSingleImports, oldDemandImports);
determineImportDifferences(fImportsStructure, oldSingleImports, oldDemandImports);
	public void run(IProgressMonitor monitor) throws CoreException, OperationCanceledException {		if (monitor == null) {			monitor= new NullProgressMonitor();		}		try {			ICompilationUnit cu= fImportsStructure.getCompilationUnit();			fNumberOfImportsAdded= 0;			fNumberOfImportsRemoved= 0;						monitor.beginTask(CodeGenerationMessages.getFormattedString("OrganizeImportsOperation.description", cu.getElementName()), 5); //$NON-NLS-1$			Set/*<String>*/ oldSingleImports= new HashSet();			Set/*<String>*/  oldDemandImports= new HashSet();			List/*<SimpleName>*/ typeReferences= new ArrayList();			List/*<SimpleName>*/ staticReferences= new ArrayList();						boolean res= collectReferences(typeReferences, staticReferences, oldSingleImports, oldDemandImports);			if (!res) {				return;			}									monitor.worked(1);					TypeReferenceProcessor processor= new TypeReferenceProcessor(oldSingleImports, oldDemandImports, fASTRoot, fImportsStructure, fIgnoreLowerCaseNames);			ArrayList openChoices= new ArrayList();			ArrayList sourceRanges= new ArrayList();						SubProgressMonitor subMonitor= new SubProgressMonitor(monitor, 2);			try {				subMonitor.beginTask("", typeReferences.size()); //$NON-NLS-1$								Iterator refIterator= typeReferences.iterator();				while (refIterator.hasNext()) {					SimpleName typeRef= (SimpleName) refIterator.next();					TypeInfo[] openChoice= processor.process(typeRef, new SubProgressMonitor(subMonitor, 1));					if (openChoice != null) {						openChoices.add(openChoice);						sourceRanges.add(new SourceRange(typeRef.getStartPosition(), typeRef.getLength()));					}					}			} finally {				subMonitor.done();			}									addStaticImports(staticReferences, fImportsStructure);						if (!openChoices.isEmpty() && fChooseImportQuery != null) {				TypeInfo[][] choices= (TypeInfo[][]) openChoices.toArray(new TypeInfo[openChoices.size()][]);				ISourceRange[] ranges= (ISourceRange[]) sourceRanges.toArray(new ISourceRange[sourceRanges.size()]);				TypeInfo[] chosen= fChooseImportQuery.chooseImports(choices, ranges);				if (chosen == null) {					// cancel pressed by the user					throw new OperationCanceledException();				}				for (int i= 0; i < chosen.length; i++) {					TypeInfo typeInfo= chosen[i];					fImportsStructure.addImport(typeInfo.getFullyQualifiedName());				}							}			fImportsStructure.create(fDoSave, new SubProgressMonitor(monitor, 1));						determineImportDifferences(fImportsStructure.getCreatedImports(), oldSingleImports, oldDemandImports);			processor= null;		} finally {			monitor.done();		}	}