diff --git a/java/java-tests/testSrc/com/intellij/psi/AstLeaksTest.groovy b/java/java-tests/testSrc/com/intellij/psi/AstLeaksTest.groovy index ed0ac4de00f3..affd1ffe21e0 100644 --- a/java/java-tests/testSrc/com/intellij/psi/AstLeaksTest.groovy +++ b/java/java-tests/testSrc/com/intellij/psi/AstLeaksTest.groovy @@ -60,7 +60,8 @@ class AstLeaksTest extends LightCodeInsightFixtureTestCase { def sup = myFixture.addFileToProject('sup.java', 'class Super { Super() {} }') assert sup.findElementAt(0) // load AST assert !((PsiFileImpl)sup).stub - LeakHunter.checkLeak(sup, MethodElement) + + LeakHunter.checkLeak(sup, MethodElement, { it.psi.containingFile == sup } as Processor) def foo = myFixture.addFileToProject('a.java', 'class Foo extends Super { void bar() { bar(); } }') myFixture.configureFromExistingVirtualFile(foo.virtualFile) @@ -69,8 +70,8 @@ class AstLeaksTest extends LightCodeInsightFixtureTestCase { assert !((PsiFileImpl)foo).stub assert ((PsiFileImpl)foo).treeElement - LeakHunter.checkLeak(foo, MethodElement) - LeakHunter.checkLeak(sup, MethodElement) + LeakHunter.checkLeak(foo, MethodElement, { it.psi.containingFile == foo } as Processor) + LeakHunter.checkLeak(sup, MethodElement, { it.psi.containingFile == sup } as Processor) } public void "test no hard refs to Default File Template inspection internal AST"() { diff --git a/platform/analysis-impl/src/com/intellij/codeInsight/daemon/impl/FileStatusMap.java b/platform/analysis-impl/src/com/intellij/codeInsight/daemon/impl/FileStatusMap.java index cfb4b900d573..7acc45ecbdf3 100644 --- a/platform/analysis-impl/src/com/intellij/codeInsight/daemon/impl/FileStatusMap.java +++ b/platform/analysis-impl/src/com/intellij/codeInsight/daemon/impl/FileStatusMap.java @@ -344,7 +344,7 @@ public class FileStatusMap implements Disposable { @Override public T getUserData(@NotNull Key key) { - throw new UnsupportedOperationException(); + return null; } @Override diff --git a/platform/platform-tests/testSrc/com/intellij/usages/impl/UsageViewTest.java b/platform/platform-tests/testSrc/com/intellij/usages/impl/UsageViewTest.java index 3fcc42baa645..a7073cd5600e 100644 --- a/platform/platform-tests/testSrc/com/intellij/usages/impl/UsageViewTest.java +++ b/platform/platform-tests/testSrc/com/intellij/usages/impl/UsageViewTest.java @@ -50,7 +50,7 @@ public class UsageViewTest extends LightPlatformCodeInsightFixtureTestCase { FileDocumentManager.getInstance().saveAllDocuments(); UIUtil.dispatchAllInvocationEvents(); - LeakHunter.checkLeak(usageView, PsiFileImpl.class); + LeakHunter.checkLeak(usageView, PsiFileImpl.class, PsiFileImpl::isPhysical); LeakHunter.checkLeak(usageView, Document.class); }