List<PsiAnnotation> (@NotNull PsiModifierListOwner listOwner) { listOwner = PsiUtil.preferCompiledElement(listOwner); List<PsiAnnotation> result = new ArrayList<>(); if (canInferFromByteCode(listOwner)) { PsiAnnotation[] fromBytecode = ProjectBytecodeAnalysis.getInstance(myProject).findInferredAnnotations(listOwner); for (PsiAnnotation annotation : fromBytecode) { if (!ignoreInference(listOwner, annotation.getQualifiedName()) && !ignoreByteCodeAnnotation(listOwner, annotation.getQualifiedName())) { result.add(annotation); } } } if (listOwner instanceof PsiMethod) { PsiAnnotation hardcoded = getHardcodedContractAnnotation((PsiMethod)listOwner); ContainerUtil.addIfNotNull(result, hardcoded); if (listOwner instanceof PsiMethodImpl) { if (hardcoded == null && !ignoreInference(listOwner, ORG_JETBRAINS_ANNOTATIONS_CONTRACT)) { ContainerUtil.addIfNotNull(result, getInferredContractAnnotation((PsiMethodImpl)listOwner)); } if (!ignoreInference(listOwner, myNullabilityManager.getDefaultNotNull()) || !ignoreInference(listOwner, myNullabilityManager.getDefaultNullable())) { PsiAnnotation annotation = getInferredNullabilityAnnotation((PsiMethodImpl)listOwner); if (annotation != null && !ignoreInference(listOwner, annotation.getQualifiedName())) { result.add(annotation); } } } } if (listOwner instanceof PsiParameter && !ignoreInference(listOwner, myNullabilityManager.getDefaultNotNull())) { ContainerUtil.addIfNotNull(result, getInferredNullabilityAnnotation((PsiParameter)listOwner)); } ContainerUtil.addIfNotNull(result, getInferredMutabilityAnnotation(listOwner)); return result; }