boolean removeProjectFile= false; boolean removeOutputFolder= false; boolean removeClasspathFile= false;
	protected void updateProject(IProgressMonitor monitor) throws CoreException {				fCurrProject= fFirstPage.getProjectHandle();		fCurrProjectLocation= fFirstPage.getLocationPath();        boolean removeProjectFile= false;        boolean removeOutputFolder= false;        boolean removeClasspathFile= false;				if (monitor == null) {			monitor= new NullProgressMonitor();		}		try {			monitor.beginTask(NewWizardMessages.getString("JavaProjectWizardSecondPage.operation.initialize"), 7); //$NON-NLS-1$			if (monitor.isCanceled()) {				throw new OperationCanceledException();			}                        removeClasspathFile= !fileExists(".classpath"); //$NON-NLS-1$            removeProjectFile= !fileExists(".project"); //$NON-NLS-1$            			createProject(fCurrProject, fCurrProjectLocation, new SubProgressMonitor(monitor, 1));							IClasspathEntry[] entries= null;			IPath outputLocation= null;				if (fFirstPage.getDetect()) {				if (!fCurrProject.getFile(".classpath").exists()) { //$NON-NLS-1$					final ClassPathDetector detector= new ClassPathDetector(fCurrProject);					entries= detector.getClasspath();                    outputLocation= detector.getOutputLocation();                    if (outputLocation == null || fCurrProject.findMember(outputLocation.removeFirstSegments(fCurrProject.getFullPath().segmentCount())) == null)                        removeOutputFolder= true;				}			} else if (fFirstPage.isSrcBin()) {				IPreferenceStore store= PreferenceConstants.getPreferenceStore();				IPath srcPath= new Path(store.getString(PreferenceConstants.SRCBIN_SRCNAME));				IPath binPath= new Path(store.getString(PreferenceConstants.SRCBIN_BINNAME));								if (srcPath.segmentCount() > 0) {					IFolder folder= fCurrProject.getFolder(srcPath);					CoreUtility.createFolder(folder, true, true, null);				}								if (binPath.segmentCount() > 0 && !binPath.equals(srcPath)) {					IFolder folder= fCurrProject.getFolder(binPath);					CoreUtility.createFolder(folder, true, true, null);				}								final IPath projectPath= fCurrProject.getFullPath();				// configure the classpath entries, including the default jre library.				List cpEntries= new ArrayList();				cpEntries.add(JavaCore.newSourceEntry(projectPath.append(srcPath)));				cpEntries.addAll(Arrays.asList(PreferenceConstants.getDefaultJRELibrary()));				entries= (IClasspathEntry[]) cpEntries.toArray(new IClasspathEntry[cpEntries.size()]);								// configure the output location				outputLocation= projectPath.append(binPath);			} else {				IPath projectPath= fCurrProject.getFullPath();				List cpEntries= new ArrayList();				cpEntries.add(JavaCore.newSourceEntry(projectPath));				cpEntries.addAll(Arrays.asList(PreferenceConstants.getDefaultJRELibrary()));				entries= (IClasspathEntry[]) cpEntries.toArray(new IClasspathEntry[cpEntries.size()]);				outputLocation= projectPath;			}			if (monitor.isCanceled()) {				throw new OperationCanceledException();			}			            IJavaProject jProject= null;            jProject= internalConfigureJavaProject(entries, outputLocation, monitor);            init(jProject == null ? JavaCore.create(fCurrProject) : jProject, outputLocation, entries, false);            fRemoveList= new ArrayList();            if (removeClasspathFile)                fRemoveList.add(fCurrProject.getFile(".classpath")); //$NON-NLS-1$            if (removeProjectFile)                fRemoveList.add(fCurrProject.getFile(".project")); //$NON-NLS-1$            if (removeOutputFolder && outputLocation != null)                fRemoveList.add(fCurrProject.getFolder(outputLocation.removeFirstSegments(fCurrProject.getFullPath().segmentCount())));			monitor.worked(1);		} finally {			monitor.done();		}	}