[Java. Code Formatting] Fix type annotations wrapping in RecordCanBeClassInspectionTest

IDEA-342196

GitOrigin-RevId: 8f1c8e7fbd72f93b115b6c267cb549bd703bf8d0
This commit is contained in:
Georgii Ustinov
2024-01-04 15:24:59 +02:00
committed by intellij-monorepo-bot
parent 987c387696
commit 6ca3373c89
2 changed files with 5 additions and 3 deletions

View File

@@ -511,7 +511,10 @@ public final class JavaFormatterUtil {
if (current.getElementType() != JavaElementType.ANNOTATION || parent.getElementType() != JavaElementType.MODIFIER_LIST) return false;
while (true) {
current = FormatterUtil.getPreviousNonWhitespaceSibling(current);
if (current instanceof PsiKeyword) return true;
if (current instanceof PsiKeyword) {
ASTNode grandParent = parent.getTreeParent();
return grandParent != null && grandParent.getElementType() == JavaElementType.METHOD;
}
else if (current == null || current.getElementType() != JavaElementType.ANNOTATION) break;
}
return false;

View File

@@ -54,8 +54,7 @@ final class R implements F3 {
return f1;
}
public @TypeUse(2)
@TypeUse2(2) int f2() {
public @TypeUse(2) @TypeUse2(2) int f2() {
return f2;
}