[jvm] Fix empty method inspection on default method

#IDEA-374417 Fixed

GitOrigin-RevId: 49be25fd495b89b522fa839e1cda17f09b64468e
This commit is contained in:
Bart van Helvert
2025-06-12 12:20:50 +02:00
committed by intellij-monorepo-bot
parent 8da68397b4
commit 08b951455a
9 changed files with 56 additions and 34 deletions

View File

@@ -294,15 +294,8 @@ public sealed class RefMethodImpl extends RefJavaElementImpl implements RefMetho
refUtil.addReferencesTo(method, this, method);
checkForSuperCall(method);
setOnlyCallsSuper(refUtil.isMethodOnlyCallsSuper(method));
boolean isBodyEmpty = isOnlyCallsSuper() || !isExternalOverride() && isEmptyExpression(method.getUastBody());
setBodyEmpty(isBodyEmpty);
if (!isAbstract() && (ownerClass == null || !ownerClass.isInterface())) {
setHasBody(method.getUastBody() != null);
} else {
setHasBody(!isBodyEmpty);
}
setHasBody(method.getUastBody() != null);
setBodyEmpty(isOnlyCallsSuper() || !isExternalOverride() && isEmptyExpression(method.getUastBody()));
refUtil.addTypeReference(method, method.getReturnType(), getRefManager(), this);
}
@@ -619,7 +612,7 @@ public sealed class RefMethodImpl extends RefJavaElementImpl implements RefMetho
setFlag(bodyEmpty, IS_BODY_EMPTY_MASK);
}
public void setHasBody(boolean hasBody) {
private void setHasBody(boolean hasBody) {
setFlag(hasBody, HAS_BODY_MASK);
}