Nullability () { if (!PsiUtil.isLanguageLevel5OrHigher(myElements[0]) || PsiUtil.resolveClassInType(myReturnType) == null) return null; final NullableNotNullManager manager = NullableNotNullManager.getInstance(myProject); final PsiClass nullableAnnotationClass = JavaPsiFacade.getInstance(myProject) .findClass(manager.getDefaultNullable(), myElements[0].getResolveScope()); if (nullableAnnotationClass != null) { final PsiElement elementInCopy = myTargetClass.getContainingFile().copy().findElementAt(myTargetClass.getTextOffset()); final PsiClass classCopy = PsiTreeUtil.getParentOfType(elementInCopy, PsiClass.class); if (classCopy == null) { return null; } final PsiMethod emptyMethod = (PsiMethod)classCopy.addAfter(generateEmptyMethod("name", null), classCopy.getLBrace()); prepareMethodBody(emptyMethod, false); if (myNotNullConditionalCheck || myNullConditionalCheck) { return Nullability.NULLABLE; } return DfaUtil.inferMethodNullability(emptyMethod); } return null; }