disable propagate nullable when configured annotation is not found in classpath (IDEA-74296 )

This commit is contained in:
anna
2011-09-15 17:59:07 +02:00
parent f4e8b0e7fc
commit 5d73f3dfb0
@@ -85,7 +85,12 @@ public class NullableStuffInspection extends BaseLocalInspectionTool {
if (psiExpression.getType() == PsiType.NULL) {
final PsiParameter parameter = parameters[i];
if (!AnnotationUtil.isNullable(parameter) && !AnnotationUtil.isNotNull(parameter)) {
holder.registerProblem(psiExpression, "Null is passed to parameter which is not yet @Nullable", new MyAddNullableAnnotationFix(parameter));
final PsiClass annotationsClass =
JavaPsiFacade.getInstance(holder.getProject()).findClass(NullableNotNullManager.getInstance(holder.getProject()).getDefaultNullable(),
psiMethod.getResolveScope());
if (annotationsClass != null) {
holder.registerProblem(psiExpression, "Null is passed to parameter which is not yet @Nullable", new MyAddNullableAnnotationFix(parameter));
}
}
}
}