private void init(final Task task) { if (!initialized) { ClasspathInfo _tmpInfo = null; if (task instanceof ClasspathInfo.Provider && (_tmpInfo = ((ClasspathInfo.Provider)task).getClasspathInfo()) != null) { if (cpInfo != null && weakCpListener != null) { cpInfo.removeChangeListener(weakCpListener); this.weakCpListener = null; } cpInfo = _tmpInfo; this.weakCpListener = WeakListeners.change(cpInfoListener, cpInfo); cpInfo.addChangeListener (this.weakCpListener); } else { throw new IllegalArgumentException("No classpath provided by task: " + task); } initialized = true; } }
cpInfo.addChangeListener (this.weakCpListener); this.root = cp.findOwnerRoot(this.file); this.weakCpListener = WeakListeners.change(cpInfoListener, cpInfo); cpInfo.addChangeListener (this.weakCpListener); JavaSourceAccessor.getINSTANCE().invalidateCachedClasspathInfo(this.file);
info.addChangeListener(wl=WeakListeners.change(this.cpInfoListener, info));