cu.reconcile();
cu.reconcile(null);
	public void createType(IProgressMonitor monitor) throws CoreException, InterruptedException {				monitor.beginTask(NewWizardMessages.getString("NewTypeWizardPage.operationdesc"), 10); //$NON-NLS-1$				IPackageFragmentRoot root= getPackageFragmentRoot();		IPackageFragment pack= getPackageFragment();		if (pack == null) {			pack= root.getPackageFragment(""); //$NON-NLS-1$		}				if (!pack.exists()) {			String packName= pack.getElementName();			pack= root.createPackageFragment(packName, true, null);		}						monitor.worked(1);				String clName= getTypeName();				boolean isInnerClass= isEnclosingTypeSelected();				IType createdType;		ImportsStructure imports;		int indent= 0;		String[] prefOrder= ImportOrganizePreferencePage.getImportOrderPreference();		int threshold= ImportOrganizePreferencePage.getImportNumberThreshold();							String lineDelimiter= null;			if (!isInnerClass) {			lineDelimiter= System.getProperty("line.separator", "\n");						String packStatement= pack.isDefaultPackage() ? "" : "package " + pack.getElementName() + ";" + lineDelimiter + lineDelimiter;			ICompilationUnit parentCU= pack.createCompilationUnit(clName + ".java", packStatement, false, new SubProgressMonitor(monitor, 2)); //$NON-NLS-1$			imports= new ImportsStructure(parentCU, prefOrder, threshold, false);						String content= constructTypeStub(imports, lineDelimiter, parentCU);			createdType= parentCU.createType(content, null, false, new SubProgressMonitor(monitor, 3));		} else {			IType enclosingType= getEnclosingType();						// if we are working on a enclosed type that is open in an editor,			// then replace the enclosing type with its working copy			IType workingCopy= (IType) EditorUtility.getWorkingCopy(enclosingType);			if (workingCopy != null) {				enclosingType= workingCopy;			}			ICompilationUnit parentCU= enclosingType.getCompilationUnit();			imports= new ImportsStructure(parentCU, prefOrder, threshold, true);						lineDelimiter= StubUtility.getLineDelimiterUsed(enclosingType);			String content= constructTypeStub(imports, lineDelimiter, parentCU);			IJavaElement[] elems= enclosingType.getChildren();			IJavaElement sibling= elems.length > 0 ? elems[0] : null;						createdType= enclosingType.createType(content, sibling, false, new SubProgressMonitor(monitor, 1));					indent= StubUtility.getIndentUsed(enclosingType) + 1;		}				// add imports for superclass/interfaces, so types can be resolved correctly		imports.create(!isInnerClass, new SubProgressMonitor(monitor, 1));				createTypeMembers(createdType, imports, new SubProgressMonitor(monitor, 1));		// add imports		imports.create(!isInnerClass, new SubProgressMonitor(monitor, 1));				ICompilationUnit cu= createdType.getCompilationUnit();			ISourceRange range;		if (isInnerClass) {			synchronized(cu) {				cu.reconcile();			}			range= createdType.getSourceRange();		} else {			range= cu.getSourceRange();		}				IBuffer buf= cu.getBuffer();		String originalContent= buf.getText(range.getOffset(), range.getLength());		String formattedContent= StubUtility.codeFormat(originalContent, indent, lineDelimiter);		buf.replace(range.getOffset(), range.getLength(), formattedContent);		if (!isInnerClass) {			String fileComment= getFileComment(cu);			if (fileComment != null) {				buf.replace(0, 0, fileComment + lineDelimiter);			}			buf.save(new SubProgressMonitor(monitor, 1), false);		} else {			monitor.worked(1);		}		fCreatedType= createdType;		monitor.done();	}	