[java-live-templates] Stabilize ThrInSwitch test

Document.stripTrailingSpaces behavior depends on whether the document is committed, which looks to be racy.

GitOrigin-RevId: bdc8b46e9a968782ac7630102b5393460d113061
This commit is contained in:
Tagir Valeev
2023-06-06 16:22:03 +02:00
committed by intellij-monorepo-bot
parent af2afed63f
commit b47e2068ba
2 changed files with 4 additions and 2 deletions

View File

@@ -3,7 +3,7 @@ import java.util.List;
class Foo {
void test() {
switch(1) {
default -> throw new <caret>
default -> throw new<caret>
}
}
}

View File

@@ -217,9 +217,11 @@ class Outer {
private void stripTrailingSpaces() {
DocumentImpl document = (DocumentImpl)getEditor().getDocument()
def manager = PsiDocumentManager.getInstance(getProject())
manager.commitDocument(document)
document.setStripTrailingSpacesEnabled(true)
document.stripTrailingSpaces(getProject())
PsiDocumentManager.getInstance(getProject()).commitAllDocuments()
manager.commitAllDocuments()
}
void testAsListToar() {