/** * Disposes this AST provider. */ public void dispose() { // Dispose activation listener PlatformUI.getWorkbench().removeWindowListener(fActivationListener); fActivationListener= null; disposeAST(); synchronized (fWaitLock) { fWaitLock.notifyAll(); } }
/** * Disposes this AST provider. */ public void dispose() { // Dispose activation listener PlatformUI.getWorkbench().removeWindowListener(fActivationListener); fActivationListener= null; disposeAST(); synchronized (fWaitLock) { fWaitLock.notifyAll(); } }
/** * Caches the given compilation unit AST for the given Java element. * * @param ast the ast * @param javaElement the java element */ private synchronized void cache(CompilationUnit ast, ITypeRoot javaElement) { if (fActiveJavaElement != null && !fActiveJavaElement.equals(javaElement)) { if (JavaPlugin.DEBUG_AST_PROVIDER && javaElement != null) // don't report call from disposeAST() System.out.println(getThreadName() + " - " + DEBUG_PREFIX + "don't cache AST for inactive: " + toString(javaElement)); //$NON-NLS-1$ //$NON-NLS-2$ return; } if (JavaPlugin.DEBUG_AST_PROVIDER && (javaElement != null || ast != null)) // don't report call from disposeAST() System.out.println(getThreadName() + " - " + DEBUG_PREFIX + "caching AST: " + toString(ast) + " for: " + toString(javaElement)); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ if (fAST != null) disposeAST(); fAST= ast; // Signal AST change synchronized (fWaitLock) { fWaitLock.notifyAll(); } }
/** * Caches the given compilation unit AST for the given Java element. * * @param ast * @param javaElement */ private synchronized void cache(CompilationUnit ast, IJavaElement javaElement) { if (fActiveJavaElement != null && !fActiveJavaElement.equals(javaElement)) { if (DEBUG && javaElement != null) // don't report call from disposeAST() System.out.println(getThreadName() + " - " + DEBUG_PREFIX + "don't cache AST for inactive: " + toString(javaElement)); //$NON-NLS-1$ //$NON-NLS-2$ return; } if (DEBUG && (javaElement != null || ast != null)) // don't report call from disposeAST() System.out.println(getThreadName() + " - " + DEBUG_PREFIX + "caching AST: " + toString(ast) + " for: " + toString(javaElement)); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ if (fAST != null) disposeAST(); fAST= ast; // Signal AST change synchronized (fWaitLock) { fWaitLock.notifyAll(); } }