mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
fix leak tests
This commit is contained in:
@@ -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"() {
|
||||
|
||||
@@ -344,7 +344,7 @@ public class FileStatusMap implements Disposable {
|
||||
|
||||
@Override
|
||||
public <T> T getUserData(@NotNull Key<T> key) {
|
||||
throw new UnsupportedOperationException();
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user