[java-inspection] IDEA-324133 not resolve for RedundantExplicitChronoFieldInspection

GitOrigin-RevId: 883695de18261d6202065f6fa4f640d6a0de4d49
This commit is contained in:
Mikhail Pyltsin
2023-07-03 09:32:46 +02:00
committed by intellij-monorepo-bot
parent 045798e76b
commit 28bafa0ae3

View File

@@ -32,16 +32,13 @@ public class RedundantExplicitChronoFieldInspection extends AbstractBaseJavaLoca
return new JavaElementVisitor() {
@Override
public void visitMethodCallExpression(@NotNull PsiMethodCallExpression call) {
PsiMethod method = call.resolveMethod();
if (method == null) {
return;
}
String methodName = method.getName();
String methodName = call.getMethodExpression().getReferenceName();
if (!"get".equals(methodName) && !"with".equals(methodName) &&
!"plus".equals(methodName) && !"minus".equals(methodName)) {
return;
}
if (!CAN_BE_SIMPLIFIED_MATCHERS.methodMatches(method)) return;
if (!CAN_BE_SIMPLIFIED_MATCHERS.matches(call)) return;
int fieldArgumentIndex = 1;
if ("get".equals(methodName) || "with".equals(methodName)) {
fieldArgumentIndex = 0;