From 436619a0d870cb3c156ce24bd6640b203adbc930 Mon Sep 17 00:00:00 2001 From: Evgeny Gerashchenko Date: Wed, 20 Feb 2013 13:04:13 +0400 Subject: [PATCH] Removed AmbiguousDescriptorDiagnosticFactory. --- .../AmbiguousDescriptorDiagnosticFactory.java | 33 ------------------- .../jet/lang/diagnostics/Errors.java | 11 ++++--- .../lang/diagnostics/rendering/Renderers.java | 2 +- .../jet/plugin/highlighter/IdeRenderers.java | 4 +-- 4 files changed, 9 insertions(+), 41 deletions(-) delete mode 100644 compiler/frontend/src/org/jetbrains/jet/lang/diagnostics/AmbiguousDescriptorDiagnosticFactory.java diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/diagnostics/AmbiguousDescriptorDiagnosticFactory.java b/compiler/frontend/src/org/jetbrains/jet/lang/diagnostics/AmbiguousDescriptorDiagnosticFactory.java deleted file mode 100644 index 5c629c443f9..00000000000 --- a/compiler/frontend/src/org/jetbrains/jet/lang/diagnostics/AmbiguousDescriptorDiagnosticFactory.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2010-2013 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.jet.lang.diagnostics; - -import com.intellij.psi.PsiElement; -import org.jetbrains.jet.lang.descriptors.CallableDescriptor; -import org.jetbrains.jet.lang.resolve.calls.model.ResolvedCall; - -import java.util.Collection; - -public class AmbiguousDescriptorDiagnosticFactory extends DiagnosticFactory1>> { - public static AmbiguousDescriptorDiagnosticFactory create() { - return new AmbiguousDescriptorDiagnosticFactory(); - } - - public AmbiguousDescriptorDiagnosticFactory() { - super(Severity.ERROR, PositioningStrategies.DEFAULT); - } -} 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 1d1d144e9ea..ac20144934c 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/diagnostics/Errors.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/diagnostics/Errors.java @@ -332,9 +332,9 @@ public interface Errors { SimpleDiagnosticFactory CREATING_AN_INSTANCE_OF_ABSTRACT_CLASS = SimpleDiagnosticFactory.create(ERROR); SimpleDiagnosticFactory NOT_A_CLASS = SimpleDiagnosticFactory.create(ERROR); - AmbiguousDescriptorDiagnosticFactory OVERLOAD_RESOLUTION_AMBIGUITY = new AmbiguousDescriptorDiagnosticFactory(); - AmbiguousDescriptorDiagnosticFactory NONE_APPLICABLE = new AmbiguousDescriptorDiagnosticFactory(); - AmbiguousDescriptorDiagnosticFactory CANNOT_COMPLETE_RESOLVE = new AmbiguousDescriptorDiagnosticFactory(); + DiagnosticFactory1>> OVERLOAD_RESOLUTION_AMBIGUITY = DiagnosticFactory1.create(ERROR); + DiagnosticFactory1>> NONE_APPLICABLE = DiagnosticFactory1.create(ERROR); + DiagnosticFactory1>> CANNOT_COMPLETE_RESOLVE = DiagnosticFactory1.create(ERROR); SimpleDiagnosticFactory DANGLING_FUNCTION_LITERAL_ARGUMENT_SUSPECTED = SimpleDiagnosticFactory.create(WARNING); @@ -376,7 +376,8 @@ public interface Errors { SimpleDiagnosticFactory INC_DEC_SHOULD_NOT_RETURN_UNIT = SimpleDiagnosticFactory.create(ERROR); DiagnosticFactory2 ASSIGNMENT_OPERATOR_SHOULD_RETURN_UNIT = DiagnosticFactory2.create(ERROR); - AmbiguousDescriptorDiagnosticFactory ASSIGN_OPERATOR_AMBIGUITY = AmbiguousDescriptorDiagnosticFactory.create(); + DiagnosticFactory1>> + ASSIGN_OPERATOR_AMBIGUITY = DiagnosticFactory1.create(ERROR); SimpleDiagnosticFactory EQUALS_MISSING = SimpleDiagnosticFactory.create(ERROR); DiagnosticFactory3 EQUALITY_NOT_APPLICABLE = @@ -393,7 +394,7 @@ public interface Errors { DiagnosticFactory1 NEXT_NONE_APPLICABLE = DiagnosticFactory1.create(ERROR); SimpleDiagnosticFactory ITERATOR_MISSING = SimpleDiagnosticFactory.create(ERROR); - AmbiguousDescriptorDiagnosticFactory ITERATOR_AMBIGUITY = AmbiguousDescriptorDiagnosticFactory.create(); + DiagnosticFactory1>> ITERATOR_AMBIGUITY = DiagnosticFactory1.create(ERROR); DiagnosticFactory1 COMPARE_TO_TYPE_MISMATCH = DiagnosticFactory1.create(ERROR); diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/diagnostics/rendering/Renderers.java b/compiler/frontend/src/org/jetbrains/jet/lang/diagnostics/rendering/Renderers.java index 284bb4a9326..fd0ba9018a0 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/diagnostics/rendering/Renderers.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/diagnostics/rendering/Renderers.java @@ -99,7 +99,7 @@ public class Renderers { } }; - public static final Renderer>> AMBIGUOUS_CALLS = + public static final Renderer>> AMBIGUOUS_CALLS = new Renderer>>() { @NotNull @Override diff --git a/idea/src/org/jetbrains/jet/plugin/highlighter/IdeRenderers.java b/idea/src/org/jetbrains/jet/plugin/highlighter/IdeRenderers.java index bfd7c28eeba..385f09f429d 100644 --- a/idea/src/org/jetbrains/jet/plugin/highlighter/IdeRenderers.java +++ b/idea/src/org/jetbrains/jet/plugin/highlighter/IdeRenderers.java @@ -61,7 +61,7 @@ public class IdeRenderers { return String.format(error ? RED_TEMPLATE : STRONG_TEMPLATE, o); } - public static final Renderer>> HTML_AMBIGUOUS_CALLS = + public static final Renderer>> HTML_AMBIGUOUS_CALLS = new Renderer>>() { @NotNull @Override @@ -85,7 +85,7 @@ public class IdeRenderers { }; - public static class NoneApplicableCallsRenderer implements Renderer>> { + public static class NoneApplicableCallsRenderer implements Renderer>> { @Nullable private static ValueParameterDescriptor findParameterByArgumentExpression( ResolvedCall call,