if (isActiveElement) reconciled(ast, je);
if (isActiveElement) { if (fAST != null) { if (DEBUG) System.out.println(getThreadName() + " - " + DEBUG_PREFIX + "Ignore created AST for " + je.getElementName() + "- AST from reconciler is newer"); reconciled(fAST, je); } else reconciled(ast, je); }
	public CompilationUnit getAST(IJavaElement je, WAIT_FLAG waitFlag, IProgressMonitor progressMonitor) {		Assert.isTrue(je != null && (je.getElementType() == IJavaElement.CLASS_FILE || je.getElementType() == IJavaElement.COMPILATION_UNIT));		if (progressMonitor != null && progressMonitor.isCanceled())			return null;		boolean isActiveElement;		synchronized (this) {			isActiveElement= je.equals(fActiveJavaElement);			if (isActiveElement) {				if (fAST != null) {					if (DEBUG)						System.out.println(getThreadName() + " - " + DEBUG_PREFIX + "returning cached AST:" + toString(fAST) + " for: " + je.getElementName()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$					return fAST;				}				if (waitFlag == WAIT_NO) {					if (DEBUG)						System.out.println(getThreadName() + " - " + DEBUG_PREFIX + "returning null (WAIT_NO) for: " + je.getElementName()); //$NON-NLS-1$ //$NON-NLS-2$					return null;				}			}		}		if (isActiveElement && isReconciling(je)) {			try {				final IJavaElement activeElement= fReconcilingJavaElement;				// Wait for AST				synchronized (fWaitLock) {					if (DEBUG)						System.out.println(getThreadName() + " - " + DEBUG_PREFIX + "waiting for AST for: " + je.getElementName()); //$NON-NLS-1$ //$NON-NLS-2$					fWaitLock.wait();				}				// Check whether active element is still valid				synchronized (this) {					if (activeElement == fActiveJavaElement) {						if (DEBUG)							System.out.println(getThreadName() + " - " + DEBUG_PREFIX + "...got AST for: " + je.getElementName()); //$NON-NLS-1$ //$NON-NLS-2$						return fAST;					}				}				return getAST(je, waitFlag, progressMonitor);			} catch (InterruptedException e) {			}		} else if (waitFlag == WAIT_NO || (waitFlag == WAIT_ACTIVE_ONLY && !(isActiveElement && fAST == null)))			return null;		if (isActiveElement)			aboutToBeReconciled(je);		CompilationUnit ast= null;		try {			ast= createAST(je, progressMonitor);			if (progressMonitor != null && progressMonitor.isCanceled())				ast= null;			else if (DEBUG && ast != null)				System.err.println(getThreadName() + " - " + DEBUG_PREFIX + "created AST for: " + je.getElementName()); //$NON-NLS-1$ //$NON-NLS-2$		} finally {			if (isActiveElement)				reconciled(ast, je);		}		return ast;	}