diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/diagnostics/Errors.java b/compiler/frontend/src/org/jetbrains/jet/lang/diagnostics/Errors.java index 20a4e94f883..5f3a601b45d 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/diagnostics/Errors.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/diagnostics/Errors.java @@ -565,8 +565,6 @@ public interface Errors { UNRESOLVED_REFERENCE, NAMED_PARAMETER_NOT_FOUND, UNRESOLVED_REFERENCE_WRONG_RECEIVER); ImmutableSet UNUSED_ELEMENT_DIAGNOSTICS = ImmutableSet.of( UNUSED_VARIABLE, UNUSED_PARAMETER, ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE); - ImmutableSet REDECLARATION_DIAGNOSTICS = ImmutableSet.of( - REDECLARATION, NAME_SHADOWING); ImmutableSet TYPE_INFERENCE_ERRORS = ImmutableSet.of( TYPE_INFERENCE_NO_INFORMATION_FOR_PARAMETER, TYPE_INFERENCE_CONFLICTING_SUBSTITUTIONS, TYPE_INFERENCE_TYPE_CONSTRUCTOR_MISMATCH, TYPE_INFERENCE_UPPER_BOUND_VIOLATED, TYPE_INFERENCE_EXPECTED_TYPE_MISMATCH); diff --git a/idea/src/org/jetbrains/jet/plugin/highlighter/JetPsiChecker.java b/idea/src/org/jetbrains/jet/plugin/highlighter/JetPsiChecker.java index 665edd9ffc7..5f8b9e212a7 100644 --- a/idea/src/org/jetbrains/jet/plugin/highlighter/JetPsiChecker.java +++ b/idea/src/org/jetbrains/jet/plugin/highlighter/JetPsiChecker.java @@ -133,8 +133,8 @@ public class JetPsiChecker implements Annotator, HighlightRangeExtension { } private static class ElementAnnotator { - @NotNull private final PsiElement element; - @NotNull private final AnnotationHolder holder; + private final PsiElement element; + private final AnnotationHolder holder; private boolean isMarkedWithRedeclaration; @@ -179,7 +179,7 @@ public class JetPsiChecker implements Annotator, HighlightRangeExtension { return; } - if (Errors.REDECLARATION_DIAGNOSTICS.contains(diagnostic.getFactory())) { + if (diagnostic.getFactory() == Errors.REDECLARATION) { if (!isMarkedWithRedeclaration) { isMarkedWithRedeclaration = true; Annotation annotation = holder.createErrorAnnotation(diagnostic.getTextRanges().get(0), "");