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; } }
if (singleSource) { if (oldInfo != null && weakCpListener != null) { oldInfo.removeChangeListener(weakCpListener); this.weakCpListener = null; }); if (this.weakCpListener != null) { cpInfo.removeChangeListener(weakCpListener);
assert info != null; assert wl != null; info.removeChangeListener(wl); info = null; parse(lastSnapshot, task, null);