@Nullable/@NotNull problems: false positive: annotation is inapplicable for primitive types (IDEA-78186 )

This commit is contained in:
anna
2011-12-07 20:42:09 +01:00
parent 53d62251b5
commit e39f09af16
2 changed files with 9 additions and 1 deletions
@@ -207,7 +207,7 @@ public class NullableStuffInspection extends BaseLocalInspectionTool {
if (!method.equals(parameter.getDeclarationScope())) {
return true;
}
if (REPORT_NOT_ANNOTATED_GETTER && !AnnotationUtil.isAnnotated(parameter, manager.getAllAnnotations())) {
if (REPORT_NOT_ANNOTATED_GETTER && !AnnotationUtil.isAnnotated(parameter, manager.getAllAnnotations()) && !TypeConversionUtil.isPrimitiveAndNotNull(parameter.getType())) {
final PsiIdentifier nameIdentifier2 = parameter.getNameIdentifier();
assert nameIdentifier2 != null : parameter;
holder.registerProblem(nameIdentifier2, InspectionsBundle
@@ -47,4 +47,12 @@ class C {
}
return c1;
}
}
class D {
@Nullable Long myL;
D(long l) {
myL = l;
}
}