diff --git a/java/java-analysis-impl/src/com/intellij/codeInspection/nullable/NullableStuffInspectionBase.java b/java/java-analysis-impl/src/com/intellij/codeInspection/nullable/NullableStuffInspectionBase.java index 98e264c07e38..4eb38f2dcea9 100644 --- a/java/java-analysis-impl/src/com/intellij/codeInspection/nullable/NullableStuffInspectionBase.java +++ b/java/java-analysis-impl/src/com/intellij/codeInspection/nullable/NullableStuffInspectionBase.java @@ -87,8 +87,6 @@ public class NullableStuffInspectionBase extends AbstractBaseJavaLocalInspection public boolean REPORT_NULLS_PASSED_TO_NOT_NULL_PARAMETER = true; @SuppressWarnings("WeakerAccess") public boolean REPORT_REDUNDANT_NULLABILITY_ANNOTATION_IN_THE_SCOPE_OF_ANNOTATED_CONTAINER = true; - @SuppressWarnings("WeakerAccess") public boolean REPORT_CONFLICT_IN_ASSIGNMENTS = true; - private static final Logger LOG = Logger.getInstance(NullableStuffInspectionBase.class); @Override @@ -104,7 +102,6 @@ public class NullableStuffInspectionBase extends AbstractBaseJavaLocalInspection "REPORT_NULLS_PASSED_TO_NOT_NULL_PARAMETER".equals(name) && "true".equals(value) || "REPORT_NOT_NULL_TO_NULLABLE_CONFLICTS_IN_ASSIGNMENTS".equals(name) && "false".equals(value) || "REPORT_NOT_ANNOTATED_INSTANTIATION_NOT_NULL_TYPE".equals(name) && "false".equals(value) || - "REPORT_CONFLICT_IN_ASSIGNMENTS".equals(name) && "true".equals(value) || "REPORT_REDUNDANT_NULLABILITY_ANNOTATION_IN_THE_SCOPE_OF_ANNOTATED_CONTAINER".equals(name) && "true".equals(value)) { node.removeContent(child); } @@ -215,7 +212,7 @@ public class NullableStuffInspectionBase extends AbstractBaseJavaLocalInspection } PsiExpression initializer = field.getInitializer(); PsiElement identifyingElement = field.getIdentifyingElement(); - if (REPORT_CONFLICT_IN_ASSIGNMENTS && initializer != null && identifyingElement != null) { + if (initializer != null && identifyingElement != null) { checkNestedGenericClasses(identifyingElement, field.getType(), initializer.getType(), ConflictNestedTypeProblem.ASSIGNMENT_NESTED_TYPE_PROBLEM); } @@ -494,15 +491,10 @@ public class NullableStuffInspectionBase extends AbstractBaseJavaLocalInspection public void visitAssignmentExpression(@NotNull PsiAssignmentExpression expression) { PsiExpression rExpression = expression.getRExpression(); if (rExpression == null) return; - if (REPORT_CONFLICT_IN_ASSIGNMENTS) { - checkNestedGenericClasses(expression.getOperationSign(), - expression.getLExpression().getType(), - rExpression.getType(), - ConflictNestedTypeProblem.ASSIGNMENT_NESTED_TYPE_PROBLEM); - } - else { - checkCollectionNullityOnAssignment(expression.getOperationSign(), expression.getLExpression().getType(), expression.getRExpression()); - } + checkNestedGenericClasses(expression.getOperationSign(), + expression.getLExpression().getType(), + rExpression.getType(), + ConflictNestedTypeProblem.ASSIGNMENT_NESTED_TYPE_PROBLEM); } @Override @@ -511,13 +503,8 @@ public class NullableStuffInspectionBase extends AbstractBaseJavaLocalInspection if (identifier == null) return; PsiExpression initializer = variable.getInitializer(); if (initializer == null) return; - if (REPORT_CONFLICT_IN_ASSIGNMENTS) { - checkNestedGenericClasses(identifier, variable.getType(), initializer.getType(), - ConflictNestedTypeProblem.ASSIGNMENT_NESTED_TYPE_PROBLEM); - } - else { - checkCollectionNullityOnAssignment(identifier, variable.getType(), variable.getInitializer()); - } + checkNestedGenericClasses(identifier, variable.getType(), initializer.getType(), + ConflictNestedTypeProblem.ASSIGNMENT_NESTED_TYPE_PROBLEM); } @Override diff --git a/java/java-impl/src/com/intellij/codeInspection/nullable/NullableStuffInspection.java b/java/java-impl/src/com/intellij/codeInspection/nullable/NullableStuffInspection.java index 1ec54c99aae7..095ce25e4018 100644 --- a/java/java-impl/src/com/intellij/codeInspection/nullable/NullableStuffInspection.java +++ b/java/java-impl/src/com/intellij/codeInspection/nullable/NullableStuffInspection.java @@ -48,8 +48,6 @@ public class NullableStuffInspection extends NullableStuffInspectionBase { checkbox("REPORT_NOT_ANNOTATED_GETTER", JavaBundle.message("inspection.nullable.problems.not.annotated.getters.for.annotated.fields")), checkbox("REPORT_NULLS_PASSED_TO_NOT_NULL_PARAMETER", JavaBundle.message("inspection.nullable.problems.notnull.parameters.with.null.literal.option")), checkbox("REPORT_NULLABILITY_ANNOTATION_ON_LOCALS", JavaBundle.message("inspection.nullable.problems.nullability.on.locals")), - checkbox("REPORT_CONFLICT_IN_ASSIGNMENTS", JavaBundle.message( - "inspection.assignment.conflicts")), checkbox("REPORT_NOT_NULL_TO_NULLABLE_CONFLICTS_IN_ASSIGNMENTS", JavaBundle.message( "inspection.nullable.problems.notnull.to.nullable.assignment.conflicts")), checkbox("REPORT_REDUNDANT_NULLABILITY_ANNOTATION_IN_THE_SCOPE_OF_ANNOTATED_CONTAINER", JavaBundle.message( diff --git a/java/openapi/resources/messages/JavaBundle.properties b/java/openapi/resources/messages/JavaBundle.properties index 74fac482fa04..56b134be6e79 100644 --- a/java/openapi/resources/messages/JavaBundle.properties +++ b/java/openapi/resources/messages/JavaBundle.properties @@ -564,7 +564,6 @@ inspection.nullable.problems.not.annotated.getters.for.annotated.fields=Report n inspection.nullable.problems.notnull.overrides.option=Report @NotNull ¶meters overriding non-annotated inspection.nullable.problems.notnull.parameters.with.null.literal.option=Report @NotNull parameters with null-literal argument usages inspection.nullable.problems.nullability.on.locals=Report nullability annotations on local variables when they are non-applicable -inspection.assignment.conflicts=Report nullability conflicts for nested types in assignment and variable declarations inspection.nullable.problems.notnull.to.nullable.assignment.conflicts=Report assignment of a not-null type argument to a nullable type argument inspection.nullable.problems.redundant.nullability.inside.container=Report redundant nullability annotation in the scope of annotated container inspection.optional.get.without.is.present.message={0}.#ref() without ''isPresent()'' check