From 11e4caaee3c0f8c0ec8f259afd16914b23dfdeef Mon Sep 17 00:00:00 2001 From: Evgeny Gerashchenko Date: Fri, 13 Apr 2012 14:34:53 +0400 Subject: [PATCH] Removed message formats and renderers passed to constructor parameters of DiagnosticFactoryWithMessageFormat and its subclasses. --- .../AmbiguousDescriptorDiagnosticFactory.java | 2 +- .../lang/diagnostics/DiagnosticFactory1.java | 22 +- .../lang/diagnostics/DiagnosticFactory2.java | 23 +- .../lang/diagnostics/DiagnosticFactory3.java | 22 +- .../DiagnosticFactoryWithMessageFormat.java | 2 +- .../jet/lang/diagnostics/Errors.java | 252 +++++++----------- .../UnusedElementDiagnosticFactory.java | 2 +- 7 files changed, 120 insertions(+), 205 deletions(-) diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/diagnostics/AmbiguousDescriptorDiagnosticFactory.java b/compiler/frontend/src/org/jetbrains/jet/lang/diagnostics/AmbiguousDescriptorDiagnosticFactory.java index 718cd1b4a87..06eecc981a9 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/diagnostics/AmbiguousDescriptorDiagnosticFactory.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/diagnostics/AmbiguousDescriptorDiagnosticFactory.java @@ -34,7 +34,7 @@ public class AmbiguousDescriptorDiagnosticFactory extends DiagnosticFactory1>> AMBIGUOUS_DESCRIPTOR_RENDERER = diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/diagnostics/DiagnosticFactory1.java b/compiler/frontend/src/org/jetbrains/jet/lang/diagnostics/DiagnosticFactory1.java index 4ac2abcdd3a..db3b08e5965 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/diagnostics/DiagnosticFactory1.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/diagnostics/DiagnosticFactory1.java @@ -18,8 +18,6 @@ package org.jetbrains.jet.lang.diagnostics; import com.intellij.psi.PsiElement; import org.jetbrains.annotations.NotNull; -import org.jetbrains.jet.lang.diagnostics.rendering.Renderer; -import org.jetbrains.jet.lang.diagnostics.rendering.Renderers; /** * @author svtk @@ -30,23 +28,15 @@ public class DiagnosticFactory1 extends DiagnosticFacto return new DiagnosticWithParameters1(element, argument, this, severity); } - protected DiagnosticFactory1(Severity severity, String message, PositioningStrategy positioningStrategy, Renderer renderer) { - super(severity, message, positioningStrategy); + protected DiagnosticFactory1(Severity severity, PositioningStrategy positioningStrategy) { + super(severity, positioningStrategy); } - public static DiagnosticFactory1 create(Severity severity, String message, PositioningStrategy positioningStrategy, Renderer renderer) { - return new DiagnosticFactory1(severity, message, positioningStrategy, renderer); + public static DiagnosticFactory1 create(Severity severity, PositioningStrategy positioningStrategy) { + return new DiagnosticFactory1(severity, positioningStrategy); } - public static DiagnosticFactory1 create(Severity severity, String message, PositioningStrategy positioningStrategy) { - return create(severity, message, positioningStrategy, Renderers.TO_STRING); - } - - public static DiagnosticFactory1 create(Severity severity, String message, Renderer renderer) { - return create(severity, message, PositioningStrategies.DEFAULT, renderer); - } - - public static DiagnosticFactory1 create(Severity severity, String message) { - return create(severity, message, PositioningStrategies.DEFAULT, Renderers.TO_STRING); + public static DiagnosticFactory1 create(Severity severity) { + return create(severity, PositioningStrategies.DEFAULT); } } \ No newline at end of file diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/diagnostics/DiagnosticFactory2.java b/compiler/frontend/src/org/jetbrains/jet/lang/diagnostics/DiagnosticFactory2.java index 48726a9c574..049b8824d38 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/diagnostics/DiagnosticFactory2.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/diagnostics/DiagnosticFactory2.java @@ -18,8 +18,6 @@ package org.jetbrains.jet.lang.diagnostics; import com.intellij.psi.PsiElement; import org.jetbrains.annotations.NotNull; -import org.jetbrains.jet.lang.diagnostics.rendering.Renderer; -import org.jetbrains.jet.lang.diagnostics.rendering.Renderers; /** * @author abreslav @@ -31,25 +29,16 @@ public class DiagnosticFactory2 extends DiagnosticFa return new DiagnosticWithParameters2(element, a, b, this, severity); } - - private DiagnosticFactory2(Severity severity, String message, PositioningStrategy positioningStrategy, Renderer rendererForA, Renderer rendererForB) { - super(severity, message, positioningStrategy); + private DiagnosticFactory2(Severity severity, PositioningStrategy positioningStrategy) { + super(severity, positioningStrategy); } - public static DiagnosticFactory2 create(Severity severity, String messageStub, PositioningStrategy positioningStrategy, Renderer rendererForA, Renderer rendererForB) { - return new DiagnosticFactory2(severity, messageStub, positioningStrategy, rendererForA, rendererForB); + public static DiagnosticFactory2 create(Severity severity, PositioningStrategy positioningStrategy) { + return new DiagnosticFactory2(severity, positioningStrategy); } - public static DiagnosticFactory2 create(Severity severity, String messageStub, PositioningStrategy positioningStrategy) { - return new DiagnosticFactory2(severity, messageStub, positioningStrategy, Renderers.TO_STRING, Renderers.TO_STRING); - } - - public static DiagnosticFactory2 create(Severity severity, String messageStub, Renderer rendererForA, Renderer rendererForB) { - return new DiagnosticFactory2(severity, messageStub, PositioningStrategies.DEFAULT, rendererForA, rendererForB); - } - - public static DiagnosticFactory2 create(Severity severity, String messageStub) { - return new DiagnosticFactory2(severity, messageStub, PositioningStrategies.DEFAULT, Renderers.TO_STRING, Renderers.TO_STRING); + public static DiagnosticFactory2 create(Severity severity) { + return new DiagnosticFactory2(severity, PositioningStrategies.DEFAULT); } } diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/diagnostics/DiagnosticFactory3.java b/compiler/frontend/src/org/jetbrains/jet/lang/diagnostics/DiagnosticFactory3.java index d38b9da9d42..678bb9b3dbf 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/diagnostics/DiagnosticFactory3.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/diagnostics/DiagnosticFactory3.java @@ -18,32 +18,22 @@ package org.jetbrains.jet.lang.diagnostics; import com.intellij.psi.PsiElement; import org.jetbrains.annotations.NotNull; -import org.jetbrains.jet.lang.diagnostics.rendering.Renderer; -import org.jetbrains.jet.lang.diagnostics.rendering.Renderers; /** * @author svtk */ public class DiagnosticFactory3 extends DiagnosticFactoryWithMessageFormat { - protected DiagnosticFactory3(Severity severity, String messageStub, PositioningStrategy positioningStrategy, Renderer rendererForA, Renderer rendererForB, Renderer rendererForC) { - super(severity, messageStub, positioningStrategy); + protected DiagnosticFactory3(Severity severity, PositioningStrategy positioningStrategy) { + super(severity, positioningStrategy); } - public static DiagnosticFactory3 create(Severity severity, String messageStub) { - return create(severity, messageStub, PositioningStrategies.DEFAULT); + public static DiagnosticFactory3 create(Severity severity) { + return create(severity, PositioningStrategies.DEFAULT); } - public static DiagnosticFactory3 create(Severity severity, String messageStub, PositioningStrategy positioningStrategy) { - return create(severity, messageStub, positioningStrategy, Renderers.TO_STRING, Renderers.TO_STRING, Renderers.TO_STRING); - } - - public static DiagnosticFactory3 create(Severity severity, String messageStub, Renderer rendererForA, Renderer rendererForB, Renderer rendererForC) { - return create(severity, messageStub, PositioningStrategies.DEFAULT, rendererForA, rendererForB, rendererForC); - } - - public static DiagnosticFactory3 create(Severity severity, String messageStub, PositioningStrategy positioningStrategy, Renderer rendererForA, Renderer rendererForB, Renderer rendererForC) { - return new DiagnosticFactory3(severity, messageStub, positioningStrategy, rendererForA, rendererForB, rendererForC); + public static DiagnosticFactory3 create(Severity severity, PositioningStrategy positioningStrategy) { + return new DiagnosticFactory3(severity, positioningStrategy); } @NotNull diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/diagnostics/DiagnosticFactoryWithMessageFormat.java b/compiler/frontend/src/org/jetbrains/jet/lang/diagnostics/DiagnosticFactoryWithMessageFormat.java index 95e64d22979..a04b6d59dce 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/diagnostics/DiagnosticFactoryWithMessageFormat.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/diagnostics/DiagnosticFactoryWithMessageFormat.java @@ -24,7 +24,7 @@ import java.text.MessageFormat; * @author abreslav */ public abstract class DiagnosticFactoryWithMessageFormat extends DiagnosticFactoryWithPsiElement { - protected DiagnosticFactoryWithMessageFormat(Severity severity, String message, PositioningStrategy positioningStrategy) { + protected DiagnosticFactoryWithMessageFormat(Severity severity, PositioningStrategy positioningStrategy) { super(severity, positioningStrategy); } } 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 f9bc2fde7bd..f382ed1fc54 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/diagnostics/Errors.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/diagnostics/Errors.java @@ -22,19 +22,16 @@ import com.intellij.psi.PsiNameIdentifierOwner; import com.intellij.psi.impl.source.tree.LeafPsiElement; import org.jetbrains.annotations.NotNull; import org.jetbrains.jet.lang.descriptors.*; -import org.jetbrains.jet.lang.diagnostics.rendering.Renderer; import org.jetbrains.jet.lang.psi.*; import org.jetbrains.jet.lang.resolve.calls.inference.SolutionStatus; import org.jetbrains.jet.lang.types.JetType; import org.jetbrains.jet.lexer.JetKeywordToken; import org.jetbrains.jet.lexer.JetTokens; -import org.jetbrains.jet.resolve.DescriptorRenderer; import java.lang.reflect.Field; import java.lang.reflect.Modifier; import java.util.Collection; import java.util.Collections; -import java.util.Iterator; import java.util.List; import static org.jetbrains.jet.lang.diagnostics.rendering.Renderers.*; @@ -46,45 +43,25 @@ import static org.jetbrains.jet.lang.diagnostics.Severity.WARNING; */ public interface Errors { - DiagnosticFactory1 EXCEPTION_WHILE_ANALYZING = DiagnosticFactory1.create(ERROR, "{0}", new Renderer() { - @NotNull - @Override - public String render(@NotNull Throwable e) { - return e.getClass().getSimpleName() + ": " + e.getMessage(); - } - }); + DiagnosticFactory1 EXCEPTION_WHILE_ANALYZING = DiagnosticFactory1.create(ERROR); UnresolvedReferenceDiagnosticFactory UNRESOLVED_REFERENCE = UnresolvedReferenceDiagnosticFactory.create("Unresolved reference"); //Elements with "INVISIBLE_REFERENCE" error are marked as unresolved, unlike elements with "INVISIBLE_MEMBER" error - DiagnosticFactory2 INVISIBLE_REFERENCE = DiagnosticFactory2.create(ERROR, "Cannot access ''{0}'' in ''{1}''", NAME, NAME); - DiagnosticFactory2 INVISIBLE_MEMBER = DiagnosticFactory2.create(ERROR, "Cannot access ''{0}'' in ''{1}''", NAME, NAME); + DiagnosticFactory2 INVISIBLE_REFERENCE = DiagnosticFactory2.create(ERROR); + DiagnosticFactory2 INVISIBLE_MEMBER = DiagnosticFactory2.create(ERROR); RedeclarationDiagnosticFactory REDECLARATION = RedeclarationDiagnosticFactory.REDECLARATION; RedeclarationDiagnosticFactory NAME_SHADOWING = RedeclarationDiagnosticFactory.NAME_SHADOWING; - DiagnosticFactory2 TYPE_MISMATCH = DiagnosticFactory2.create(ERROR, "Type mismatch: inferred type is {1} but {0} was expected", - RENDER_TYPE, RENDER_TYPE); + DiagnosticFactory2 TYPE_MISMATCH = DiagnosticFactory2.create(ERROR + ); DiagnosticFactory1> INCOMPATIBLE_MODIFIERS = - DiagnosticFactory1.create(ERROR, "Incompatible modifiers: ''{0}''", - new Renderer>() { - @NotNull - @Override - public String render(@NotNull Collection element) { - StringBuilder sb = new StringBuilder(); - for (Iterator iterator = element.iterator(); iterator.hasNext(); ) { - JetKeywordToken modifier = iterator.next(); - sb.append(modifier.getValue()); - if (iterator.hasNext()) { - sb.append(" "); - } - } - return sb.toString(); - } - }); - DiagnosticFactory1 ILLEGAL_MODIFIER = DiagnosticFactory1.create(ERROR, "Illegal modifier ''{0}''"); + DiagnosticFactory1.create(ERROR + ); + DiagnosticFactory1 ILLEGAL_MODIFIER = DiagnosticFactory1.create(ERROR); - DiagnosticFactory2 REDUNDANT_MODIFIER = DiagnosticFactory2.create(Severity.WARNING, "Modifier {0} is redundant because {1} is present"); + DiagnosticFactory2 REDUNDANT_MODIFIER = DiagnosticFactory2.create(Severity.WARNING); SimpleDiagnosticFactory ABSTRACT_MODIFIER_IN_TRAIT = SimpleDiagnosticFactory .create(WARNING, PositioningStrategies.POSITION_ABSTRACT_MODIFIER); SimpleDiagnosticFactory OPEN_MODIFIER_IN_TRAIT = SimpleDiagnosticFactory @@ -109,8 +86,8 @@ public interface Errors { SimpleDiagnosticFactory EXPRESSION_EXPECTED_NAMESPACE_FOUND = SimpleDiagnosticFactory.create(ERROR); - DiagnosticFactory1 CANNOT_IMPORT_FROM_ELEMENT = DiagnosticFactory1.create(ERROR, "Cannot import from ''{0}''", NAME); - DiagnosticFactory1 CANNOT_BE_IMPORTED = DiagnosticFactory1.create(ERROR, "Cannot import ''{0}'', functions and properties can be imported only from packages", NAME); + DiagnosticFactory1 CANNOT_IMPORT_FROM_ELEMENT = DiagnosticFactory1.create(ERROR); + DiagnosticFactory1 CANNOT_BE_IMPORTED = DiagnosticFactory1.create(ERROR); SimpleDiagnosticFactory USELESS_HIDDEN_IMPORT = SimpleDiagnosticFactory.create(WARNING); SimpleDiagnosticFactory USELESS_SIMPLE_IMPORT = SimpleDiagnosticFactory.create(WARNING); @@ -169,13 +146,19 @@ public interface Errors { PROPERTY_INITIALIZER_IN_TRAIT = SimpleDiagnosticFactory.create(ERROR); SimpleDiagnosticFactory PROPERTY_INITIALIZER_NO_BACKING_FIELD = SimpleDiagnosticFactory .create(ERROR); - DiagnosticFactory3 ABSTRACT_PROPERTY_IN_NON_ABSTRACT_CLASS = DiagnosticFactory3.create(ERROR, "Abstract property {0} in non-abstract class {1}", PositioningStrategies.POSITION_ABSTRACT_MODIFIER); - DiagnosticFactory3 ABSTRACT_FUNCTION_IN_NON_ABSTRACT_CLASS = DiagnosticFactory3.create(ERROR, "Abstract function {0} in non-abstract class {1}", PositioningStrategies.POSITION_ABSTRACT_MODIFIER); - DiagnosticFactory1 ABSTRACT_FUNCTION_WITH_BODY = DiagnosticFactory1.create(ERROR, "A function {0} with body cannot be abstract", PositioningStrategies.POSITION_ABSTRACT_MODIFIER); - DiagnosticFactory1 NON_ABSTRACT_FUNCTION_WITH_NO_BODY = DiagnosticFactory1.create(ERROR, "Method {0} without a body must be abstract", PositioningStrategies.POSITION_NAME_IDENTIFIER); - DiagnosticFactory1 NON_MEMBER_ABSTRACT_FUNCTION = DiagnosticFactory1.create(ERROR, "Function {0} is not a class or trait member and cannot be abstract", PositioningStrategies.POSITION_ABSTRACT_MODIFIER); + DiagnosticFactory3 ABSTRACT_PROPERTY_IN_NON_ABSTRACT_CLASS = DiagnosticFactory3.create(ERROR, + PositioningStrategies.POSITION_ABSTRACT_MODIFIER); + DiagnosticFactory3 ABSTRACT_FUNCTION_IN_NON_ABSTRACT_CLASS = DiagnosticFactory3.create(ERROR, + PositioningStrategies.POSITION_ABSTRACT_MODIFIER); + DiagnosticFactory1 ABSTRACT_FUNCTION_WITH_BODY = DiagnosticFactory1.create(ERROR, + PositioningStrategies.POSITION_ABSTRACT_MODIFIER); + DiagnosticFactory1 NON_ABSTRACT_FUNCTION_WITH_NO_BODY = DiagnosticFactory1.create(ERROR, + PositioningStrategies.POSITION_NAME_IDENTIFIER); + DiagnosticFactory1 NON_MEMBER_ABSTRACT_FUNCTION = DiagnosticFactory1.create(ERROR, + PositioningStrategies.POSITION_ABSTRACT_MODIFIER); - DiagnosticFactory1 NON_MEMBER_FUNCTION_NO_BODY = DiagnosticFactory1.create(ERROR, "Function {0} must have a body", PositioningStrategies.POSITION_NAME_IDENTIFIER); + DiagnosticFactory1 NON_MEMBER_FUNCTION_NO_BODY = DiagnosticFactory1.create(ERROR, + PositioningStrategies.POSITION_NAME_IDENTIFIER); SimpleDiagnosticFactory NON_FINAL_MEMBER_IN_FINAL_CLASS = SimpleDiagnosticFactory .create(ERROR, PositioningStrategies.positionModifier(JetTokens.OPEN_KEYWORD)); @@ -198,32 +181,34 @@ public interface Errors { INITIALIZER_WITH_NO_ARGUMENTS = SimpleDiagnosticFactory.create(ERROR); SimpleDiagnosticFactory MANY_CALLS_TO_THIS = SimpleDiagnosticFactory.create(ERROR); - DiagnosticFactory1 NOTHING_TO_OVERRIDE = DiagnosticFactory1.create(ERROR, "{0} overrides nothing", PositioningStrategies.positionModifier(JetTokens.OVERRIDE_KEYWORD), DescriptorRenderer.TEXT); - DiagnosticFactory3 VIRTUAL_MEMBER_HIDDEN = DiagnosticFactory3.create(ERROR, "''{0}'' hides ''{1}'' in class {2} and needs 'override' modifier", PositioningStrategies.POSITION_NAME_IDENTIFIER, DescriptorRenderer.TEXT, DescriptorRenderer.TEXT, DescriptorRenderer.TEXT); + DiagnosticFactory1 NOTHING_TO_OVERRIDE = DiagnosticFactory1.create(ERROR, + PositioningStrategies.positionModifier(JetTokens.OVERRIDE_KEYWORD)); + DiagnosticFactory3 VIRTUAL_MEMBER_HIDDEN = DiagnosticFactory3.create(ERROR, + PositioningStrategies.POSITION_NAME_IDENTIFIER); - DiagnosticFactory1 ENUM_ENTRY_SHOULD_BE_INITIALIZED = DiagnosticFactory1.create(ERROR, "Missing delegation specifier ''{0}''", PositioningStrategies.POSITION_NAME_IDENTIFIER, NAME); - DiagnosticFactory1 ENUM_ENTRY_ILLEGAL_TYPE = DiagnosticFactory1.create(ERROR, "The type constructor of enum entry should be ''{0}''", NAME); + DiagnosticFactory1 ENUM_ENTRY_SHOULD_BE_INITIALIZED = DiagnosticFactory1.create(ERROR, PositioningStrategies.POSITION_NAME_IDENTIFIER); + DiagnosticFactory1 ENUM_ENTRY_ILLEGAL_TYPE = DiagnosticFactory1.create(ERROR); - DiagnosticFactory1 UNINITIALIZED_VARIABLE = DiagnosticFactory1.create(ERROR, "Variable ''{0}'' must be initialized", NAME); - DiagnosticFactory1 UNINITIALIZED_PARAMETER = DiagnosticFactory1.create(ERROR, "Parameter ''{0}'' is uninitialized here", NAME); + DiagnosticFactory1 UNINITIALIZED_VARIABLE = DiagnosticFactory1.create(ERROR); + DiagnosticFactory1 UNINITIALIZED_PARAMETER = DiagnosticFactory1.create(ERROR); UnusedElementDiagnosticFactory UNUSED_VARIABLE = UnusedElementDiagnosticFactory.create(WARNING, "Variable ''{0}'' is never used", PositioningStrategies.POSITION_NAME_IDENTIFIER, NAME); UnusedElementDiagnosticFactory UNUSED_PARAMETER = UnusedElementDiagnosticFactory.create(WARNING, "Parameter ''{0}'' is never used", PositioningStrategies.POSITION_NAME_IDENTIFIER, NAME); UnusedElementDiagnosticFactory ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE = UnusedElementDiagnosticFactory.create(WARNING, "Variable ''{0}'' is assigned but never accessed", PositioningStrategies.POSITION_NAME_IDENTIFIER, NAME); - DiagnosticFactory1 VARIABLE_WITH_REDUNDANT_INITIALIZER = DiagnosticFactory1.create(WARNING, "Variable ''{0}'' initializer is redundant", NAME); - DiagnosticFactory2 UNUSED_VALUE = DiagnosticFactory2.create(WARNING, "The value ''{0}'' assigned to ''{1}'' is never used", ELEMENT_TEXT, TO_STRING); - DiagnosticFactory1 UNUSED_CHANGED_VALUE = DiagnosticFactory1.create(WARNING, "The value changed at ''{0}'' is never used", ELEMENT_TEXT); + DiagnosticFactory1 VARIABLE_WITH_REDUNDANT_INITIALIZER = DiagnosticFactory1.create(WARNING); + DiagnosticFactory2 UNUSED_VALUE = DiagnosticFactory2.create(WARNING); + DiagnosticFactory1 UNUSED_CHANGED_VALUE = DiagnosticFactory1.create(WARNING); SimpleDiagnosticFactory UNUSED_EXPRESSION = SimpleDiagnosticFactory.create(WARNING); SimpleDiagnosticFactory UNUSED_FUNCTION_LITERAL = SimpleDiagnosticFactory .create(WARNING); - DiagnosticFactory1 VAL_REASSIGNMENT = DiagnosticFactory1.create(ERROR, "Val can not be reassigned", NAME); - DiagnosticFactory1 INITIALIZATION_BEFORE_DECLARATION = DiagnosticFactory1.create(ERROR, "Variable cannot be initialized before declaration", NAME); + DiagnosticFactory1 VAL_REASSIGNMENT = DiagnosticFactory1.create(ERROR); + DiagnosticFactory1 INITIALIZATION_BEFORE_DECLARATION = DiagnosticFactory1.create(ERROR); SimpleDiagnosticFactory VARIABLE_EXPECTED = SimpleDiagnosticFactory.create(ERROR); - DiagnosticFactory1 INITIALIZATION_USING_BACKING_FIELD_CUSTOM_SETTER = DiagnosticFactory1.create(ERROR, "This property has a custom setter, so initialization using backing field required", NAME); - DiagnosticFactory1 INITIALIZATION_USING_BACKING_FIELD_OPEN_SETTER = DiagnosticFactory1.create(ERROR, "Setter of this property can be overridden, so initialization using backing field required", NAME); + DiagnosticFactory1 INITIALIZATION_USING_BACKING_FIELD_CUSTOM_SETTER = DiagnosticFactory1.create(ERROR); + DiagnosticFactory1 INITIALIZATION_USING_BACKING_FIELD_OPEN_SETTER = DiagnosticFactory1.create(ERROR); - DiagnosticFactory1 FUNCTION_PARAMETERS_OF_INLINE_FUNCTION = DiagnosticFactory1.create(ERROR, "Function parameters of inline function can only be invoked", NAME); + DiagnosticFactory1 FUNCTION_PARAMETERS_OF_INLINE_FUNCTION = DiagnosticFactory1.create(ERROR); SimpleDiagnosticFactory UNREACHABLE_CODE = SimpleDiagnosticFactory.create(ERROR); @@ -257,7 +242,7 @@ public interface Errors { SimpleDiagnosticFactory INC_DEC_SHOULD_NOT_RETURN_UNIT = SimpleDiagnosticFactory .create(ERROR); DiagnosticFactory2 ASSIGNMENT_OPERATOR_SHOULD_RETURN_UNIT = - DiagnosticFactory2.create(ERROR, "Function ''{0}'' should return Unit to be used by corresponding operator ''{1}''", NAME, ELEMENT_TEXT); + DiagnosticFactory2.create(ERROR); AmbiguousDescriptorDiagnosticFactory ASSIGN_OPERATOR_AMBIGUITY = AmbiguousDescriptorDiagnosticFactory.create("Assignment operators ambiguity: {0}"); SimpleDiagnosticFactory @@ -266,7 +251,7 @@ public interface Errors { .create(ERROR); SimpleDiagnosticFactory NAMESPACE_IS_NOT_AN_EXPRESSION = SimpleDiagnosticFactory .create(ERROR); - DiagnosticFactory1 SUPER_IS_NOT_AN_EXPRESSION = DiagnosticFactory1.create(ERROR, "{0} is not an expression, it can only be used on the left-hand side of a dot ('.')"); + DiagnosticFactory1 SUPER_IS_NOT_AN_EXPRESSION = DiagnosticFactory1.create(ERROR); SimpleDiagnosticFactory DECLARATION_IN_ILLEGAL_CONTEXT = SimpleDiagnosticFactory.create(ERROR); SimpleDiagnosticFactory @@ -286,9 +271,9 @@ public interface Errors { SimpleDiagnosticFactory USELESS_CAST = SimpleDiagnosticFactory.create(WARNING); SimpleDiagnosticFactory CAST_NEVER_SUCCEEDS = SimpleDiagnosticFactory.create(WARNING); - DiagnosticFactory1 WRONG_SETTER_PARAMETER_TYPE = DiagnosticFactory1.create(ERROR, "Setter parameter type must be equal to the type of the property, i.e. {0}", RENDER_TYPE);//, DiagnosticParameters.TYPE); - DiagnosticFactory1 WRONG_GETTER_RETURN_TYPE = DiagnosticFactory1.create(ERROR, "Getter return type must be equal to the type of the property, i.e. {0}", RENDER_TYPE);//, DiagnosticParameters.TYPE); - DiagnosticFactory1 NO_CLASS_OBJECT = DiagnosticFactory1.create(ERROR, "Please specify constructor invocation; classifier {0} does not have a class object", NAME); + DiagnosticFactory1 WRONG_SETTER_PARAMETER_TYPE = DiagnosticFactory1.create(ERROR);//, DiagnosticParameters.TYPE); + DiagnosticFactory1 WRONG_GETTER_RETURN_TYPE = DiagnosticFactory1.create(ERROR);//, DiagnosticParameters.TYPE); + DiagnosticFactory1 NO_CLASS_OBJECT = DiagnosticFactory1.create(ERROR); SimpleDiagnosticFactory NO_GENERICS_IN_SUPERTYPE_SPECIFIER = SimpleDiagnosticFactory .create(ERROR); @@ -300,8 +285,8 @@ public interface Errors { .create(ERROR); SimpleDiagnosticFactory HAS_NEXT_MUST_BE_READABLE = SimpleDiagnosticFactory .create(ERROR); - DiagnosticFactory1 HAS_NEXT_PROPERTY_TYPE_MISMATCH = DiagnosticFactory1.create(ERROR, "The 'iterator().hasNext' property of the loop range must return Boolean, but returns {0}", RENDER_TYPE); - DiagnosticFactory1 HAS_NEXT_FUNCTION_TYPE_MISMATCH = DiagnosticFactory1.create(ERROR, "The 'iterator().hasNext()' function of the loop range must return Boolean, but returns {0}", RENDER_TYPE); + DiagnosticFactory1 HAS_NEXT_PROPERTY_TYPE_MISMATCH = DiagnosticFactory1.create(ERROR); + DiagnosticFactory1 HAS_NEXT_FUNCTION_TYPE_MISMATCH = DiagnosticFactory1.create(ERROR); SimpleDiagnosticFactory NEXT_AMBIGUITY = SimpleDiagnosticFactory.create(ERROR); SimpleDiagnosticFactory @@ -310,8 +295,8 @@ public interface Errors { ITERATOR_MISSING = SimpleDiagnosticFactory.create(ERROR); AmbiguousDescriptorDiagnosticFactory ITERATOR_AMBIGUITY = AmbiguousDescriptorDiagnosticFactory.create("Method 'iterator()' is ambiguous for this expression: {0}"); - DiagnosticFactory1 COMPARE_TO_TYPE_MISMATCH = DiagnosticFactory1.create(ERROR, "compareTo() must return Int, but returns {0}", RENDER_TYPE); - DiagnosticFactory1 CALLEE_NOT_A_FUNCTION = DiagnosticFactory1.create(ERROR, "Expecting a function type, but found {0}", RENDER_TYPE); + DiagnosticFactory1 COMPARE_TO_TYPE_MISMATCH = DiagnosticFactory1.create(ERROR); + DiagnosticFactory1 CALLEE_NOT_A_FUNCTION = DiagnosticFactory1.create(ERROR); SimpleDiagnosticFactory RETURN_IN_FUNCTION_WITH_EXPRESSION_BODY = SimpleDiagnosticFactory .create(ERROR); @@ -329,28 +314,21 @@ public interface Errors { return markRange(lastBracketRange); } }); - DiagnosticFactory1 RETURN_TYPE_MISMATCH = DiagnosticFactory1.create(ERROR, "This function must return a value of type {0}", RENDER_TYPE); - DiagnosticFactory1 EXPECTED_TYPE_MISMATCH = DiagnosticFactory1.create(ERROR, "Expected a value of type {0}", RENDER_TYPE); - DiagnosticFactory1 ASSIGNMENT_TYPE_MISMATCH = DiagnosticFactory1.create(ERROR, "Expected a value of type {0}. Assignment operation is not an expression, so it does not return any value", RENDER_TYPE); - DiagnosticFactory1 IMPLICIT_CAST_TO_UNIT_OR_ANY = DiagnosticFactory1.create(WARNING, "Type was casted to ''{0}''. Please specify ''{0}'' as expected type, if you mean such cast", RENDER_TYPE); - DiagnosticFactory1 EXPRESSION_EXPECTED = DiagnosticFactory1.create(ERROR, "{0} is not an expression, and only expression are allowed here", new Renderer() { - @NotNull - @Override - public String render(@NotNull JetExpression expression) { - String expressionType = expression.toString(); - return expressionType.substring(0, 1) + expressionType.substring(1).toLowerCase(); - } - }); + DiagnosticFactory1 RETURN_TYPE_MISMATCH = DiagnosticFactory1.create(ERROR); + DiagnosticFactory1 EXPECTED_TYPE_MISMATCH = DiagnosticFactory1.create(ERROR); + DiagnosticFactory1 ASSIGNMENT_TYPE_MISMATCH = DiagnosticFactory1.create(ERROR); + DiagnosticFactory1 IMPLICIT_CAST_TO_UNIT_OR_ANY = DiagnosticFactory1.create(WARNING); + DiagnosticFactory1 EXPRESSION_EXPECTED = DiagnosticFactory1.create(ERROR); - DiagnosticFactory1 UPPER_BOUND_VIOLATED = DiagnosticFactory1.create(ERROR, "An upper bound {0} is violated", RENDER_TYPE); // TODO : Message - DiagnosticFactory1 FINAL_CLASS_OBJECT_UPPER_BOUND = DiagnosticFactory1.create(ERROR, "{0} is a final type, and thus a class object cannot extend it", RENDER_TYPE); - DiagnosticFactory1 FINAL_UPPER_BOUND = DiagnosticFactory1.create(WARNING, "{0} is a final type, and thus a value of the type parameter is predetermined", RENDER_TYPE); - DiagnosticFactory1 USELESS_ELVIS = DiagnosticFactory1.create(WARNING, "Elvis operator (?:) always returns the left operand of non-nullable type {0}", RENDER_TYPE); - DiagnosticFactory1 CONFLICTING_UPPER_BOUNDS = DiagnosticFactory1.create(ERROR, "Upper bounds of {0} have empty intersection", NAME); - DiagnosticFactory1 CONFLICTING_CLASS_OBJECT_UPPER_BOUNDS = DiagnosticFactory1.create(ERROR, "Class object upper bounds of {0} have empty intersection", NAME); + DiagnosticFactory1 UPPER_BOUND_VIOLATED = DiagnosticFactory1.create(ERROR); // TODO : Message + DiagnosticFactory1 FINAL_CLASS_OBJECT_UPPER_BOUND = DiagnosticFactory1.create(ERROR); + DiagnosticFactory1 FINAL_UPPER_BOUND = DiagnosticFactory1.create(WARNING); + DiagnosticFactory1 USELESS_ELVIS = DiagnosticFactory1.create(WARNING); + DiagnosticFactory1 CONFLICTING_UPPER_BOUNDS = DiagnosticFactory1.create(ERROR); + DiagnosticFactory1 CONFLICTING_CLASS_OBJECT_UPPER_BOUNDS = DiagnosticFactory1.create(ERROR); - DiagnosticFactory1 TOO_MANY_ARGUMENTS = DiagnosticFactory1.create(ERROR, "Too many arguments for {0}"); - DiagnosticFactory1 ERROR_COMPILE_TIME_VALUE = DiagnosticFactory1.create(ERROR, "{0}"); + DiagnosticFactory1 TOO_MANY_ARGUMENTS = DiagnosticFactory1.create(ERROR); + DiagnosticFactory1 ERROR_COMPILE_TIME_VALUE = DiagnosticFactory1.create(ERROR); SimpleDiagnosticFactory ELSE_MISPLACED_IN_WHEN = SimpleDiagnosticFactory.create( ERROR, new PositioningStrategy() { @@ -396,14 +374,14 @@ public interface Errors { SimpleDiagnosticFactory FINAL_SUPERTYPE = SimpleDiagnosticFactory.create(ERROR); - DiagnosticFactory1 ILLEGAL_SELECTOR = DiagnosticFactory1.create(ERROR, "Expression ''{0}'' cannot be a selector (occur after a dot)"); + DiagnosticFactory1 ILLEGAL_SELECTOR = DiagnosticFactory1.create(ERROR); SimpleDiagnosticFactory VALUE_PARAMETER_WITH_NO_TYPE_ANNOTATION = SimpleDiagnosticFactory .create(ERROR); SimpleDiagnosticFactory BREAK_OR_CONTINUE_OUTSIDE_A_LOOP = SimpleDiagnosticFactory .create(ERROR); - DiagnosticFactory1 NOT_A_LOOP_LABEL = DiagnosticFactory1.create(ERROR, "The label ''{0}'' does not denote a loop"); - DiagnosticFactory1 NOT_A_RETURN_LABEL = DiagnosticFactory1.create(ERROR, "The label ''{0}'' does not reference to a context from which we can return"); + DiagnosticFactory1 NOT_A_LOOP_LABEL = DiagnosticFactory1.create(ERROR); + DiagnosticFactory1 NOT_A_RETURN_LABEL = DiagnosticFactory1.create(ERROR); SimpleDiagnosticFactory ANONYMOUS_INITIALIZER_WITHOUT_CONSTRUCTOR = SimpleDiagnosticFactory .create(ERROR); @@ -415,78 +393,52 @@ public interface Errors { return markNode(element.getQuestionMarkNode()); } }); - DiagnosticFactory1 UNSAFE_CALL = DiagnosticFactory1.create(ERROR, "Only safe calls (?.) are allowed on a nullable receiver of type {0}", RENDER_TYPE); + DiagnosticFactory1 UNSAFE_CALL = DiagnosticFactory1.create(ERROR); SimpleDiagnosticFactory AMBIGUOUS_LABEL = SimpleDiagnosticFactory.create(ERROR); - DiagnosticFactory1 UNSUPPORTED = DiagnosticFactory1.create(ERROR, "Unsupported [{0}]"); - DiagnosticFactory1 UNNECESSARY_SAFE_CALL = DiagnosticFactory1.create(WARNING, "Unnecessary safe call on a non-null receiver of type {0}", RENDER_TYPE); - DiagnosticFactory1 UNNECESSARY_NOT_NULL_ASSERTION = DiagnosticFactory1.create(WARNING, "Unnecessary non-null assertion (!!) on a non-null receiver of type {0}", RENDER_TYPE); - DiagnosticFactory2 NAME_IN_CONSTRAINT_IS_NOT_A_TYPE_PARAMETER = DiagnosticFactory2.create(ERROR, "{0} does not refer to a type parameter of {1}", new Renderer() { - @NotNull - @Override - public String render(@NotNull JetTypeConstraint typeConstraint) { - //noinspection ConstantConditions - return typeConstraint.getSubjectTypeParameterName().getReferencedName(); - } - }, NAME); - DiagnosticFactory2 AUTOCAST_IMPOSSIBLE = DiagnosticFactory2.create(ERROR, "Automatic cast to {0} is impossible, because {1} could have changed since the is-check", RENDER_TYPE, NAME); + DiagnosticFactory1 UNSUPPORTED = DiagnosticFactory1.create(ERROR); + DiagnosticFactory1 UNNECESSARY_SAFE_CALL = DiagnosticFactory1.create(WARNING); + DiagnosticFactory1 UNNECESSARY_NOT_NULL_ASSERTION = DiagnosticFactory1.create(WARNING); + DiagnosticFactory2 NAME_IN_CONSTRAINT_IS_NOT_A_TYPE_PARAMETER = DiagnosticFactory2.create(ERROR); + DiagnosticFactory2 AUTOCAST_IMPOSSIBLE = DiagnosticFactory2.create(ERROR); - DiagnosticFactory2 TYPE_MISMATCH_IN_FOR_LOOP = DiagnosticFactory2.create(ERROR, "The loop iterates over values of type {0} but the parameter is declared to be {1}", RENDER_TYPE, RENDER_TYPE); - DiagnosticFactory1 TYPE_MISMATCH_IN_CONDITION = DiagnosticFactory1.create(ERROR, "Condition must be of type Boolean, but was of type {0}", RENDER_TYPE); - DiagnosticFactory2 TYPE_MISMATCH_IN_TUPLE_PATTERN = DiagnosticFactory2.create(ERROR, "Type mismatch: subject is of type {0} but the pattern is of type Tuple{1}", RENDER_TYPE, TO_STRING); // TODO: message - DiagnosticFactory2 TYPE_MISMATCH_IN_BINDING_PATTERN = DiagnosticFactory2.create(ERROR, "{0} must be a supertype of {1}. Use 'is' to match against {0}", RENDER_TYPE, RENDER_TYPE); - DiagnosticFactory2 INCOMPATIBLE_TYPES = DiagnosticFactory2.create(ERROR, "Incompatible types: {0} and {1}", RENDER_TYPE, RENDER_TYPE); + DiagnosticFactory2 TYPE_MISMATCH_IN_FOR_LOOP = DiagnosticFactory2.create(ERROR); + DiagnosticFactory1 TYPE_MISMATCH_IN_CONDITION = DiagnosticFactory1.create(ERROR); + DiagnosticFactory2 TYPE_MISMATCH_IN_TUPLE_PATTERN = DiagnosticFactory2.create(ERROR); // TODO: message + DiagnosticFactory2 TYPE_MISMATCH_IN_BINDING_PATTERN = DiagnosticFactory2.create(ERROR); + DiagnosticFactory2 INCOMPATIBLE_TYPES = DiagnosticFactory2.create(ERROR); SimpleDiagnosticFactory EXPECTED_CONDITION = SimpleDiagnosticFactory.create(ERROR); - DiagnosticFactory1 CANNOT_CHECK_FOR_ERASED = DiagnosticFactory1.create(ERROR, "Cannot check for instance of erased type: {0}", RENDER_TYPE); - DiagnosticFactory2 UNCHECKED_CAST = DiagnosticFactory2.create(WARNING, "Unchecked cast: {0} to {1}", RENDER_TYPE, RENDER_TYPE); + DiagnosticFactory1 CANNOT_CHECK_FOR_ERASED = DiagnosticFactory1.create(ERROR); + DiagnosticFactory2 UNCHECKED_CAST = DiagnosticFactory2.create(WARNING); DiagnosticFactory3> INCONSISTENT_TYPE_PARAMETER_VALUES = - DiagnosticFactory3.create(ERROR, "Type parameter {0} of {1} has inconsistent values: {2}", NAME, DescriptorRenderer.TEXT, new Renderer>() { - @NotNull - @Override - public String render(@NotNull Collection types) { - StringBuilder builder = new StringBuilder(); - for (Iterator iterator = types.iterator(); iterator.hasNext(); ) { - JetType jetType = iterator.next(); - builder.append(jetType); - if (iterator.hasNext()) { - builder.append(", "); - } - } - return builder.toString(); - } - }); + DiagnosticFactory3.create(ERROR); - DiagnosticFactory3 EQUALITY_NOT_APPLICABLE = DiagnosticFactory3.create(ERROR, "Operator {0} cannot be applied to {1} and {2}", new Renderer() { - @NotNull - @Override - public String render(@NotNull JetSimpleNameExpression nameExpression) { - //noinspection ConstantConditions - return nameExpression.getReferencedName(); - } - }, TO_STRING, TO_STRING); + DiagnosticFactory3 EQUALITY_NOT_APPLICABLE = DiagnosticFactory3.create(ERROR); - DiagnosticFactory2 OVERRIDING_FINAL_MEMBER = DiagnosticFactory2.create(ERROR, "''{0}'' in ''{1}'' is final and cannot be overridden", NAME, NAME); - DiagnosticFactory3 CANNOT_WEAKEN_ACCESS_PRIVILEGE = DiagnosticFactory3.create(ERROR, "Cannot weaken access privilege ''{0}'' for ''{1}'' in ''{2}''", PositioningStrategies.POSITION_VISIBILITY_MODIFIER, TO_STRING, NAME, NAME); - DiagnosticFactory3 CANNOT_CHANGE_ACCESS_PRIVILEGE = DiagnosticFactory3.create(ERROR, "Cannot change access privilege ''{0}'' for ''{1}'' in ''{2}''", PositioningStrategies.POSITION_VISIBILITY_MODIFIER, TO_STRING, NAME, NAME); + DiagnosticFactory2 OVERRIDING_FINAL_MEMBER = DiagnosticFactory2.create(ERROR); + DiagnosticFactory3 CANNOT_WEAKEN_ACCESS_PRIVILEGE = DiagnosticFactory3.create(ERROR, + PositioningStrategies.POSITION_VISIBILITY_MODIFIER); + DiagnosticFactory3 CANNOT_CHANGE_ACCESS_PRIVILEGE = DiagnosticFactory3.create(ERROR, + PositioningStrategies.POSITION_VISIBILITY_MODIFIER); DiagnosticFactory2 RETURN_TYPE_MISMATCH_ON_OVERRIDE = - DiagnosticFactory2.create(ERROR, "Return type of {0} is not a subtype of the return type overridden member {1}", PositioningStrategies.POSITION_DECLARATION, DescriptorRenderer.TEXT, DescriptorRenderer.TEXT); + DiagnosticFactory2.create(ERROR, PositioningStrategies.POSITION_DECLARATION); - DiagnosticFactory2 VAR_OVERRIDDEN_BY_VAL = DiagnosticFactory2.create(ERROR, "Var-property {0} cannot be overridden by val-property {1}", new PositioningStrategy() { + DiagnosticFactory2 VAR_OVERRIDDEN_BY_VAL = DiagnosticFactory2.create(ERROR, new PositioningStrategy() { @NotNull @Override public List mark(@NotNull JetProperty property) { return markNode(property.getValOrVarNode()); } - }, DescriptorRenderer.TEXT, DescriptorRenderer.TEXT); + }); - DiagnosticFactory2 ABSTRACT_MEMBER_NOT_IMPLEMENTED = DiagnosticFactory2.create(ERROR, "{0} must be declared abstract or implement abstract member {1}", RENDER_CLASS_OR_OBJECT, DescriptorRenderer.TEXT); + DiagnosticFactory2 ABSTRACT_MEMBER_NOT_IMPLEMENTED = DiagnosticFactory2.create(ERROR); - DiagnosticFactory2 MANY_IMPL_MEMBER_NOT_IMPLEMENTED = DiagnosticFactory2.create(ERROR, "{0} must override {1} because it inherits many implementations of it", RENDER_CLASS_OR_OBJECT, DescriptorRenderer.TEXT); + DiagnosticFactory2 MANY_IMPL_MEMBER_NOT_IMPLEMENTED = DiagnosticFactory2.create(ERROR); - DiagnosticFactory2 CONFLICTING_OVERLOADS = DiagnosticFactory2.create(ERROR, "{1} is already defined in ''{0}''", new PositioningStrategy() { + DiagnosticFactory2 CONFLICTING_OVERLOADS = DiagnosticFactory2.create(ERROR, new PositioningStrategy() { @NotNull @Override public List mark(@NotNull JetDeclaration jetDeclaration) { @@ -518,36 +470,30 @@ public interface Errors { return markRange(jetDeclaration.getTextRange()); } } - }, DescriptorRenderer.TEXT, TO_STRING); + }); - DiagnosticFactory3 RESULT_TYPE_MISMATCH = DiagnosticFactory3.create(ERROR, "{0} must return {1} but returns {2}", TO_STRING, RENDER_TYPE, RENDER_TYPE); - DiagnosticFactory3 UNSAFE_INFIX_CALL = DiagnosticFactory3.create(ERROR, "Infix call corresponds to a dot-qualified call ''{0}.{1}({2})'' which is not allowed on a nullable receiver ''{0}''. Use '?.'-qualified call instead"); + DiagnosticFactory3 RESULT_TYPE_MISMATCH = DiagnosticFactory3.create(ERROR); + DiagnosticFactory3 UNSAFE_INFIX_CALL = DiagnosticFactory3.create(ERROR); AmbiguousDescriptorDiagnosticFactory OVERLOAD_RESOLUTION_AMBIGUITY = new AmbiguousDescriptorDiagnosticFactory("Overload resolution ambiguity: {0}"); AmbiguousDescriptorDiagnosticFactory NONE_APPLICABLE = new AmbiguousDescriptorDiagnosticFactory("None of the following functions can be called with the arguments supplied: {0}"); - DiagnosticFactory1 NO_VALUE_FOR_PARAMETER = DiagnosticFactory1.create(ERROR, "No value passed for parameter {0}", DescriptorRenderer.TEXT); - DiagnosticFactory1 MISSING_RECEIVER = DiagnosticFactory1.create(ERROR, "A receiver of type {0} is required", RENDER_TYPE); + DiagnosticFactory1 NO_VALUE_FOR_PARAMETER = DiagnosticFactory1.create(ERROR); + DiagnosticFactory1 MISSING_RECEIVER = DiagnosticFactory1.create(ERROR); SimpleDiagnosticFactory NO_RECEIVER_ADMITTED = SimpleDiagnosticFactory.create(ERROR); SimpleDiagnosticFactory CREATING_AN_INSTANCE_OF_ABSTRACT_CLASS = SimpleDiagnosticFactory .create(ERROR); - DiagnosticFactory1 TYPE_INFERENCE_FAILED = DiagnosticFactory1.create(ERROR, "Type inference failed: {0}"); - DiagnosticFactory1 WRONG_NUMBER_OF_TYPE_ARGUMENTS = DiagnosticFactory1.create(ERROR, "{0} type arguments expected", new Renderer() { - @NotNull - @Override - public String render(@NotNull Integer argument) { - return argument == 0 ? "No" : argument.toString(); - } - }); + DiagnosticFactory1 TYPE_INFERENCE_FAILED = DiagnosticFactory1.create(ERROR); + DiagnosticFactory1 WRONG_NUMBER_OF_TYPE_ARGUMENTS = DiagnosticFactory1.create(ERROR); - DiagnosticFactory1 UNRESOLVED_IDE_TEMPLATE = DiagnosticFactory1.create(ERROR, "Unresolved IDE template: {0}"); + DiagnosticFactory1 UNRESOLVED_IDE_TEMPLATE = DiagnosticFactory1.create(ERROR); SimpleDiagnosticFactory DANGLING_FUNCTION_LITERAL_ARGUMENT_SUSPECTED = SimpleDiagnosticFactory .create(WARNING); - DiagnosticFactory1 NOT_AN_ANNOTATION_CLASS = DiagnosticFactory1.create(ERROR, "{0} is not an annotation class"); + DiagnosticFactory1 NOT_AN_ANNOTATION_CLASS = DiagnosticFactory1.create(ERROR); // This field is needed to make the Initializer class load (interfaces cannot have static initializers) diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/diagnostics/UnusedElementDiagnosticFactory.java b/compiler/frontend/src/org/jetbrains/jet/lang/diagnostics/UnusedElementDiagnosticFactory.java index 82cb5dcdbd1..416a4809603 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/diagnostics/UnusedElementDiagnosticFactory.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/diagnostics/UnusedElementDiagnosticFactory.java @@ -25,7 +25,7 @@ import org.jetbrains.jet.lang.diagnostics.rendering.Renderers; */ public class UnusedElementDiagnosticFactory extends DiagnosticFactory1 { private UnusedElementDiagnosticFactory(Severity severity, String message, PositioningStrategy positioningStrategy, Renderer renderer) { - super(severity, message, positioningStrategy, renderer); + super(severity, positioningStrategy); } public static UnusedElementDiagnosticFactory create(Severity severity, String message, PositioningStrategy positioningStrategy, Renderer renderer) {