mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-200807 NPE caused by NonClasspathClassFinder constructor leaking "this"
This commit is contained in:
@@ -52,7 +52,7 @@ public abstract class NonClasspathClassFinder extends PsiElementFinder {
|
||||
clearCache();
|
||||
}
|
||||
});
|
||||
LowMemoryWatcher.register(() -> clearCache(), project);
|
||||
LowMemoryWatcher.register(() -> myCache = null, project);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
|
||||
@@ -67,12 +67,7 @@ public class GradleClassFinder extends NonClasspathClassFinder {
|
||||
@Override
|
||||
public void clearCache() {
|
||||
super.clearCache();
|
||||
// The parent class can publish a reference to this object before the constructor has returned.
|
||||
// Thus, it's possible that not all fields of this object are initialized by the time they
|
||||
// are accessed in clearCache(). Workaround is to null check.
|
||||
if (myCaches != null) {
|
||||
myCaches.clear();
|
||||
}
|
||||
myCaches.clear();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user