[java] Adjust Spring contracts when safe deleting parameters

#IDEA-367681 Fixed

GitOrigin-RevId: f62be3a3c0d144bb4f6454347865b96190a7fb1f
This commit is contained in:
Bart van Helvert
2025-02-17 21:56:29 +01:00
committed by intellij-monorepo-bot
parent 6ab0ede679
commit 6e90ba2b6c
3 changed files with 35 additions and 32 deletions

View File

@@ -532,7 +532,7 @@ public class JavaSafeDeleteProcessor extends SafeDeleteProcessorDelegateBase {
if (element instanceof PsiParameter parameter && element.getParent() instanceof PsiParameterList parameterList) {
PsiMethod method = ObjectUtils.tryCast(parameterList.getParent(), PsiMethod.class);
if (method != null) {
PsiAnnotation contract = method.getModifierList().findAnnotation(JavaMethodContractUtil.ORG_JETBRAINS_ANNOTATIONS_CONTRACT);
PsiAnnotation contract = JavaMethodContractUtil.findContractAnnotation(method);
if (contract != null) {
ParameterInfoImpl[] info = ParameterInfoImpl.fromMethodExceptParameter(method, parameter);
try {