diff --git a/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/JavaDescriptorResolver.java b/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/JavaDescriptorResolver.java index 2db3a44215a..ce1dd11eb75 100644 --- a/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/JavaDescriptorResolver.java +++ b/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/JavaDescriptorResolver.java @@ -219,6 +219,7 @@ public class JavaDescriptorResolver { // First, let's check that this is a real Java class, not a Java's view on a Kotlin class: ClassDescriptor kotlinClassDescriptor = semanticServices.getKotlinClassDescriptor(qualifiedName); if (kotlinClassDescriptor != null) { + // TODO: return null, no loops here return new ResolverSrcClassData(kotlinClassDescriptor); } @@ -258,6 +259,7 @@ public class JavaDescriptorResolver { // First, let's check that this is a real Java class, not a Java's view on a Kotlin class: ClassDescriptor kotlinClassDescriptor = semanticServices.getKotlinClassDescriptor(qualifiedName); if (kotlinClassDescriptor != null) { + // TODO: return null, no loops here return kotlinClassDescriptor; } diff --git a/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/JavaPackageScope.java b/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/JavaPackageScope.java index 099a4245d1e..9df7843202f 100644 --- a/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/JavaPackageScope.java +++ b/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/JavaPackageScope.java @@ -29,6 +29,7 @@ import org.jetbrains.jet.lang.descriptors.ClassDescriptor; import org.jetbrains.jet.lang.descriptors.ClassifierDescriptor; import org.jetbrains.jet.lang.descriptors.DeclarationDescriptor; import org.jetbrains.jet.lang.descriptors.NamespaceDescriptor; +import org.jetbrains.jet.lang.resolve.DescriptorUtils; import java.util.Collection; import java.util.HashSet; @@ -68,7 +69,14 @@ public class JavaPackageScope extends JavaClassOrPackageScope { @Override public ClassifierDescriptor getClassifier(@NotNull String name) { - return semanticServices.getDescriptorResolver().resolveClass(getQualifiedName(packageFQN, name)); + ClassDescriptor classDescriptor = semanticServices.getDescriptorResolver().resolveClass(getQualifiedName(packageFQN, name)); + if (classDescriptor == null || DescriptorUtils.isObject(classDescriptor)) { + // TODO: this is a big hack against several things that I barely understand myself and cannot explain + // 1. We should not return objects from this method, and maybe JDR.resolveClass should not return too + // 2. JDR should not return classes being analyzed + return null; + } + return classDescriptor; } @Override diff --git a/compiler/testData/diagnostics/tests/Builders.jet b/compiler/testData/diagnostics/tests/Builders.jet index b48483f75f8..8e5ad378045 100644 --- a/compiler/testData/diagnostics/tests/Builders.jet +++ b/compiler/testData/diagnostics/tests/Builders.jet @@ -1,5 +1,4 @@ // FILE: a.kt -// +JDK /** * This is an example of a Type-Safe Groovy-style Builder diff --git a/compiler/testData/diagnostics/tests/ClassObjects.jet b/compiler/testData/diagnostics/tests/ClassObjects.jet index 019fc084e6f..d029a8bafd1 100644 --- a/compiler/testData/diagnostics/tests/ClassObjects.jet +++ b/compiler/testData/diagnostics/tests/ClassObjects.jet @@ -1,4 +1,3 @@ -// +JDK package Jet86 diff --git a/compiler/testData/diagnostics/tests/CovariantOverrideType.jet b/compiler/testData/diagnostics/tests/CovariantOverrideType.jet index cc4a6ac95d3..3496cc1e761 100644 --- a/compiler/testData/diagnostics/tests/CovariantOverrideType.jet +++ b/compiler/testData/diagnostics/tests/CovariantOverrideType.jet @@ -1,4 +1,3 @@ -// +JDK trait A { fun foo() : Int = 1 diff --git a/compiler/testData/diagnostics/tests/DanglingFunctionLiteral.jet b/compiler/testData/diagnostics/tests/DanglingFunctionLiteral.jet index 4020cbaa107..7e1b5c0ef94 100644 --- a/compiler/testData/diagnostics/tests/DanglingFunctionLiteral.jet +++ b/compiler/testData/diagnostics/tests/DanglingFunctionLiteral.jet @@ -1,4 +1,3 @@ -//+JDK class Foo() { private val builder = StringBuilder("sdfsd"); diff --git a/compiler/testData/diagnostics/tests/ForRangeConventions.jet b/compiler/testData/diagnostics/tests/ForRangeConventions.jet index d94d7aca9d2..0ba48098ab9 100644 --- a/compiler/testData/diagnostics/tests/ForRangeConventions.jet +++ b/compiler/testData/diagnostics/tests/ForRangeConventions.jet @@ -1,4 +1,3 @@ -// +JDK import java.util.*; diff --git a/compiler/testData/diagnostics/tests/FunctionReturnTypes.jet b/compiler/testData/diagnostics/tests/FunctionReturnTypes.jet index 53f9c49638a..974e9347675 100644 --- a/compiler/testData/diagnostics/tests/FunctionReturnTypes.jet +++ b/compiler/testData/diagnostics/tests/FunctionReturnTypes.jet @@ -1,4 +1,3 @@ -// +JDK fun none() {} diff --git a/compiler/testData/diagnostics/tests/MergePackagesWithJava.jet b/compiler/testData/diagnostics/tests/MergePackagesWithJava.jet index 727852d39df..4e4ddf6eec3 100644 --- a/compiler/testData/diagnostics/tests/MergePackagesWithJava.jet +++ b/compiler/testData/diagnostics/tests/MergePackagesWithJava.jet @@ -1,4 +1,3 @@ -// +JDK // KT-689 Allow to put Java and Kotlin files in the same packages // This is a stub test. One should not extend Java packages that come from libraries. diff --git a/compiler/testData/diagnostics/tests/NamespaceInExpressionPosition.jet b/compiler/testData/diagnostics/tests/NamespaceInExpressionPosition.jet index 9a6d9805a2a..5fb807a08fe 100644 --- a/compiler/testData/diagnostics/tests/NamespaceInExpressionPosition.jet +++ b/compiler/testData/diagnostics/tests/NamespaceInExpressionPosition.jet @@ -1,4 +1,3 @@ -// +JDK package foo diff --git a/compiler/testData/diagnostics/tests/NamespaceQualified.jet b/compiler/testData/diagnostics/tests/NamespaceQualified.jet index ab5f51b7834..1d5802a12b1 100644 --- a/compiler/testData/diagnostics/tests/NamespaceQualified.jet +++ b/compiler/testData/diagnostics/tests/NamespaceQualified.jet @@ -1,5 +1,4 @@ // FILE: b.kt -// +JDK package foobar.a diff --git a/compiler/testData/diagnostics/tests/Nullability.jet b/compiler/testData/diagnostics/tests/Nullability.jet index 14ba1b28652..3a8594058b7 100644 --- a/compiler/testData/diagnostics/tests/Nullability.jet +++ b/compiler/testData/diagnostics/tests/Nullability.jet @@ -1,4 +1,3 @@ -// +JDK fun test() { val a : Int? = 0 diff --git a/compiler/testData/diagnostics/tests/PrimaryConstructors.jet b/compiler/testData/diagnostics/tests/PrimaryConstructors.jet index 5bc4f0face5..2a3de6e374a 100644 --- a/compiler/testData/diagnostics/tests/PrimaryConstructors.jet +++ b/compiler/testData/diagnostics/tests/PrimaryConstructors.jet @@ -1,4 +1,3 @@ -//+JDK class X { val x : Int diff --git a/compiler/testData/diagnostics/tests/ResolveOfJavaGenerics.jet b/compiler/testData/diagnostics/tests/ResolveOfJavaGenerics.jet index 89d945efbd9..40f1890e22e 100644 --- a/compiler/testData/diagnostics/tests/ResolveOfJavaGenerics.jet +++ b/compiler/testData/diagnostics/tests/ResolveOfJavaGenerics.jet @@ -1,4 +1,3 @@ -// +JDK // Fixpoint generic in Java: Enum> fun test(a : annotation.RetentionPolicy) { diff --git a/compiler/testData/diagnostics/tests/ResolveToJava.jet b/compiler/testData/diagnostics/tests/ResolveToJava.jet index ddbac36543a..a50b677f9fb 100644 --- a/compiler/testData/diagnostics/tests/ResolveToJava.jet +++ b/compiler/testData/diagnostics/tests/ResolveToJava.jet @@ -1,5 +1,4 @@ // FILE: f.kt -// +JDK import java.* import java.util.* diff --git a/compiler/testData/diagnostics/tests/UnreachableCode.jet b/compiler/testData/diagnostics/tests/UnreachableCode.jet index 61daebad7c1..2a8f1870e0f 100644 --- a/compiler/testData/diagnostics/tests/UnreachableCode.jet +++ b/compiler/testData/diagnostics/tests/UnreachableCode.jet @@ -1,4 +1,3 @@ -// +JDK fun t1() : Int{ return 0 diff --git a/compiler/testData/diagnostics/tests/ValAndFunOverrideCompatibilityClash.jet b/compiler/testData/diagnostics/tests/ValAndFunOverrideCompatibilityClash.jet index f493c55a093..638313bc78d 100644 --- a/compiler/testData/diagnostics/tests/ValAndFunOverrideCompatibilityClash.jet +++ b/compiler/testData/diagnostics/tests/ValAndFunOverrideCompatibilityClash.jet @@ -1,4 +1,3 @@ -// +JDK class Foo1() : java.util.ArrayList() diff --git a/compiler/testData/diagnostics/tests/VarargTypes.jet b/compiler/testData/diagnostics/tests/VarargTypes.jet index 6ce7192dcdb..379dc14bf04 100644 --- a/compiler/testData/diagnostics/tests/VarargTypes.jet +++ b/compiler/testData/diagnostics/tests/VarargTypes.jet @@ -1,5 +1,4 @@ // KT-389 Wrong type inference for varargs etc. -// +JDK import java.util.* diff --git a/compiler/testData/diagnostics/tests/alt-headers/ArrayListAndMap.jet b/compiler/testData/diagnostics/tests/alt-headers/ArrayListAndMap.jet index d5d2a7bdeef..726d1cc6c00 100644 --- a/compiler/testData/diagnostics/tests/alt-headers/ArrayListAndMap.jet +++ b/compiler/testData/diagnostics/tests/alt-headers/ArrayListAndMap.jet @@ -1,4 +1,3 @@ -// +JDK package kotlin1 diff --git a/compiler/testData/diagnostics/tests/alt-headers/ArrayListClone.jet b/compiler/testData/diagnostics/tests/alt-headers/ArrayListClone.jet index 85970377c28..f6cb826d016 100644 --- a/compiler/testData/diagnostics/tests/alt-headers/ArrayListClone.jet +++ b/compiler/testData/diagnostics/tests/alt-headers/ArrayListClone.jet @@ -1,4 +1,3 @@ -// +JDK package kotlin1 diff --git a/compiler/testData/diagnostics/tests/alt-headers/ArrayListToArray.jet b/compiler/testData/diagnostics/tests/alt-headers/ArrayListToArray.jet index c35cd5d365a..16dad2f87f6 100644 --- a/compiler/testData/diagnostics/tests/alt-headers/ArrayListToArray.jet +++ b/compiler/testData/diagnostics/tests/alt-headers/ArrayListToArray.jet @@ -1,4 +1,3 @@ -// +JDK package kotlin1 diff --git a/compiler/testData/diagnostics/tests/annotations/AnnotationsForClasses.jet b/compiler/testData/diagnostics/tests/annotations/AnnotationsForClasses.jet index 1a6044796ce..fd1ba79ce0a 100644 --- a/compiler/testData/diagnostics/tests/annotations/AnnotationsForClasses.jet +++ b/compiler/testData/diagnostics/tests/annotations/AnnotationsForClasses.jet @@ -1,3 +1,2 @@ -// +JDK annotation [java.lang.Deprecated] class my annotation Deprecated class my1 diff --git a/compiler/testData/diagnostics/tests/annotations/Deprecated.jet b/compiler/testData/diagnostics/tests/annotations/Deprecated.jet index 9cff9bb8dc0..4cfe9c3b74d 100644 --- a/compiler/testData/diagnostics/tests/annotations/Deprecated.jet +++ b/compiler/testData/diagnostics/tests/annotations/Deprecated.jet @@ -1,4 +1,3 @@ -// +JDK import java.lang.Deprecated as deprecated diff --git a/compiler/testData/diagnostics/tests/annotations/JavaAnnotationConstructors.jet b/compiler/testData/diagnostics/tests/annotations/JavaAnnotationConstructors.jet index 54802945bca..fc91850664c 100644 --- a/compiler/testData/diagnostics/tests/annotations/JavaAnnotationConstructors.jet +++ b/compiler/testData/diagnostics/tests/annotations/JavaAnnotationConstructors.jet @@ -1,4 +1,3 @@ -// +JDK import java.lang.annotation.* annotation [java.lang.annotation.Retention(RetentionPolicy.CLASS)] class my diff --git a/compiler/testData/diagnostics/tests/cast/AsErasedError.jet b/compiler/testData/diagnostics/tests/cast/AsErasedError.jet index 2b6a8a020d3..1b5e19f1c54 100644 --- a/compiler/testData/diagnostics/tests/cast/AsErasedError.jet +++ b/compiler/testData/diagnostics/tests/cast/AsErasedError.jet @@ -1,4 +1,3 @@ -// +JDK import java.util.List; import java.util.Collection; diff --git a/compiler/testData/diagnostics/tests/cast/AsErasedFine.jet b/compiler/testData/diagnostics/tests/cast/AsErasedFine.jet index b4c50dc6b11..294d77e864c 100644 --- a/compiler/testData/diagnostics/tests/cast/AsErasedFine.jet +++ b/compiler/testData/diagnostics/tests/cast/AsErasedFine.jet @@ -1,4 +1,3 @@ -// +JDK import java.util.List; import java.util.Collection; diff --git a/compiler/testData/diagnostics/tests/cast/AsErasedStar.jet b/compiler/testData/diagnostics/tests/cast/AsErasedStar.jet index 4217aae11df..ea5debdbfe8 100644 --- a/compiler/testData/diagnostics/tests/cast/AsErasedStar.jet +++ b/compiler/testData/diagnostics/tests/cast/AsErasedStar.jet @@ -1,4 +1,3 @@ -// +JDK import java.util.List; diff --git a/compiler/testData/diagnostics/tests/cast/AsErasedWarning.jet b/compiler/testData/diagnostics/tests/cast/AsErasedWarning.jet index eff6dff6487..de7374eda34 100644 --- a/compiler/testData/diagnostics/tests/cast/AsErasedWarning.jet +++ b/compiler/testData/diagnostics/tests/cast/AsErasedWarning.jet @@ -1,4 +1,3 @@ -// +JDK import java.util.List; diff --git a/compiler/testData/diagnostics/tests/cast/IsErasedAllowParameterSubtype.jet b/compiler/testData/diagnostics/tests/cast/IsErasedAllowParameterSubtype.jet index f7b2c7c22c5..b27d3256df2 100644 --- a/compiler/testData/diagnostics/tests/cast/IsErasedAllowParameterSubtype.jet +++ b/compiler/testData/diagnostics/tests/cast/IsErasedAllowParameterSubtype.jet @@ -1,4 +1,3 @@ -// +JDK import java.util.Collection; import java.util.List; diff --git a/compiler/testData/diagnostics/tests/cast/IsErasedAllowSameClassParameter.jet b/compiler/testData/diagnostics/tests/cast/IsErasedAllowSameClassParameter.jet index ca46b082bc1..06005450ebc 100644 --- a/compiler/testData/diagnostics/tests/cast/IsErasedAllowSameClassParameter.jet +++ b/compiler/testData/diagnostics/tests/cast/IsErasedAllowSameClassParameter.jet @@ -1,4 +1,3 @@ -// +JDK import java.util.Collection; import java.util.List; diff --git a/compiler/testData/diagnostics/tests/cast/IsErasedAllowSameParameterParameter.jet b/compiler/testData/diagnostics/tests/cast/IsErasedAllowSameParameterParameter.jet index 6d6e453858b..e41590a1013 100644 --- a/compiler/testData/diagnostics/tests/cast/IsErasedAllowSameParameterParameter.jet +++ b/compiler/testData/diagnostics/tests/cast/IsErasedAllowSameParameterParameter.jet @@ -1,4 +1,3 @@ -// +JDK import java.util.Collection; import java.util.List; diff --git a/compiler/testData/diagnostics/tests/cast/IsErasedDisallowFromAny.jet b/compiler/testData/diagnostics/tests/cast/IsErasedDisallowFromAny.jet index 76e1b3e530e..6bc9e638c2d 100644 --- a/compiler/testData/diagnostics/tests/cast/IsErasedDisallowFromAny.jet +++ b/compiler/testData/diagnostics/tests/cast/IsErasedDisallowFromAny.jet @@ -1,4 +1,3 @@ -// +JDK import java.util.List; diff --git a/compiler/testData/diagnostics/tests/cast/IsErasedDisallowFromOut.jet b/compiler/testData/diagnostics/tests/cast/IsErasedDisallowFromOut.jet index b0cd9a510a0..b87c8350ea4 100644 --- a/compiler/testData/diagnostics/tests/cast/IsErasedDisallowFromOut.jet +++ b/compiler/testData/diagnostics/tests/cast/IsErasedDisallowFromOut.jet @@ -1,4 +1,3 @@ -// +JDK import java.util.List diff --git a/compiler/testData/diagnostics/tests/cast/IsErasedStar.jet b/compiler/testData/diagnostics/tests/cast/IsErasedStar.jet index 232d2a2f1c9..3d53f78fbc6 100644 --- a/compiler/testData/diagnostics/tests/cast/IsErasedStar.jet +++ b/compiler/testData/diagnostics/tests/cast/IsErasedStar.jet @@ -1,4 +1,3 @@ -// +JDK import java.util.List; diff --git a/compiler/testData/diagnostics/tests/cast/WhenErasedDisallowFromAny.jet b/compiler/testData/diagnostics/tests/cast/WhenErasedDisallowFromAny.jet index d4ad8b264b0..612f67f517f 100644 --- a/compiler/testData/diagnostics/tests/cast/WhenErasedDisallowFromAny.jet +++ b/compiler/testData/diagnostics/tests/cast/WhenErasedDisallowFromAny.jet @@ -1,4 +1,3 @@ -// +JDK import java.util.List; diff --git a/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt1001.jet b/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt1001.jet index a10d8ad0dce..f724ddc4ec4 100644 --- a/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt1001.jet +++ b/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt1001.jet @@ -1,7 +1,6 @@ //KT-1001 Argument 2 for @NotNull parameter of JetFlowInformationProvider.checkIsInitialized must not be null package kt1001 -//+JDK fun foo(c: Array) { return diff --git a/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt1027.jet b/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt1027.jet index 1c61a4769c7..f80bfc91be0 100644 --- a/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt1027.jet +++ b/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt1027.jet @@ -1,5 +1,4 @@ //KT-1027 Strange selection of unreachable code -//+JDK package kt1027 diff --git a/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt1066.jet b/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt1066.jet index 239e724bf4b..aa6eb588534 100644 --- a/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt1066.jet +++ b/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt1066.jet @@ -1,5 +1,4 @@ //KT-1066 false 'Variable cannot be initialized before declaration' -//+JDK package kt1066 diff --git a/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt1156.jet b/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt1156.jet index a7d0f673b4b..dc2fdabf70e 100644 --- a/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt1156.jet +++ b/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt1156.jet @@ -1,6 +1,5 @@ //KT-1156 Throwing exception on the right side of elvis operator marks code unreachable -//+JDK fun foo(maybe: Int?) { val i : Int = maybe ?: throw RuntimeException("No value") diff --git a/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt1189.jet b/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt1189.jet index 9f4becfec71..0e8b922a052 100644 --- a/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt1189.jet +++ b/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt1189.jet @@ -1,6 +1,5 @@ //KT-1189 StackOverflow in ide package kt1189 -//+JDK import java.util.concurrent.locks.ReentrantReadWriteLock inline fun ReentrantReadWriteLock.write(action: ()->T) : T { diff --git a/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt1219.1301.jet b/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt1219.1301.jet index 1716e79fa54..d1467b8c469 100644 --- a/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt1219.1301.jet +++ b/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt1219.1301.jet @@ -1,5 +1,4 @@ //KT-1219 Incorrect 'unused value' error in closures -//+JDK package kt1219 diff --git a/compiler/testData/diagnostics/tests/controlStructures/kt770.kt351.kt735_StatementType.jet b/compiler/testData/diagnostics/tests/controlStructures/kt770.kt351.kt735_StatementType.jet index 93588d74385..568b5658255 100644 --- a/compiler/testData/diagnostics/tests/controlStructures/kt770.kt351.kt735_StatementType.jet +++ b/compiler/testData/diagnostics/tests/controlStructures/kt770.kt351.kt735_StatementType.jet @@ -1,6 +1,5 @@ package kt770_351_735 -//+JDK //KT-770 Reference is not resolved to anything, but is not marked unresolved fun main(args : Array) { diff --git a/compiler/testData/diagnostics/tests/declarationChecks/kt1141.jet b/compiler/testData/diagnostics/tests/declarationChecks/kt1141.jet index 11c827ef897..3a9ec35ca78 100644 --- a/compiler/testData/diagnostics/tests/declarationChecks/kt1141.jet +++ b/compiler/testData/diagnostics/tests/declarationChecks/kt1141.jet @@ -1,5 +1,4 @@ //KT-1141 No check that object in 'object expression' implements all abstract members of supertype -//+JDK package kt1141 diff --git a/compiler/testData/diagnostics/tests/extensions/ExtensionFunctions.jet b/compiler/testData/diagnostics/tests/extensions/ExtensionFunctions.jet index e316a81cb5d..adb16268b69 100644 --- a/compiler/testData/diagnostics/tests/extensions/ExtensionFunctions.jet +++ b/compiler/testData/diagnostics/tests/extensions/ExtensionFunctions.jet @@ -1,5 +1,4 @@ // FILE: b.kt -// +JDK package outer fun Int?.optint() : Unit {} diff --git a/compiler/testData/diagnostics/tests/extensions/GenericIterator.jet b/compiler/testData/diagnostics/tests/extensions/GenericIterator.jet index 965f92aa27f..a41644e2446 100644 --- a/compiler/testData/diagnostics/tests/extensions/GenericIterator.jet +++ b/compiler/testData/diagnostics/tests/extensions/GenericIterator.jet @@ -1,4 +1,3 @@ -// +JDK import java.util.Enumeration inline fun java.util.Enumeration.iterator() = object: Iterator { diff --git a/compiler/testData/diagnostics/tests/extensions/kt819ExtensionProperties.jet b/compiler/testData/diagnostics/tests/extensions/kt819ExtensionProperties.jet index 7df2286d58a..ed897999755 100644 --- a/compiler/testData/diagnostics/tests/extensions/kt819ExtensionProperties.jet +++ b/compiler/testData/diagnostics/tests/extensions/kt819ExtensionProperties.jet @@ -1,5 +1,4 @@ -//+JDK //KT-819 Redeclaration error for extension properties with the same name and different receivers import java.io.* diff --git a/compiler/testData/diagnostics/tests/j+k/Simple.jet b/compiler/testData/diagnostics/tests/j+k/Simple.jet index e698e624164..cd731c2d67d 100644 --- a/compiler/testData/diagnostics/tests/j+k/Simple.jet +++ b/compiler/testData/diagnostics/tests/j+k/Simple.jet @@ -1,5 +1,4 @@ // FILE: aa/A.java -// +JDK package aa; public class A { diff --git a/compiler/testData/diagnostics/tests/j+k/kt1402.jet b/compiler/testData/diagnostics/tests/j+k/kt1402.jet index e373a79fa02..40e71ec651e 100644 --- a/compiler/testData/diagnostics/tests/j+k/kt1402.jet +++ b/compiler/testData/diagnostics/tests/j+k/kt1402.jet @@ -1,5 +1,4 @@ // FILE: a/M.java -// +JDK package a; public class M { diff --git a/compiler/testData/diagnostics/tests/nullabilityAndAutoCasts/kt1270.jet b/compiler/testData/diagnostics/tests/nullabilityAndAutoCasts/kt1270.jet index e718fda7f56..d69264a832c 100644 --- a/compiler/testData/diagnostics/tests/nullabilityAndAutoCasts/kt1270.jet +++ b/compiler/testData/diagnostics/tests/nullabilityAndAutoCasts/kt1270.jet @@ -1,5 +1,4 @@ //KT-1270 Poor highlighting when trying to dereference a nullable reference -//+JDK package kt1270 diff --git a/compiler/testData/diagnostics/tests/nullabilityAndAutoCasts/kt244.jet b/compiler/testData/diagnostics/tests/nullabilityAndAutoCasts/kt244.jet index 8077821564f..64c75a7856e 100644 --- a/compiler/testData/diagnostics/tests/nullabilityAndAutoCasts/kt244.jet +++ b/compiler/testData/diagnostics/tests/nullabilityAndAutoCasts/kt244.jet @@ -1,6 +1,5 @@ package kt244 -//+JDK // KT-244 Use dataflow info while resolving variable initializers diff --git a/compiler/testData/diagnostics/tests/objects/ObjectsInheritance.jet b/compiler/testData/diagnostics/tests/objects/ObjectsInheritance.jet index 2cb27666450..9d7c9ee16ee 100644 --- a/compiler/testData/diagnostics/tests/objects/ObjectsInheritance.jet +++ b/compiler/testData/diagnostics/tests/objects/ObjectsInheritance.jet @@ -1,7 +1,6 @@ -//+JDK package toplevelObjectDeclarations object CObj {} -object DOjb : CObj {} +object DOjb : CObj {} diff --git a/compiler/testData/diagnostics/tests/operatorsOverloading/kt1028.jet b/compiler/testData/diagnostics/tests/operatorsOverloading/kt1028.jet index 17ebf44cd05..87a1f14bfe1 100644 --- a/compiler/testData/diagnostics/tests/operatorsOverloading/kt1028.jet +++ b/compiler/testData/diagnostics/tests/operatorsOverloading/kt1028.jet @@ -1,5 +1,4 @@ //KT-1028 Wrong type checking for plusAssign -//+JDK package kt1028 import java.util.* diff --git a/compiler/testData/diagnostics/tests/regressions/DoubleDefine.jet b/compiler/testData/diagnostics/tests/regressions/DoubleDefine.jet index 7d9592ea0ff..d591be5356b 100644 --- a/compiler/testData/diagnostics/tests/regressions/DoubleDefine.jet +++ b/compiler/testData/diagnostics/tests/regressions/DoubleDefine.jet @@ -1,4 +1,3 @@ -// +JDK import java.util.* diff --git a/compiler/testData/diagnostics/tests/regressions/Jet53.jet b/compiler/testData/diagnostics/tests/regressions/Jet53.jet index a138884afc2..a1f96ddae0f 100644 --- a/compiler/testData/diagnostics/tests/regressions/Jet53.jet +++ b/compiler/testData/diagnostics/tests/regressions/Jet53.jet @@ -1,4 +1,3 @@ -// +JDK import java.util.Collections import java.util.List diff --git a/compiler/testData/diagnostics/tests/regressions/Jet72.jet b/compiler/testData/diagnostics/tests/regressions/Jet72.jet index 0d105c7fe04..ab5eb1be4ee 100644 --- a/compiler/testData/diagnostics/tests/regressions/Jet72.jet +++ b/compiler/testData/diagnostics/tests/regressions/Jet72.jet @@ -1,5 +1,4 @@ // JET-72 Type inference doesn't work when iterating over ArrayList -// +JDK import java.util.ArrayList diff --git a/compiler/testData/diagnostics/tests/regressions/kt174.jet b/compiler/testData/diagnostics/tests/regressions/kt174.jet index ea04148db1b..a9804fcc103 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt174.jet +++ b/compiler/testData/diagnostics/tests/regressions/kt174.jet @@ -1,5 +1,4 @@ // KT-174 Nullability info for extension function receivers -// +JDK trait Tree {} fun Any?.TreeValue() : Tree { diff --git a/compiler/testData/diagnostics/tests/regressions/kt201.jet b/compiler/testData/diagnostics/tests/regressions/kt201.jet index 7097b29a8c5..99e9475c106 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt201.jet +++ b/compiler/testData/diagnostics/tests/regressions/kt201.jet @@ -1,5 +1,4 @@ // KT-201 Allow to call extension with nullable receiver with a '.' -// +JDK fun T?.npe() : T = if (this == null) throw NullPointerException() else this diff --git a/compiler/testData/diagnostics/tests/regressions/kt235.jet b/compiler/testData/diagnostics/tests/regressions/kt235.jet index 1e13315aa47..5d86407e32e 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt235.jet +++ b/compiler/testData/diagnostics/tests/regressions/kt235.jet @@ -1,5 +1,4 @@ //KT-235 Illegal assignment return type -// +JDK package kt235 diff --git a/compiler/testData/diagnostics/tests/regressions/kt258.jet b/compiler/testData/diagnostics/tests/regressions/kt258.jet index 6756ab2b5f7..2a7d59b52ae 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt258.jet +++ b/compiler/testData/diagnostics/tests/regressions/kt258.jet @@ -1,5 +1,4 @@ // KT-258 Support equality constraints in type inference -// +JDK import java.util.* diff --git a/compiler/testData/diagnostics/tests/regressions/kt287.jet b/compiler/testData/diagnostics/tests/regressions/kt287.jet index ddb722610ad..9892cd7a6a9 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt287.jet +++ b/compiler/testData/diagnostics/tests/regressions/kt287.jet @@ -1,5 +1,4 @@ // KT-287 Infer constructor type arguments -// +JDK import java.util.* diff --git a/compiler/testData/diagnostics/tests/regressions/kt313.jet b/compiler/testData/diagnostics/tests/regressions/kt313.jet index 7a112bcb106..d22f0dc4f2e 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt313.jet +++ b/compiler/testData/diagnostics/tests/regressions/kt313.jet @@ -1,5 +1,4 @@ // KT-313 Bug in substitutions in a function returning its type parameter T -// +JDK fun Iterable.join(separator : String?) : String { return separator.npe() diff --git a/compiler/testData/diagnostics/tests/regressions/kt335.336.jet b/compiler/testData/diagnostics/tests/regressions/kt335.336.jet index e95c5cfdefb..2b8eedf9727 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt335.336.jet +++ b/compiler/testData/diagnostics/tests/regressions/kt335.336.jet @@ -1,6 +1,5 @@ // KT-336 Can't infer type parameter for ArrayList in a generic function (Exception in type inference) // KT-335 Type inference fails on Collections.sort -// +JDK import java.util.* import java.lang.Comparable as Comparable diff --git a/compiler/testData/diagnostics/tests/regressions/kt385.109.441.jet b/compiler/testData/diagnostics/tests/regressions/kt385.109.441.jet index d87d244f290..d49b3863bf0 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt385.109.441.jet +++ b/compiler/testData/diagnostics/tests/regressions/kt385.109.441.jet @@ -1,7 +1,6 @@ // KT-385 type inference does not work properly` // KT-109 Good code is red: type arguments are not inferred // KT-441 Exception in type inference when multiple overloads accepting an integer literal are accessible -// +JDK import java.util.* diff --git a/compiler/testData/diagnostics/tests/regressions/kt459.jet b/compiler/testData/diagnostics/tests/regressions/kt459.jet index 81af1374d08..11a4e5aa520 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt459.jet +++ b/compiler/testData/diagnostics/tests/regressions/kt459.jet @@ -1,5 +1,4 @@ // KT-459 Type argument inference fails when class names are fully qualified -// +JDK fun test() { val attributes : java.util.HashMap = java.util.HashMap() // failure! diff --git a/compiler/testData/diagnostics/tests/regressions/kt469.jet b/compiler/testData/diagnostics/tests/regressions/kt469.jet index ee21f757324..d2000b139e8 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt469.jet +++ b/compiler/testData/diagnostics/tests/regressions/kt469.jet @@ -1,4 +1,3 @@ -// +JDK package kt469 diff --git a/compiler/testData/diagnostics/tests/regressions/kt498.jet b/compiler/testData/diagnostics/tests/regressions/kt498.jet index fcb1e8abd61..e5f2d8799c3 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt498.jet +++ b/compiler/testData/diagnostics/tests/regressions/kt498.jet @@ -1,5 +1,4 @@ // KT-498 Very strange error in the type checker -// +JDK class IdUnavailableException() : Exception() {} diff --git a/compiler/testData/diagnostics/tests/regressions/kt524.jet b/compiler/testData/diagnostics/tests/regressions/kt524.jet index 38988714802..39a2ee257cf 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt524.jet +++ b/compiler/testData/diagnostics/tests/regressions/kt524.jet @@ -1,5 +1,4 @@ // KT-524 sure() returns T -// +JDK package StringBuilder diff --git a/compiler/testData/diagnostics/tests/regressions/kt549.jet b/compiler/testData/diagnostics/tests/regressions/kt549.jet index 2b3f087420f..c4b5b824d90 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt549.jet +++ b/compiler/testData/diagnostics/tests/regressions/kt549.jet @@ -1,5 +1,4 @@ //KT-549 type inference failed -// +JDK package demo diff --git a/compiler/testData/diagnostics/tests/regressions/kt58.jet b/compiler/testData/diagnostics/tests/regressions/kt58.jet index 270a1d63b4d..665fa7ad48e 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt58.jet +++ b/compiler/testData/diagnostics/tests/regressions/kt58.jet @@ -1,5 +1,4 @@ //KT-58 Allow finally around definite returns -// +JDK package kt58 diff --git a/compiler/testData/diagnostics/tests/regressions/kt580.jet b/compiler/testData/diagnostics/tests/regressions/kt580.jet index 8816e416104..2d73aa7b74b 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt580.jet +++ b/compiler/testData/diagnostics/tests/regressions/kt580.jet @@ -1,5 +1,4 @@ //KT-580 Type inference failed -// +JDK package whats.the.difference diff --git a/compiler/testData/diagnostics/tests/regressions/kt588.jet b/compiler/testData/diagnostics/tests/regressions/kt588.jet index 410c70c3479..fee5c198ebc 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt588.jet +++ b/compiler/testData/diagnostics/tests/regressions/kt588.jet @@ -1,5 +1,4 @@ // KT-588 Unresolved static method -// +JDK class Test() : Thread("Test") { class object { diff --git a/compiler/testData/diagnostics/tests/regressions/kt597.jet b/compiler/testData/diagnostics/tests/regressions/kt597.jet index 6f4b71c9fb1..a2b361460bb 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt597.jet +++ b/compiler/testData/diagnostics/tests/regressions/kt597.jet @@ -1,5 +1,4 @@ //KT-597 Type inference failed -// +JDK fun Array?.get(i: Int) : T { if (this != null) diff --git a/compiler/testData/diagnostics/tests/regressions/kt600.jet b/compiler/testData/diagnostics/tests/regressions/kt600.jet index 0ca74ae5c33..d31c11bba4a 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt600.jet +++ b/compiler/testData/diagnostics/tests/regressions/kt600.jet @@ -1,5 +1,4 @@ //KT-600 Problem with 'sure' extension function type inference -// +JDK fun T?._sure() : T { if (this != null) return this else throw NullPointerException() } diff --git a/compiler/testData/diagnostics/tests/regressions/kt701.jet b/compiler/testData/diagnostics/tests/regressions/kt701.jet index 75320e6c8f6..81e8932af76 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt701.jet +++ b/compiler/testData/diagnostics/tests/regressions/kt701.jet @@ -1,5 +1,4 @@ // KT-702 Type inference failed -// +JDK fun getJavaClass() : java.lang.Class { return "" as Class } public class Throwables() { diff --git a/compiler/testData/diagnostics/tests/regressions/kt716.jet b/compiler/testData/diagnostics/tests/regressions/kt716.jet index 24f547f7c95..25fd89edeb6 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt716.jet +++ b/compiler/testData/diagnostics/tests/regressions/kt716.jet @@ -1,5 +1,4 @@ // KT-716 Type inference failed -// +JDK class TypeInfo diff --git a/compiler/testData/diagnostics/tests/regressions/kt743.jet b/compiler/testData/diagnostics/tests/regressions/kt743.jet index e8abe9ee427..f508c0af0bd 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt743.jet +++ b/compiler/testData/diagnostics/tests/regressions/kt743.jet @@ -1,5 +1,4 @@ //KT-743 Wrong type inference -// +JDK class List(val head: T, val tail: List? = null) fun List.map(f: (T)-> Q): List? = tail.sure>().map(f) diff --git a/compiler/testData/diagnostics/tests/regressions/kt750.jet b/compiler/testData/diagnostics/tests/regressions/kt750.jet index 9e9760acb17..99427e88195 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt750.jet +++ b/compiler/testData/diagnostics/tests/regressions/kt750.jet @@ -1,4 +1,3 @@ -// +JDK //KT-750 Type inference failed: Constraint violation fun main(args : Array) { var i : Int? = Integer.valueOf(100) diff --git a/compiler/testData/diagnostics/tests/regressions/kt860.jet b/compiler/testData/diagnostics/tests/regressions/kt860.jet index 75b040d5985..801b0988e58 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt860.jet +++ b/compiler/testData/diagnostics/tests/regressions/kt860.jet @@ -1,5 +1,4 @@ // KT-860 ConcurrentModificationException in frontend -// +JDK package kotlin.util diff --git a/compiler/testData/diagnostics/tests/scopes/kt1080.jet b/compiler/testData/diagnostics/tests/scopes/kt1080.jet index b7412af7c10..92a3c3f0866 100644 --- a/compiler/testData/diagnostics/tests/scopes/kt1080.jet +++ b/compiler/testData/diagnostics/tests/scopes/kt1080.jet @@ -1,5 +1,4 @@ //FILE:a.kt -//+JDK //KT-1080 Don't use previously imported packages while resolving import references package kt1080 diff --git a/compiler/testData/diagnostics/tests/scopes/kt250.617.10.jet b/compiler/testData/diagnostics/tests/scopes/kt250.617.10.jet index e81cf184154..542b12e2fa3 100644 --- a/compiler/testData/diagnostics/tests/scopes/kt250.617.10.jet +++ b/compiler/testData/diagnostics/tests/scopes/kt250.617.10.jet @@ -1,4 +1,3 @@ -// +JDK package kt_250_617_10 diff --git a/compiler/testData/diagnostics/tests/scopes/kt939.jet b/compiler/testData/diagnostics/tests/scopes/kt939.jet index d52c1bd3525..5fbec35e5da 100644 --- a/compiler/testData/diagnostics/tests/scopes/kt939.jet +++ b/compiler/testData/diagnostics/tests/scopes/kt939.jet @@ -1,6 +1,5 @@ package kt939 -//+JDK //KT-939 CommonSupertypes erases scopes associated to types diff --git a/compiler/testData/diagnostics/tests/scopes/kt955.jet b/compiler/testData/diagnostics/tests/scopes/kt955.jet index 9c3ae3c51fb..bdf36cea8aa 100644 --- a/compiler/testData/diagnostics/tests/scopes/kt955.jet +++ b/compiler/testData/diagnostics/tests/scopes/kt955.jet @@ -1,27 +1,23 @@ //FILE:a.kt //KT-955 Unable to import a Kotlin package into a Kotlin file with no package header -//+JDK package foo fun f() {} //FILE:b.kt -//+JDK import foo.* val m = f() // unresolved //FILE:c.kt -//+JDK package java.util fun bar() {} //FILE:d.kt -//+JDK import java.util.* diff --git a/compiler/testData/diagnostics/tests/subtyping/kt-1457.jet b/compiler/testData/diagnostics/tests/subtyping/kt-1457.jet index bcbf5ce0407..b84aeb6a9ad 100644 --- a/compiler/testData/diagnostics/tests/subtyping/kt-1457.jet +++ b/compiler/testData/diagnostics/tests/subtyping/kt-1457.jet @@ -1,4 +1,3 @@ -// +JDK import java.util.ArrayList class MyListOfPairs : ArrayList<#(T, T)>() { } diff --git a/compiler/tests/org/jetbrains/jet/checkers/JetDiagnosticsTest.java b/compiler/tests/org/jetbrains/jet/checkers/JetDiagnosticsTest.java index 7cce8775c1e..62ebe235ca9 100644 --- a/compiler/tests/org/jetbrains/jet/checkers/JetDiagnosticsTest.java +++ b/compiler/tests/org/jetbrains/jet/checkers/JetDiagnosticsTest.java @@ -151,8 +151,7 @@ public class JetDiagnosticsTest extends JetLiteFixture { } }); - boolean importJdk = expectedText.contains("+JDK"); -// ModuleConfiguration configuration = importJdk ? JavaBridgeConfiguration.createJavaBridgeConfiguration(getProject()) : ModuleConfiguration.EMPTY; +// ModuleConfiguration configuration = JavaBridgeConfiguration.createJavaBridgeConfiguration(getProject()); if (hasJavaFiles) { // According to yole@ the only way to import java files is to write them on disk // -- stepan.koltsov@ 2012-02-29 @@ -166,13 +165,7 @@ public class JetDiagnosticsTest extends JetLiteFixture { } } - BindingContext bindingContext; - if (importJdk) { - bindingContext = AnalyzerFacadeForJVM.analyzeFilesWithJavaIntegration(getProject(), jetFiles, Predicates.alwaysTrue(), JetControlFlowDataTraceFactory.EMPTY); - } - else { - bindingContext = AnalyzingUtils.analyzeFiles(getProject(), ModuleConfiguration.EMPTY, jetFiles, Predicates.alwaysTrue(), JetControlFlowDataTraceFactory.EMPTY); - } + BindingContext bindingContext = AnalyzerFacadeForJVM.analyzeFilesWithJavaIntegration(getProject(), jetFiles, Predicates.alwaysTrue(), JetControlFlowDataTraceFactory.EMPTY); boolean ok = true;