From cd5521d6dc2f3fdb5017e03f676521eaf044f745 Mon Sep 17 00:00:00 2001 From: Svetlana Isakova Date: Fri, 7 Sep 2012 18:23:11 +0400 Subject: [PATCH] rename error --- .../jetbrains/jet/lang/diagnostics/Errors.java | 2 +- .../rendering/DefaultErrorMessages.java | 2 +- .../jet/lang/resolve/ImportsResolver.java | 4 ++-- .../diagnostics/tests/DelegationToJavaIface.kt | 2 +- .../diagnostics/tests/NamespaceQualified.kt | 2 +- .../diagnostics/tests/ResolveOfJavaGenerics.kt | 2 +- .../testData/diagnostics/tests/ResolveToJava.kt | 16 ++++++++-------- .../inference/mostSpecificAfterInference.kt | 4 ++-- .../testData/diagnostics/tests/j+k/kt2606.kt | 2 +- .../testData/diagnostics/tests/j+k/kt2641.kt | 10 +++++----- .../tests/nullabilityAndAutoCasts/kt1778.kt | 2 +- .../diagnostics/tests/regressions/Jet72.kt | 4 ++-- .../diagnostics/tests/regressions/kt498.kt | 2 +- .../diagnostics/tests/regressions/kt716.kt | 2 +- .../diagnostics/tests/scopes/visibility2.kt | 2 +- 15 files changed, 29 insertions(+), 29 deletions(-) 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 4fcfeb6346b..a27e6dc675d 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/diagnostics/Errors.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/diagnostics/Errors.java @@ -84,7 +84,7 @@ public interface Errors { DiagnosticFactory1 CANNOT_BE_IMPORTED = DiagnosticFactory1.create(ERROR); SimpleDiagnosticFactory USELESS_HIDDEN_IMPORT = SimpleDiagnosticFactory.create(WARNING); SimpleDiagnosticFactory USELESS_SIMPLE_IMPORT = SimpleDiagnosticFactory.create(WARNING); - DiagnosticFactory1> CLASS_HAS_KOTLIN_ANALOG = DiagnosticFactory1.create(WARNING); + DiagnosticFactory1> PLATFORM_CLASS_MAPPED_TO_KOTLIN = DiagnosticFactory1.create(WARNING); SimpleDiagnosticFactory CANNOT_INFER_PARAMETER_TYPE = SimpleDiagnosticFactory.create(ERROR); diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/diagnostics/rendering/DefaultErrorMessages.java b/compiler/frontend/src/org/jetbrains/jet/lang/diagnostics/rendering/DefaultErrorMessages.java index 4db4e45cbd6..2d849d4cd83 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/diagnostics/rendering/DefaultErrorMessages.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/diagnostics/rendering/DefaultErrorMessages.java @@ -95,7 +95,7 @@ public class DefaultErrorMessages { MAP.put(CANNOT_BE_IMPORTED, "Cannot import ''{0}'', functions and properties can be imported only from packages", NAME); MAP.put(USELESS_HIDDEN_IMPORT, "Useless import, it is hidden further"); MAP.put(USELESS_SIMPLE_IMPORT, "Useless import, does nothing"); - MAP.put(CLASS_HAS_KOTLIN_ANALOG, "This class has Kotlin analog(s) {0} that should be used instead.", CLASS_DESCRIPTOR_LIST); + MAP.put(PLATFORM_CLASS_MAPPED_TO_KOTLIN, "This class shouldn't be used in Kotlin. Use {0} instead.", CLASS_DESCRIPTOR_LIST); MAP.put(CANNOT_INFER_PARAMETER_TYPE, "Cannot infer a type for this parameter. To specify it explicitly use the {(p : Type) => ...} notation"); diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/ImportsResolver.java b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/ImportsResolver.java index 7290d65ed46..6b9595b0257 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/ImportsResolver.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/ImportsResolver.java @@ -32,7 +32,7 @@ import java.util.Collection; import java.util.List; import java.util.Map; -import static org.jetbrains.jet.lang.diagnostics.Errors.CLASS_HAS_KOTLIN_ANALOG; +import static org.jetbrains.jet.lang.diagnostics.Errors.PLATFORM_CLASS_MAPPED_TO_KOTLIN; import static org.jetbrains.jet.lang.diagnostics.Errors.USELESS_HIDDEN_IMPORT; import static org.jetbrains.jet.lang.diagnostics.Errors.USELESS_SIMPLE_IMPORT; @@ -149,7 +149,7 @@ public class ImportsResolver { PlatformToKotlinClassMap platformToKotlinMap = configuration.getPlatformToKotlinClassMap(); Collection kotlinAnalogsForClass = platformToKotlinMap.mapPlatformClass((ClassDescriptor) descriptor); if (!kotlinAnalogsForClass.isEmpty()) { - trace.report(CLASS_HAS_KOTLIN_ANALOG.on(element, kotlinAnalogsForClass)); + trace.report(PLATFORM_CLASS_MAPPED_TO_KOTLIN.on(element, kotlinAnalogsForClass)); } } diff --git a/compiler/testData/diagnostics/tests/DelegationToJavaIface.kt b/compiler/testData/diagnostics/tests/DelegationToJavaIface.kt index afac57011fc..ac22a413534 100644 --- a/compiler/testData/diagnostics/tests/DelegationToJavaIface.kt +++ b/compiler/testData/diagnostics/tests/DelegationToJavaIface.kt @@ -1,3 +1,3 @@ class TestIface(r : Runnable) : Runnable by r {} -class TestObject(o : Object) : Object by o {} \ No newline at end of file +class TestObject(o : Object) : Object by o {} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/NamespaceQualified.kt b/compiler/testData/diagnostics/tests/NamespaceQualified.kt index 1701d4e6d9e..c3b3e44c2db 100644 --- a/compiler/testData/diagnostics/tests/NamespaceQualified.kt +++ b/compiler/testData/diagnostics/tests/NamespaceQualified.kt @@ -4,7 +4,7 @@ package foobar.a import java.* - val a : util.List? = null + val a : util.List? = null val a1 : List? = null // FILE: b.kt diff --git a/compiler/testData/diagnostics/tests/ResolveOfJavaGenerics.kt b/compiler/testData/diagnostics/tests/ResolveOfJavaGenerics.kt index b4dff1caec1..80ab713f93f 100644 --- a/compiler/testData/diagnostics/tests/ResolveOfJavaGenerics.kt +++ b/compiler/testData/diagnostics/tests/ResolveOfJavaGenerics.kt @@ -8,7 +8,7 @@ fun test() { val a : Collection? = java.util.Collections.emptyList() } -fun test(a : java.lang.Comparable) { +fun test(a : java.lang.Comparable) { } diff --git a/compiler/testData/diagnostics/tests/ResolveToJava.kt b/compiler/testData/diagnostics/tests/ResolveToJava.kt index 1e6e3c60fbf..e4cfd9367a1 100644 --- a/compiler/testData/diagnostics/tests/ResolveToJava.kt +++ b/compiler/testData/diagnostics/tests/ResolveToJava.kt @@ -5,15 +5,15 @@ import java.util.* import utils.* import java.io.PrintStream -import java.lang.Comparable as Com +import java.lang.Comparable as Com val l : List = ArrayList() -fun test(l : java.util.List) { +fun test(l : java.util.List) { val x : java.List - val y : java.util.List - val b : java.lang.Object - val a : util.List + val y : java.util.List + val b : java.lang.Object + val a : util.List val z : java.utils.List val f : java.io.File? = null @@ -29,7 +29,7 @@ fun test(l : java.util.ListList - val o = "sdf" as Object + val o = "sdf" as Object try { // ... @@ -40,9 +40,9 @@ fun test(l : java.util.ListCom? = null + val c : Com? = null - c : java.lang.Comparable? + c : java.lang.Comparable? // Collections.sort(ArrayList()) xxx.Class() diff --git a/compiler/testData/diagnostics/tests/inference/mostSpecificAfterInference.kt b/compiler/testData/diagnostics/tests/inference/mostSpecificAfterInference.kt index dc6c18cd624..4772d4665d7 100644 --- a/compiler/testData/diagnostics/tests/inference/mostSpecificAfterInference.kt +++ b/compiler/testData/diagnostics/tests/inference/mostSpecificAfterInference.kt @@ -4,7 +4,7 @@ package i import java.util.* fun Collection.map1(f : (T) -> R) : List {} -fun java.lang.Iterable.map1(f : (T) -> R) : List {} +fun java.lang.Iterable.map1(f : (T) -> R) : List {} fun test(list: List) { val res = list.map1 { it } @@ -13,7 +13,7 @@ fun test(list: List) { } fun Collection.foo() {} -fun java.lang.Iterable.foo() {} +fun java.lang.Iterable.foo() {} fun test1(list: List) { val res = list.foo() diff --git a/compiler/testData/diagnostics/tests/j+k/kt2606.kt b/compiler/testData/diagnostics/tests/j+k/kt2606.kt index eea57095e04..921dc189393 100644 --- a/compiler/testData/diagnostics/tests/j+k/kt2606.kt +++ b/compiler/testData/diagnostics/tests/j+k/kt2606.kt @@ -5,7 +5,7 @@ import java.util.* import java.lang.annotation.* fun bar() : Iterator? { - val i : Iterable<Integer> + val i : Iterable<Integer> val a : Annotation return null } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/j+k/kt2641.kt b/compiler/testData/diagnostics/tests/j+k/kt2641.kt index c8c3c8dd9af..c25e107c899 100644 --- a/compiler/testData/diagnostics/tests/j+k/kt2641.kt +++ b/compiler/testData/diagnostics/tests/j+k/kt2641.kt @@ -1,11 +1,11 @@ //KT-2641 Warn on using j.l.Iterable in Kotlin code package n -import java.util.Iterator -import java.lang.Comparable as Comp +import java.util.Iterator +import java.lang.Comparable as Comp -fun bar() : java.lang.Iterable? { - val a : java.lang.Comparable? = null - val b : Iterable<Integer> +fun bar() : java.lang.Iterable? { + val a : java.lang.Comparable? = null + val b : Iterable<Integer> return null } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/nullabilityAndAutoCasts/kt1778.kt b/compiler/testData/diagnostics/tests/nullabilityAndAutoCasts/kt1778.kt index d879d6efb77..eaa1d54f244 100644 --- a/compiler/testData/diagnostics/tests/nullabilityAndAutoCasts/kt1778.kt +++ b/compiler/testData/diagnostics/tests/nullabilityAndAutoCasts/kt1778.kt @@ -3,7 +3,7 @@ package kt1778 fun main(args : Array) { val x = args[0]: Any - if(x is java.lang.CharSequence) { + if(x is java.lang.CharSequence) { if ("a" == x) x.length() else x.length() // OK if ("a" == x || "b" == x) x.length() else x.length() // <– THEN ERROR if ("a" == x && "a" == x) x.length() else x.length() // <– ELSE ERROR diff --git a/compiler/testData/diagnostics/tests/regressions/Jet72.kt b/compiler/testData/diagnostics/tests/regressions/Jet72.kt index b4d6bd6773b..984bede40d7 100644 --- a/compiler/testData/diagnostics/tests/regressions/Jet72.kt +++ b/compiler/testData/diagnostics/tests/regressions/Jet72.kt @@ -2,13 +2,13 @@ import java.util.ArrayList -abstract class Item(val room: Object) { +abstract class Item(val room: Object) { abstract val name : String } val items: ArrayList = ArrayList() -fun test(room : Object) { +fun test(room : Object) { for(val item: Item? in items) { if (item?.room === room) { System.out.println("You see " + item?.name) diff --git a/compiler/testData/diagnostics/tests/regressions/kt498.kt b/compiler/testData/diagnostics/tests/regressions/kt498.kt index 5505b664498..43ce035ad93 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt498.kt +++ b/compiler/testData/diagnostics/tests/regressions/kt498.kt @@ -3,5 +3,5 @@ class IdUnavailableException() : Exception() {} fun T.getJavaClass() : Class { - return ((this as Object).getClass()) as Class // Some error here, because of Exception() used above. ?!!! + return ((this as Object).getClass()) as Class // Some error here, because of Exception() used above. ?!!! } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/regressions/kt716.kt b/compiler/testData/diagnostics/tests/regressions/kt716.kt index 0c00d73b492..7eac06bcde1 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt716.kt +++ b/compiler/testData/diagnostics/tests/regressions/kt716.kt @@ -5,7 +5,7 @@ class TypeInfo fun typeinfo() : TypeInfo = null as TypeInfo fun TypeInfo.getJavaClass() : java.lang.Class { - val t : java.lang.Object = this as java.lang.Object + val t : java.lang.Object = this as java.lang.Object return t.getClass() as java.lang.Class // inferred type is Object but Serializable was expected } diff --git a/compiler/testData/diagnostics/tests/scopes/visibility2.kt b/compiler/testData/diagnostics/tests/scopes/visibility2.kt index b14c4f8be11..cd70f4916fe 100644 --- a/compiler/testData/diagnostics/tests/scopes/visibility2.kt +++ b/compiler/testData/diagnostics/tests/scopes/visibility2.kt @@ -42,6 +42,6 @@ class Q { } //check that 'toString' can be invoked without specifying return type -class NewClass : java.util.ArrayList<Integer>() { +class NewClass : java.util.ArrayList<Integer>() { public override fun toString() = "a" } \ No newline at end of file