void (@NotNull PsiMethod method) { super.visitMethod(method); if (method.hasAnnotation(JAVA_IO_SERIAL)) return; PsiClass pClass = getSerializablePsiClass(method); if (pClass == null) return; boolean candidateToBeAnnotated; if (pClass.isRecord()) { candidateToBeAnnotated = isSerialMethodInExternalizable(method); } else { candidateToBeAnnotated = SerializationUtils.isExternalizable(pClass) ? isSerialMethodInExternalizable(method) : isSerialMethodInSerializable(method); } if (candidateToBeAnnotated) { registerMethodError(method, method); } }