mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
fix merge conflict
GitOrigin-RevId: 3a82f0ac9cca7e35022ef7d3ba7d28c4c38bec30
This commit is contained in:
committed by
intellij-monorepo-bot
parent
54dc320eca
commit
1c8f862f8f
@@ -1,24 +0,0 @@
|
||||
// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.psi.impl;
|
||||
|
||||
import com.intellij.psi.PsiClass;
|
||||
import com.intellij.psi.PsiElementFactory;
|
||||
import com.intellij.psi.PsiField;
|
||||
import com.intellij.testFramework.LightJavaCodeInsightTestCase;
|
||||
|
||||
public class PsiModificationPerformanceTest extends LightJavaCodeInsightTestCase {
|
||||
public void testManySmallPSIChangesDoNotCauseQuadraticRecomputationsOfWholeFileText() {
|
||||
int N = 100_000;
|
||||
String text = " int field;\n".repeat(N);
|
||||
|
||||
PsiClass aClass = PsiElementFactory.getInstance(getProject()).createClassFromText(text, null);
|
||||
assertFalse(aClass.isPhysical());
|
||||
PsiField firstField = aClass.getFields()[0];
|
||||
// would pass only if each PSI change does not cause recomputation of the whole file text in com.intellij.psi.impl.source.PsiJavaFileBaseImpl.getLanguageLevelInner
|
||||
for (int i = 0; i < N; i++) {
|
||||
firstField.setName("f" + i);
|
||||
}
|
||||
assertFalse(aClass.isPhysical());
|
||||
assertEquals(N, aClass.getFields().length);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user