From 5349c26bf248cd33eacbd5eb30fb1d294a602f69 Mon Sep 17 00:00:00 2001 From: Marcin Mikosik Date: Tue, 22 Jul 2025 12:29:39 +0000 Subject: [PATCH] [java] Fix formatting in MethodChecker Merge-request: IJ-MR-169858 Merged-by: Marcin Mikosik GitOrigin-RevId: e16564e2f6672b9686e2a70cc9363e19d2809bf2 --- .../java/codeserver/highlighting/MethodChecker.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/java/codeserver/highlighting/src/com/intellij/java/codeserver/highlighting/MethodChecker.java b/java/codeserver/highlighting/src/com/intellij/java/codeserver/highlighting/MethodChecker.java index a07ac028342d..49a02a1c4b27 100644 --- a/java/codeserver/highlighting/src/com/intellij/java/codeserver/highlighting/MethodChecker.java +++ b/java/codeserver/highlighting/src/com/intellij/java/codeserver/highlighting/MethodChecker.java @@ -135,7 +135,9 @@ final class MethodChecker { PsiModifierList superModifierList = superMethod.getModifierList(); if (superModifierList.hasModifierProperty(PsiModifier.PRIVATE)) return; if (superModifierList.hasModifierProperty(PsiModifier.PACKAGE_LOCAL) - && !JavaPsiFacade.getInstance(myVisitor.project()).arePackagesTheSame(aClass, superClass)) return; + && !JavaPsiFacade.getInstance(myVisitor.project()).arePackagesTheSame(aClass, superClass)) { + return; + } boolean isSuperMethodStatic = superModifierList.hasModifierProperty(PsiModifier.STATIC); if (isMethodStatic != isSuperMethodStatic) { var errorKind = isMethodStatic ? JavaErrorKinds.METHOD_STATIC_OVERRIDES_INSTANCE : JavaErrorKinds.METHOD_INSTANCE_OVERRIDES_STATIC; @@ -271,7 +273,7 @@ final class MethodChecker { PsiClassType exception = checkedExceptions.get(index); myVisitor.report(JavaErrorKinds.METHOD_INHERITANCE_CLASH_DOES_NOT_THROW.create( anchor, - new JavaErrorKinds.IncompatibleOverrideExceptionContext(method, superMethod, exception, + new JavaErrorKinds.IncompatibleOverrideExceptionContext(method, superMethod, exception, exceptionContexts.isEmpty() ? null : exceptionContexts.get(index)))); return; }