void (PsiMethod method, List<? super String> diffs) { if (ProjectBytecodeAnalysis.getInstance(getProject()).getKey(method) == null) return; String methodKey = PsiFormatUtil.getExternalName(method, false, Integer.MAX_VALUE); if (INFERRED_TEST_METHOD.equals(methodKey)) return; String externalNotNullMethodAnnotation = findExternalAnnotation(method, AnnotationUtil.NOT_NULL) == null ? "-" : "@NotNull"; String inferredNotNullMethodAnnotation = findInferredAnnotation(method, AnnotationUtil.NOT_NULL) == null ? "-" : "@NotNull"; if (!externalNotNullMethodAnnotation.equals(inferredNotNullMethodAnnotation)) { diffs.add(methodKey + ": " + externalNotNullMethodAnnotation + " != " + inferredNotNullMethodAnnotation + "\n"); } String externalNullableMethodAnnotation = findExternalAnnotation(method, AnnotationUtil.NULLABLE) == null ? "-" : "@Nullable"; String inferredNullableMethodAnnotation = findInferredAnnotation(method, AnnotationUtil.NULLABLE) == null ? "-" : "@Nullable"; if (!externalNullableMethodAnnotation.equals(inferredNullableMethodAnnotation)) { diffs.add(methodKey + ": " + externalNullableMethodAnnotation + " != " + inferredNullableMethodAnnotation + "\n"); } for (PsiParameter parameter : method.getParameterList().getParameters()) { String parameterKey = PsiFormatUtil.getExternalName(parameter, false, Integer.MAX_VALUE); String externalNotNull = findExternalAnnotation(parameter, AnnotationUtil.NOT_NULL) == null ? "-" : "@NotNull"; String inferredNotNull = findInferredAnnotation(parameter, AnnotationUtil.NOT_NULL) == null ? "-" : "@NotNull"; if (!externalNotNull.equals(inferredNotNull)) { diffs.add(parameterKey + ": " + externalNotNull + " != " + inferredNotNull + "\n"); } String externalNullable = findExternalAnnotation(parameter, AnnotationUtil.NULLABLE) == null ? "-" : "@Nullable"; String inferredNullable = findInferredAnnotation(parameter, AnnotationUtil.NULLABLE) == null ? "-" : "@Nullable"; if (!externalNullable.equals(inferredNullable)) { diffs.add(parameterKey + ": " + externalNullable + " != " + inferredNullable + "\n"); } } if (!EXTERNAL_TEST_METHOD.equals(methodKey)) { PsiAnnotation externalContractAnnotation = findExternalAnnotation(method, ORG_JETBRAINS_ANNOTATIONS_CONTRACT); PsiAnnotation inferredContractAnnotation = findInferredAnnotation(method, ORG_JETBRAINS_ANNOTATIONS_CONTRACT); String externalContractAnnotationText = externalContractAnnotation == null ? "-" : externalContractAnnotation.getText(); String inferredContractAnnotationText = inferredContractAnnotation == null ? "-" : inferredContractAnnotation.getText(); if (!externalContractAnnotationText.equals(inferredContractAnnotationText)) { diffs.add(methodKey + ": " + externalContractAnnotationText + " != " + inferredContractAnnotationText + "\n"); } } }