mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
gc'able AST for changed files
This commit is contained in:
@@ -29,7 +29,7 @@ import com.intellij.codeInspection.defaultFileTemplateUsage.DefaultFileTemplateU
|
||||
*/
|
||||
class AstLeaksTest extends LightCodeInsightFixtureTestCase {
|
||||
|
||||
public void "_test AST should be on a soft reference, for changed files as well"() {
|
||||
public void "test AST should be on a soft reference, for changed files as well"() {
|
||||
def file = myFixture.addClass('class Foo {}').containingFile
|
||||
assert file.findElementAt(0) instanceof PsiKeyword
|
||||
LeakHunter.checkLeak(file, JavaFileElement)
|
||||
|
||||
@@ -129,7 +129,7 @@ public abstract class PsiFileImpl extends ElementBase implements PsiFileEx, PsiF
|
||||
public FileElement getTreeElementNoLock() {
|
||||
ASTNode node = _getTreeElement();
|
||||
if (node == null && !getViewProvider().isPhysical()) {
|
||||
setTreeElement(node = loadTreeElement());
|
||||
node = loadTreeElement();
|
||||
}
|
||||
return (FileElement)node;
|
||||
}
|
||||
@@ -400,7 +400,6 @@ public abstract class PsiFileImpl extends ElementBase implements PsiFileEx, PsiF
|
||||
private void doClearCaches() {
|
||||
final FileElement tree = getTreeElement();
|
||||
if (tree != null) {
|
||||
myTreeElementPointer = tree;
|
||||
tree.clearCaches();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user