diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/DefaultParameterValueSubstitutor.kt b/compiler/backend/src/org/jetbrains/kotlin/codegen/DefaultParameterValueSubstitutor.kt index 3f53613d164..e0af26cd8d2 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/DefaultParameterValueSubstitutor.kt +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/DefaultParameterValueSubstitutor.kt @@ -66,7 +66,7 @@ public class DefaultParameterValueSubstitutor(val state: GenerationState) { * * @param functionDescriptor the method for which the overloads are generated * @param delegateFunctionDescriptor the method descriptor for the implementation that we need to call - * (same as [functionDescriptor] in all cases except for companion object methods annotated with [platformStatic], + * (same as [functionDescriptor] in all cases except for companion object methods annotated with @JvmStatic, * where [functionDescriptor] is the static method in the main class and [delegateFunctionDescriptor] is the * implementation in the companion object class) * @return true if the overloads annotation was found on the element, false otherwise @@ -102,7 +102,7 @@ public class DefaultParameterValueSubstitutor(val state: GenerationState) { * * @param functionDescriptor the method for which the overloads are generated * @param delegateFunctionDescriptor the method descriptor for the implementation that we need to call - * (same as [functionDescriptor] in all cases except for companion object methods annotated with [platformStatic], + * (same as [functionDescriptor] in all cases except for companion object methods annotated with @JvmStatic, * where [functionDescriptor] is the static method in the main class and [delegateFunctionDescriptor] is the * implementation in the companion object class) * @param methodElement the PSI element for the method implementation (used in diagnostic messages only) diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/FunctionCodegen.java b/compiler/backend/src/org/jetbrains/kotlin/codegen/FunctionCodegen.java index 3b0c3d4dba7..d29318a17de 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/FunctionCodegen.java +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/FunctionCodegen.java @@ -187,7 +187,7 @@ public class FunctionCodegen { boolean staticInCompanionObject = AnnotationUtilKt.isPlatformStaticInCompanionObject(functionDescriptor); if (staticInCompanionObject) { ImplementationBodyCodegen parentBodyCodegen = (ImplementationBodyCodegen) memberCodegen.getParentCodegen(); - parentBodyCodegen.addAdditionalTask(new PlatformStaticGenerator(functionDescriptor, origin, state)); + parentBodyCodegen.addAdditionalTask(new JvmStaticGenerator(functionDescriptor, origin, state)); } if (state.getClassBuilderMode() == ClassBuilderMode.LIGHT_CLASSES || isAbstractMethod(functionDescriptor, contextKind)) { @@ -209,9 +209,9 @@ public class FunctionCodegen { generateMethodBody(mv, functionDescriptor, methodContext, jvmSignature, strategy, memberCodegen); } else if (staticInCompanionObject) { - // native platformStatic foo() in companion object should delegate to the static native function moved to the outer class + // native @JvmStatic foo() in companion object should delegate to the static native function moved to the outer class mv.visitCode(); - FunctionDescriptor staticFunctionDescriptor = PlatformStaticGenerator.createStaticFunctionDescriptor(functionDescriptor); + FunctionDescriptor staticFunctionDescriptor = JvmStaticGenerator.createStaticFunctionDescriptor(functionDescriptor); JvmMethodSignature jvmMethodSignature = typeMapper.mapSignature(memberCodegen.getContext().accessibleDescriptor(staticFunctionDescriptor, null)); Type owningType = typeMapper.mapClass((ClassifierDescriptor) staticFunctionDescriptor.getContainingDeclaration()); diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/PlatformStaticGenerator.kt b/compiler/backend/src/org/jetbrains/kotlin/codegen/JvmStaticGenerator.kt similarity index 99% rename from compiler/backend/src/org/jetbrains/kotlin/codegen/PlatformStaticGenerator.kt rename to compiler/backend/src/org/jetbrains/kotlin/codegen/JvmStaticGenerator.kt index 8b81f678e63..449ee9198ee 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/PlatformStaticGenerator.kt +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/JvmStaticGenerator.kt @@ -30,7 +30,7 @@ import org.jetbrains.kotlin.resolve.jvm.jvmSignature.JvmMethodSignature import org.jetbrains.org.objectweb.asm.MethodVisitor import org.jetbrains.org.objectweb.asm.commons.InstructionAdapter -class PlatformStaticGenerator( +class JvmStaticGenerator( val descriptor: FunctionDescriptor, val declarationOrigin: JvmDeclarationOrigin, val state: GenerationState diff --git a/compiler/cli/src/org/jetbrains/kotlin/cli/jvm/PluginCliParser.kt b/compiler/cli/src/org/jetbrains/kotlin/cli/jvm/PluginCliParser.kt index c165900ba01..d1effdbeee5 100644 --- a/compiler/cli/src/org/jetbrains/kotlin/cli/jvm/PluginCliParser.kt +++ b/compiler/cli/src/org/jetbrains/kotlin/cli/jvm/PluginCliParser.kt @@ -16,21 +16,15 @@ package org.jetbrains.kotlin.cli.jvm -import kotlin.platform.* -import java.util.jar.JarFile -import java.util.jar.Attributes -import java.util.regex.Pattern import com.intellij.util.containers.MultiMap -import java.net.URLClassLoader -import java.net.URL -import java.io.File -import java.util.ServiceLoader -import java.io.IOException -import java.util.Enumeration import org.jetbrains.kotlin.cli.common.arguments.CommonCompilerArguments -import org.jetbrains.kotlin.utils.valuesToMap -import org.jetbrains.kotlin.config.CompilerConfiguration import org.jetbrains.kotlin.compiler.plugin.* +import org.jetbrains.kotlin.config.CompilerConfiguration +import org.jetbrains.kotlin.utils.valuesToMap +import java.io.File +import java.net.URL +import java.net.URLClassLoader +import java.util.* public object PluginCliParser { diff --git a/compiler/frontend.java/src/org/jetbrains/kotlin/resolve/jvm/checkers/declarationCheckers.kt b/compiler/frontend.java/src/org/jetbrains/kotlin/resolve/jvm/checkers/declarationCheckers.kt index c3e789c3c74..fdb70c38285 100644 --- a/compiler/frontend.java/src/org/jetbrains/kotlin/resolve/jvm/checkers/declarationCheckers.kt +++ b/compiler/frontend.java/src/org/jetbrains/kotlin/resolve/jvm/checkers/declarationCheckers.kt @@ -29,7 +29,7 @@ import org.jetbrains.kotlin.resolve.DeclarationChecker import org.jetbrains.kotlin.resolve.DescriptorToSourceUtils import org.jetbrains.kotlin.resolve.DescriptorUtils import org.jetbrains.kotlin.resolve.annotations.hasIntrinsicAnnotation -import org.jetbrains.kotlin.resolve.annotations.hasPlatformStaticAnnotation +import org.jetbrains.kotlin.resolve.annotations.hasJvmStaticAnnotation import org.jetbrains.kotlin.resolve.inline.InlineUtil import org.jetbrains.kotlin.resolve.jvm.annotations.hasJvmOverloadsAnnotation import org.jetbrains.kotlin.resolve.jvm.diagnostics.ErrorsJvm @@ -58,7 +58,7 @@ public class PlatformStaticAnnotationChecker : DeclarationChecker { diagnosticHolder: DiagnosticSink, bindingContext: BindingContext ) { - if (descriptor.hasPlatformStaticAnnotation()) { + if (descriptor.hasJvmStaticAnnotation()) { if (declaration is KtNamedFunction || declaration is KtProperty || declaration is KtPropertyAccessor) { checkDeclaration(declaration, descriptor, diagnosticHolder) } diff --git a/compiler/frontend/src/org/jetbrains/kotlin/idea/MainFunctionDetector.java b/compiler/frontend/src/org/jetbrains/kotlin/idea/MainFunctionDetector.java index 355734551eb..335f563f1bc 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/idea/MainFunctionDetector.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/idea/MainFunctionDetector.java @@ -108,7 +108,7 @@ public class MainFunctionDetector { DeclarationDescriptor containingDeclaration = functionDescriptor.getContainingDeclaration(); return containingDeclaration instanceof ClassDescriptor && ((ClassDescriptor) containingDeclaration).getKind().isSingleton() - && AnnotationUtilKt.hasPlatformStaticAnnotation(functionDescriptor); + && AnnotationUtilKt.hasJvmStaticAnnotation(functionDescriptor); } @Nullable diff --git a/compiler/frontend/src/org/jetbrains/kotlin/kdoc/parser/KDocLinkParser.kt b/compiler/frontend/src/org/jetbrains/kotlin/kdoc/parser/KDocLinkParser.kt index 957b204a9d3..187387ec09c 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/kdoc/parser/KDocLinkParser.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/kdoc/parser/KDocLinkParser.kt @@ -16,14 +16,13 @@ package org.jetbrains.kotlin.kdoc.parser +import com.intellij.lang.ASTNode +import com.intellij.lang.PsiBuilder +import com.intellij.lang.PsiBuilderFactory import com.intellij.lang.PsiParser import com.intellij.psi.tree.IElementType -import com.intellij.lang.PsiBuilder -import com.intellij.lang.ASTNode -import org.jetbrains.kotlin.lexer.KtTokens import org.jetbrains.kotlin.lexer.KotlinLexer -import com.intellij.lang.PsiBuilderFactory -import kotlin.platform.* +import org.jetbrains.kotlin.lexer.KtTokens /** * Parses the contents of a Markdown link in KDoc. Uses the standard Kotlin lexer. diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/AnnotationUtil.kt b/compiler/frontend/src/org/jetbrains/kotlin/resolve/AnnotationUtil.kt index 30377006271..950e93fb5a9 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/AnnotationUtil.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/AnnotationUtil.kt @@ -22,13 +22,11 @@ import org.jetbrains.kotlin.descriptors.PropertyAccessorDescriptor import org.jetbrains.kotlin.descriptors.annotations.AnnotationDescriptor import org.jetbrains.kotlin.descriptors.annotations.AnnotationUseSiteTarget import org.jetbrains.kotlin.descriptors.annotations.Annotations -import org.jetbrains.kotlin.lexer.KtTokens import org.jetbrains.kotlin.name.FqName import org.jetbrains.kotlin.resolve.DescriptorUtils -public fun DeclarationDescriptor.hasPlatformStaticAnnotation(): Boolean { - return getAnnotations().findAnnotation(FqName("kotlin.platform.platformStatic")) != null || - getAnnotations().findAnnotation(FqName("kotlin.jvm.JvmStatic")) != null +public fun DeclarationDescriptor.hasJvmStaticAnnotation(): Boolean { + return getAnnotations().findAnnotation(FqName("kotlin.jvm.JvmStatic")) != null } public fun DeclarationDescriptor.hasJvmSyntheticAnnotation(): Boolean { @@ -52,9 +50,9 @@ private fun CallableDescriptor.isPlatformStaticIn(predicate: (DeclarationDescrip is PropertyAccessorDescriptor -> { val propertyDescriptor = getCorrespondingProperty() predicate(propertyDescriptor.getContainingDeclaration()) && - (hasPlatformStaticAnnotation() || propertyDescriptor.hasPlatformStaticAnnotation()) + (hasJvmStaticAnnotation() || propertyDescriptor.hasJvmStaticAnnotation()) } - else -> predicate(getContainingDeclaration()) && hasPlatformStaticAnnotation() + else -> predicate(getContainingDeclaration()) && hasJvmStaticAnnotation() } public fun AnnotationDescriptor.argumentValue(parameterName: String): Any? { diff --git a/compiler/testData/asJava/lightClassStructure/PlatformStaticMethodsGenerics.kt b/compiler/testData/asJava/lightClassStructure/PlatformStaticMethodsGenerics.kt index 02bf9c86db7..bdcfefbc1ff 100644 --- a/compiler/testData/asJava/lightClassStructure/PlatformStaticMethodsGenerics.kt +++ b/compiler/testData/asJava/lightClassStructure/PlatformStaticMethodsGenerics.kt @@ -1,10 +1,8 @@ package test -import kotlin.platform.platformStatic - class PlatformStaticClass { companion object { - @platformStatic + @JvmStatic fun inClassObject() {} } diff --git a/compiler/testData/codegen/boxWithStdlib/callableReference/property/platformNamedAccessors.kt b/compiler/testData/codegen/boxWithStdlib/callableReference/property/platformNamedAccessors.kt index fde996e989d..298ab6b9117 100644 --- a/compiler/testData/codegen/boxWithStdlib/callableReference/property/platformNamedAccessors.kt +++ b/compiler/testData/codegen/boxWithStdlib/callableReference/property/platformNamedAccessors.kt @@ -1,10 +1,9 @@ -import kotlin.platform.platformName import kotlin.reflect.jvm.* var state: String = "value" - @platformName("getter") + @JvmName("getter") get - @platformName("setter") + @JvmName("setter") set fun box(): String { diff --git a/compiler/testData/codegen/boxWithStdlib/fullJdk/native/default.kt b/compiler/testData/codegen/boxWithStdlib/fullJdk/native/default.kt index 7673e836313..4cbcd2859b7 100644 --- a/compiler/testData/codegen/boxWithStdlib/fullJdk/native/default.kt +++ b/compiler/testData/codegen/boxWithStdlib/fullJdk/native/default.kt @@ -1,12 +1,11 @@ package foo import kotlin.jvm.* -import kotlin.platform.* object ObjWithNative { external fun foo(x: Int = 1): Double - @platformStatic external fun bar(l: Long, s: String = ""): Double + @JvmStatic external fun bar(l: Long, s: String = ""): Double } external fun topLevel(x: Int = 1): Double diff --git a/compiler/testData/codegen/boxWithStdlib/fullJdk/native/privateStatic.kt b/compiler/testData/codegen/boxWithStdlib/fullJdk/native/privateStatic.kt index 7ffa186034b..0c9618c38f9 100644 --- a/compiler/testData/codegen/boxWithStdlib/fullJdk/native/privateStatic.kt +++ b/compiler/testData/codegen/boxWithStdlib/fullJdk/native/privateStatic.kt @@ -1,9 +1,8 @@ import kotlin.jvm.* -import kotlin.platform.* class C { companion object { - private @platformStatic external fun foo() + private @JvmStatic external fun foo() } fun bar() { diff --git a/compiler/testData/codegen/boxWithStdlib/fullJdk/native/staticNative.kt b/compiler/testData/codegen/boxWithStdlib/fullJdk/native/staticNative.kt index 08a77c559b8..3785f1c3eb3 100644 --- a/compiler/testData/codegen/boxWithStdlib/fullJdk/native/staticNative.kt +++ b/compiler/testData/codegen/boxWithStdlib/fullJdk/native/staticNative.kt @@ -1,16 +1,15 @@ package foo import kotlin.jvm.* -import kotlin.platform.* class WithNative { companion object { - @platformStatic external fun bar(l: Long, s: String): Double + @JvmStatic external fun bar(l: Long, s: String): Double } } object ObjWithNative { - @platformStatic external fun bar(l: Long, s: String): Double + @JvmStatic external fun bar(l: Long, s: String): Double } fun box(): String { diff --git a/compiler/testData/codegen/boxWithStdlib/fullJdk/native/topLevel.kt b/compiler/testData/codegen/boxWithStdlib/fullJdk/native/topLevel.kt index 6d8dfe08f92..9aa663c2d56 100644 --- a/compiler/testData/codegen/boxWithStdlib/fullJdk/native/topLevel.kt +++ b/compiler/testData/codegen/boxWithStdlib/fullJdk/native/topLevel.kt @@ -1,7 +1,6 @@ package foo import kotlin.jvm.* -import kotlin.platform.* external fun bar(l: Long, s: String): Double diff --git a/compiler/testData/codegen/boxWithStdlib/jvmName/callableReference.kt b/compiler/testData/codegen/boxWithStdlib/jvmName/callableReference.kt index 34ad9022557..2296d1e7c57 100644 --- a/compiler/testData/codegen/boxWithStdlib/jvmName/callableReference.kt +++ b/compiler/testData/codegen/boxWithStdlib/jvmName/callableReference.kt @@ -1,6 +1,4 @@ -import kotlin.platform.* - -@platformName("bar") +@JvmName("bar") fun foo() = "foo" fun box(): String { diff --git a/compiler/testData/codegen/boxWithStdlib/jvmName/clashingErasure.kt b/compiler/testData/codegen/boxWithStdlib/jvmName/clashingErasure.kt index 369d924d8bb..b887c4a5b98 100644 --- a/compiler/testData/codegen/boxWithStdlib/jvmName/clashingErasure.kt +++ b/compiler/testData/codegen/boxWithStdlib/jvmName/clashingErasure.kt @@ -1,8 +1,6 @@ -import kotlin.platform.* - fun List.foo() = "foo" -@platformName("fooInt") +@JvmName("fooInt") fun List.foo() = "fooInt" fun box(): String { diff --git a/compiler/testData/codegen/boxWithStdlib/jvmName/classMembers.kt b/compiler/testData/codegen/boxWithStdlib/jvmName/classMembers.kt index f34e5507891..4c923efe3ec 100644 --- a/compiler/testData/codegen/boxWithStdlib/jvmName/classMembers.kt +++ b/compiler/testData/codegen/boxWithStdlib/jvmName/classMembers.kt @@ -1,5 +1,3 @@ -import kotlin.platform.* - // See: // http://kotlinlang.org/docs/reference/java-interop.html#handling-signature-clashes-with-platformname // https://youtrack.jetbrains.com/issue/KT-5524 @@ -10,18 +8,18 @@ val ints = listOf(1, 2, 3) class C { // Instance methods - @platformName("instMethodStr") + @JvmName("instMethodStr") fun instMethod(list: List): String = "instMethodStr" - @platformName("instMethodInt") + @JvmName("instMethodInt") fun instMethod(list: List): String = "instMethodInt" // Properties var rwProperty: Int - @platformName("get_rwProperty") + @JvmName("get_rwProperty") get() = 123 - @platformName("set_rwProperty") + @JvmName("set_rwProperty") set(v) {} var rwValue = 111 @@ -36,27 +34,27 @@ class C { class Inner - @platformName("extMethodWithGenericParamStr") + @JvmName("extMethodWithGenericParamStr") fun Inner.extMethodWithGenericParam(list: List): String = "extMethodWithGenericParamStr" - @platformName("extMethodWithGenericParamInt") + @JvmName("extMethodWithGenericParamInt") fun Inner.extMethodWithGenericParam(list: List): String = "extMethodWithGenericParamInt" // This is already covered by extMethodWithGenericParam(), but might be relevant for a platform // with extension method code generation strategy different from Java 6. - @platformName("extMethodWithGenericReceiverStr") + @JvmName("extMethodWithGenericReceiverStr") fun List.extMethodWithGenericReceiver(): String = "extMethodWithGenericReceiverStr" - @platformName("extMethodWithGenericReceiverInt") + @JvmName("extMethodWithGenericReceiverInt") fun List.extMethodWithGenericReceiver(): String = "extMethodWithGenericReceiverInt" // Extension method vs instance method - @platformName("ambigMethod1") + @JvmName("ambigMethod1") fun ambigMethod(str: String): String = "ambigMethod1" - @platformName("ambigMethod2") + @JvmName("ambigMethod2") fun String.ambigMethod(): String = "ambigMethod2" } diff --git a/compiler/testData/codegen/boxWithStdlib/jvmName/functionName.kt b/compiler/testData/codegen/boxWithStdlib/jvmName/functionName.kt index 77b1e214f94..74f4cc5343c 100644 --- a/compiler/testData/codegen/boxWithStdlib/jvmName/functionName.kt +++ b/compiler/testData/codegen/boxWithStdlib/jvmName/functionName.kt @@ -1,6 +1,4 @@ -import kotlin.platform.* - -@platformName("bar") +@JvmName("bar") fun foo() = "foo" fun box(): String { diff --git a/compiler/testData/codegen/boxWithStdlib/jvmName/propertyName.kt b/compiler/testData/codegen/boxWithStdlib/jvmName/propertyName.kt index b7be965ade4..ae4200bff07 100644 --- a/compiler/testData/codegen/boxWithStdlib/jvmName/propertyName.kt +++ b/compiler/testData/codegen/boxWithStdlib/jvmName/propertyName.kt @@ -1,9 +1,7 @@ -import kotlin.platform.* - var v: Int = 1 - @platformName("vget") + @JvmName("vget") get - @platformName("vset") + @JvmName("vset") set fun box(): String { diff --git a/compiler/testData/codegen/boxWithStdlib/jvmOverloads/companionObject.kt b/compiler/testData/codegen/boxWithStdlib/jvmOverloads/companionObject.kt index 2a2e97f8277..da9754b48e7 100644 --- a/compiler/testData/codegen/boxWithStdlib/jvmOverloads/companionObject.kt +++ b/compiler/testData/codegen/boxWithStdlib/jvmOverloads/companionObject.kt @@ -1,6 +1,6 @@ class C { companion object { - @kotlin.platform.platformStatic @kotlin.jvm.JvmOverloads public fun foo(o: String, k: String = "K"): String { + @JvmStatic @kotlin.jvm.JvmOverloads public fun foo(o: String, k: String = "K"): String { return o + k } } diff --git a/compiler/testData/codegen/boxWithStdlib/jvmStatic/closure.kt b/compiler/testData/codegen/boxWithStdlib/jvmStatic/closure.kt index fd341fd30fd..fed342abc8b 100644 --- a/compiler/testData/codegen/boxWithStdlib/jvmStatic/closure.kt +++ b/compiler/testData/codegen/boxWithStdlib/jvmStatic/closure.kt @@ -1,16 +1,14 @@ -import kotlin.platform.platformStatic - object A { val b: String = "OK" - @platformStatic val c: String = "OK" + @JvmStatic val c: String = "OK" - @platformStatic fun test1() : String { + @JvmStatic fun test1() : String { return {b}() } - @platformStatic fun test2() : String { + @JvmStatic fun test2() : String { return {test1()}() } @@ -18,11 +16,11 @@ object A { return {"1".test5()}() } - @platformStatic fun test4(): String { + @JvmStatic fun test4(): String { return {"1".test5()}() } - @platformStatic fun String.test5() : String { + @JvmStatic fun String.test5() : String { return {this + b}() } diff --git a/compiler/testData/codegen/boxWithStdlib/jvmStatic/convention.kt b/compiler/testData/codegen/boxWithStdlib/jvmStatic/convention.kt index 031eb58af6a..7f00683f2ca 100644 --- a/compiler/testData/codegen/boxWithStdlib/jvmStatic/convention.kt +++ b/compiler/testData/codegen/boxWithStdlib/jvmStatic/convention.kt @@ -1,5 +1,3 @@ -import kotlin.platform.platformStatic - class B(var s: Int = 0) { } @@ -10,7 +8,7 @@ object A { v += B(1000) } - @platformStatic fun B.plusAssign(b: B) { + @JvmStatic fun B.plusAssign(b: B) { this.s += b.s } } diff --git a/compiler/testData/codegen/boxWithStdlib/jvmStatic/default.kt b/compiler/testData/codegen/boxWithStdlib/jvmStatic/default.kt index 1062c340835..eff91f2c145 100644 --- a/compiler/testData/codegen/boxWithStdlib/jvmStatic/default.kt +++ b/compiler/testData/codegen/boxWithStdlib/jvmStatic/default.kt @@ -1,8 +1,6 @@ -import kotlin.platform.platformStatic - object A { - @platformStatic fun test(b: String = "OK") : String { + @JvmStatic fun test(b: String = "OK") : String { return b } } diff --git a/compiler/testData/codegen/boxWithStdlib/jvmStatic/explicitObject.kt b/compiler/testData/codegen/boxWithStdlib/jvmStatic/explicitObject.kt index 7a02908647f..36c74d18bc0 100644 --- a/compiler/testData/codegen/boxWithStdlib/jvmStatic/explicitObject.kt +++ b/compiler/testData/codegen/boxWithStdlib/jvmStatic/explicitObject.kt @@ -1,10 +1,8 @@ -import kotlin.platform.platformStatic - object AX { - @platformStatic val c: String = "OK" + @JvmStatic val c: String = "OK" - @platformStatic fun aStatic(): String { + @JvmStatic fun aStatic(): String { return AX.b() } @@ -12,7 +10,7 @@ object AX { return AX.b() } - @platformStatic fun b(): String { + @JvmStatic fun b(): String { return "OK" } diff --git a/compiler/testData/codegen/boxWithStdlib/jvmStatic/funAccess.kt b/compiler/testData/codegen/boxWithStdlib/jvmStatic/funAccess.kt index 1b7c7f1652f..61778fa2d76 100644 --- a/compiler/testData/codegen/boxWithStdlib/jvmStatic/funAccess.kt +++ b/compiler/testData/codegen/boxWithStdlib/jvmStatic/funAccess.kt @@ -1,5 +1,3 @@ -import kotlin.platform.platformStatic - var holder = "" fun getA(): A { @@ -8,7 +6,7 @@ fun getA(): A { } object A { - @platformStatic fun a(): String { + @JvmStatic fun a(): String { return holder } } diff --git a/compiler/testData/codegen/boxWithStdlib/jvmStatic/inline.kt b/compiler/testData/codegen/boxWithStdlib/jvmStatic/inline.kt index 64649ebba7c..679f2c4c3c8 100644 --- a/compiler/testData/codegen/boxWithStdlib/jvmStatic/inline.kt +++ b/compiler/testData/codegen/boxWithStdlib/jvmStatic/inline.kt @@ -1,8 +1,6 @@ -import kotlin.platform.platformStatic - object A { - @platformStatic inline fun test(b: String = "OK") : String { + @JvmStatic inline fun test(b: String = "OK") : String { return b } } diff --git a/compiler/testData/codegen/boxWithStdlib/jvmStatic/postfixInc.kt b/compiler/testData/codegen/boxWithStdlib/jvmStatic/postfixInc.kt index 0e220c5314f..d03947f0c6e 100644 --- a/compiler/testData/codegen/boxWithStdlib/jvmStatic/postfixInc.kt +++ b/compiler/testData/codegen/boxWithStdlib/jvmStatic/postfixInc.kt @@ -1,14 +1,12 @@ -import kotlin.platform.platformStatic - object A { - @platformStatic var a: Int = 1 + @JvmStatic var a: Int = 1 var b: Int = 1 - @platformStatic get + @JvmStatic get var c: Int = 1 - @platformStatic set + @JvmStatic set } diff --git a/compiler/testData/codegen/boxWithStdlib/jvmStatic/prefixInc.kt b/compiler/testData/codegen/boxWithStdlib/jvmStatic/prefixInc.kt index 920367ee0c0..4dc897fb233 100644 --- a/compiler/testData/codegen/boxWithStdlib/jvmStatic/prefixInc.kt +++ b/compiler/testData/codegen/boxWithStdlib/jvmStatic/prefixInc.kt @@ -1,14 +1,12 @@ -import kotlin.platform.platformStatic - object A { - @platformStatic var a: Int = 1 + @JvmStatic var a: Int = 1 var b: Int = 1 - @platformStatic get + @JvmStatic get var c: Int = 1 - @platformStatic set + @JvmStatic set } diff --git a/compiler/testData/codegen/boxWithStdlib/jvmStatic/privateMethod.kt b/compiler/testData/codegen/boxWithStdlib/jvmStatic/privateMethod.kt index 101e87b5664..8bd7f0c2e69 100644 --- a/compiler/testData/codegen/boxWithStdlib/jvmStatic/privateMethod.kt +++ b/compiler/testData/codegen/boxWithStdlib/jvmStatic/privateMethod.kt @@ -1,8 +1,6 @@ -import kotlin.platform.platformStatic - object A { - private @platformStatic fun a(): String { + private @JvmStatic fun a(): String { return "OK" } diff --git a/compiler/testData/codegen/boxWithStdlib/jvmStatic/propertyAccess.kt b/compiler/testData/codegen/boxWithStdlib/jvmStatic/propertyAccess.kt index e182f073f1c..b436519e629 100644 --- a/compiler/testData/codegen/boxWithStdlib/jvmStatic/propertyAccess.kt +++ b/compiler/testData/codegen/boxWithStdlib/jvmStatic/propertyAccess.kt @@ -1,5 +1,3 @@ -import kotlin.platform.platformStatic - var holder = "" fun getA(): A { @@ -9,13 +7,13 @@ fun getA(): A { object A { - @platformStatic var a: Int = 1 + @JvmStatic var a: Int = 1 var b: Int = 1 - @platformStatic get + @JvmStatic get var c: Int = 1 - @platformStatic set + @JvmStatic set } diff --git a/compiler/testData/codegen/boxWithStdlib/jvmStatic/propertyAsDefault.kt b/compiler/testData/codegen/boxWithStdlib/jvmStatic/propertyAsDefault.kt index 819790951c9..a23b005d223 100644 --- a/compiler/testData/codegen/boxWithStdlib/jvmStatic/propertyAsDefault.kt +++ b/compiler/testData/codegen/boxWithStdlib/jvmStatic/propertyAsDefault.kt @@ -1,7 +1,5 @@ -import kotlin.platform.platformStatic - object X { - @platformStatic val x = "OK" + @JvmStatic val x = "OK" fun fn(value : String = x): String = value } diff --git a/compiler/testData/codegen/boxWithStdlib/jvmStatic/simple.kt b/compiler/testData/codegen/boxWithStdlib/jvmStatic/simple.kt index 8a2ac4d42dc..c65413f4634 100644 --- a/compiler/testData/codegen/boxWithStdlib/jvmStatic/simple.kt +++ b/compiler/testData/codegen/boxWithStdlib/jvmStatic/simple.kt @@ -1,16 +1,14 @@ -import kotlin.platform.platformStatic - object A { val b: String = "OK" - @platformStatic val c: String = "OK" + @JvmStatic val c: String = "OK" - @platformStatic fun test1() : String { + @JvmStatic fun test1() : String { return b } - @platformStatic fun test2() : String { + @JvmStatic fun test2() : String { return test1() } @@ -18,11 +16,11 @@ object A { return "1".test5() } - @platformStatic fun test4(): String { + @JvmStatic fun test4(): String { return "1".test5() } - @platformStatic fun String.test5() : String { + @JvmStatic fun String.test5() : String { return this + b } } diff --git a/compiler/testData/codegen/boxWithStdlib/jvmStatic/syntheticAccessor.kt b/compiler/testData/codegen/boxWithStdlib/jvmStatic/syntheticAccessor.kt index 0cb5cc05a08..274a68615e1 100644 --- a/compiler/testData/codegen/boxWithStdlib/jvmStatic/syntheticAccessor.kt +++ b/compiler/testData/codegen/boxWithStdlib/jvmStatic/syntheticAccessor.kt @@ -1,8 +1,6 @@ -import kotlin.platform.* - class C { companion object { - private @platformStatic fun foo(): String { + private @JvmStatic fun foo(): String { return "OK" } } diff --git a/compiler/testData/codegen/boxWithStdlib/reflection/call/returnUnit.kt b/compiler/testData/codegen/boxWithStdlib/reflection/call/returnUnit.kt index 099552c8afe..66bd1180355 100644 --- a/compiler/testData/codegen/boxWithStdlib/reflection/call/returnUnit.kt +++ b/compiler/testData/codegen/boxWithStdlib/reflection/call/returnUnit.kt @@ -7,7 +7,7 @@ class A { } object O { - @kotlin.platform.platformStatic fun baz() {} + @JvmStatic fun baz() {} } fun nullableUnit(unit: Boolean): Unit? = if (unit) Unit else null diff --git a/compiler/testData/codegen/boxWithStdlib/reflection/genericSignature/kt6106.kt b/compiler/testData/codegen/boxWithStdlib/reflection/genericSignature/kt6106.kt index 4fdd56f1b90..699deb27048 100644 --- a/compiler/testData/codegen/boxWithStdlib/reflection/genericSignature/kt6106.kt +++ b/compiler/testData/codegen/boxWithStdlib/reflection/genericSignature/kt6106.kt @@ -1,13 +1,11 @@ package test -import kotlin.platform.platformStatic - open class B class A { companion object { - @platformStatic + @JvmStatic fun a(s: T) : T { return s } diff --git a/compiler/testData/compileJavaAgainstKotlin/platformStatic/simpleClassObject.kt b/compiler/testData/compileJavaAgainstKotlin/platformStatic/simpleClassObject.kt index 2eb43be3527..60b43546fca 100644 --- a/compiler/testData/compileJavaAgainstKotlin/platformStatic/simpleClassObject.kt +++ b/compiler/testData/compileJavaAgainstKotlin/platformStatic/simpleClassObject.kt @@ -1,20 +1,18 @@ package test -import kotlin.platform.platformStatic - class A { companion object { val b: String = "OK" - @platformStatic fun test1() { + @JvmStatic fun test1() { b test2() test3() "".test4() } - @platformStatic fun test2() { + @JvmStatic fun test2() { b } @@ -22,7 +20,7 @@ class A { } - @platformStatic fun String.test4() { + @JvmStatic fun String.test4() { b } } diff --git a/compiler/testData/compileJavaAgainstKotlin/platformStatic/simpleClassObject.txt b/compiler/testData/compileJavaAgainstKotlin/platformStatic/simpleClassObject.txt index abeb4d1f9f7..9e98f50febf 100644 --- a/compiler/testData/compileJavaAgainstKotlin/platformStatic/simpleClassObject.txt +++ b/compiler/testData/compileJavaAgainstKotlin/platformStatic/simpleClassObject.txt @@ -8,10 +8,10 @@ public final class A { public companion object Companion { private constructor Companion() public final val b: kotlin.String - @kotlin.platform.platformStatic() public final fun test1(): kotlin.Unit - @kotlin.platform.platformStatic() public final fun test2(): kotlin.Unit + @kotlin.jvm.JvmStatic() public final fun test1(): kotlin.Unit + @kotlin.jvm.JvmStatic() public final fun test2(): kotlin.Unit public final fun test3(): kotlin.Unit - @kotlin.platform.platformStatic() public final fun kotlin.String.test4(): kotlin.Unit + @kotlin.jvm.JvmStatic() public final fun kotlin.String.test4(): kotlin.Unit } } diff --git a/compiler/testData/compileJavaAgainstKotlin/platformStatic/simpleClassObjectProperty.kt b/compiler/testData/compileJavaAgainstKotlin/platformStatic/simpleClassObjectProperty.kt index dd33c43c3a4..aae3565e9ae 100644 --- a/compiler/testData/compileJavaAgainstKotlin/platformStatic/simpleClassObjectProperty.kt +++ b/compiler/testData/compileJavaAgainstKotlin/platformStatic/simpleClassObjectProperty.kt @@ -1,14 +1,12 @@ package test -import kotlin.platform.platformStatic - class A { companion object { - @platformStatic val b: String = "OK" + @JvmStatic val b: String = "OK" var A.c: String - @platformStatic get() = "OK" - @platformStatic set(t: String) {} + @JvmStatic get() = "OK" + @JvmStatic set(t: String) {} } } diff --git a/compiler/testData/compileJavaAgainstKotlin/platformStatic/simpleClassObjectProperty.txt b/compiler/testData/compileJavaAgainstKotlin/platformStatic/simpleClassObjectProperty.txt index 236082f7acd..61599384f11 100644 --- a/compiler/testData/compileJavaAgainstKotlin/platformStatic/simpleClassObjectProperty.txt +++ b/compiler/testData/compileJavaAgainstKotlin/platformStatic/simpleClassObjectProperty.txt @@ -7,7 +7,7 @@ public final class A { public companion object Companion { private constructor Companion() - @kotlin.platform.platformStatic() public final val b: kotlin.String + @kotlin.jvm.JvmStatic() public final val b: kotlin.String public final var test.A.c: kotlin.String } } diff --git a/compiler/testData/compileJavaAgainstKotlin/platformStatic/simpleObject.kt b/compiler/testData/compileJavaAgainstKotlin/platformStatic/simpleObject.kt index 0386e00e355..5ab9ac15552 100644 --- a/compiler/testData/compileJavaAgainstKotlin/platformStatic/simpleObject.kt +++ b/compiler/testData/compileJavaAgainstKotlin/platformStatic/simpleObject.kt @@ -1,19 +1,17 @@ package test -import kotlin.platform.platformStatic - object A { val b: String = "OK" - @platformStatic fun test1() { + @JvmStatic fun test1() { b test2() test3() "".test4() } - @platformStatic fun test2() { + @JvmStatic fun test2() { b } @@ -21,7 +19,7 @@ object A { } - @platformStatic fun String.test4() { + @JvmStatic fun String.test4() { b } } diff --git a/compiler/testData/compileJavaAgainstKotlin/platformStatic/simpleObject.txt b/compiler/testData/compileJavaAgainstKotlin/platformStatic/simpleObject.txt index ce97783e4e1..dba7afe114b 100644 --- a/compiler/testData/compileJavaAgainstKotlin/platformStatic/simpleObject.txt +++ b/compiler/testData/compileJavaAgainstKotlin/platformStatic/simpleObject.txt @@ -5,10 +5,10 @@ public fun main(/*0*/ kotlin.Array): kotlin.Unit public object A { private constructor A() public final val b: kotlin.String - @kotlin.platform.platformStatic() public final fun test1(): kotlin.Unit - @kotlin.platform.platformStatic() public final fun test2(): kotlin.Unit + @kotlin.jvm.JvmStatic() public final fun test1(): kotlin.Unit + @kotlin.jvm.JvmStatic() public final fun test2(): kotlin.Unit public final fun test3(): kotlin.Unit - @kotlin.platform.platformStatic() public final fun kotlin.String.test4(): kotlin.Unit + @kotlin.jvm.JvmStatic() public final fun kotlin.String.test4(): kotlin.Unit } public/*package*/ open class Test { diff --git a/compiler/testData/compileJavaAgainstKotlin/platformStatic/simpleObjectProperty.kt b/compiler/testData/compileJavaAgainstKotlin/platformStatic/simpleObjectProperty.kt index cb9c0cafd44..fc2f839f3d6 100644 --- a/compiler/testData/compileJavaAgainstKotlin/platformStatic/simpleObjectProperty.kt +++ b/compiler/testData/compileJavaAgainstKotlin/platformStatic/simpleObjectProperty.kt @@ -1,13 +1,11 @@ package test -import kotlin.platform.platformStatic - object A { - @platformStatic val b: String = "OK" + @JvmStatic val b: String = "OK" var A.c: String - @platformStatic get() = "OK" - @platformStatic set(t: String) {} + @JvmStatic get() = "OK" + @JvmStatic set(t: String) {} } diff --git a/compiler/testData/compileJavaAgainstKotlin/platformStatic/simpleObjectProperty.txt b/compiler/testData/compileJavaAgainstKotlin/platformStatic/simpleObjectProperty.txt index b5e0765a39a..67eefc6ff17 100644 --- a/compiler/testData/compileJavaAgainstKotlin/platformStatic/simpleObjectProperty.txt +++ b/compiler/testData/compileJavaAgainstKotlin/platformStatic/simpleObjectProperty.txt @@ -4,7 +4,7 @@ public fun main(/*0*/ kotlin.Array): kotlin.Unit public object A { private constructor A() - @kotlin.platform.platformStatic() public final val b: kotlin.String + @kotlin.jvm.JvmStatic() public final val b: kotlin.String public final var test.A.c: kotlin.String } diff --git a/compiler/testData/compileJavaAgainstKotlin/property/platformName/PlatformName.kt b/compiler/testData/compileJavaAgainstKotlin/property/platformName/PlatformName.kt index 26d8d9e1441..6700f9a1e44 100644 --- a/compiler/testData/compileJavaAgainstKotlin/property/platformName/PlatformName.kt +++ b/compiler/testData/compileJavaAgainstKotlin/property/platformName/PlatformName.kt @@ -1,9 +1,7 @@ package test -import kotlin.platform.* - var v: Int = 1 - @platformName("vget") + @JvmName("vget") get - @platformName("vset") + @JvmName("vset") set diff --git a/compiler/testData/compileKotlinAgainstKotlin/PlatformNames.A.kt b/compiler/testData/compileKotlinAgainstKotlin/PlatformNames.A.kt index bff0200f855..ce8f37f27ab 100644 --- a/compiler/testData/compileKotlinAgainstKotlin/PlatformNames.A.kt +++ b/compiler/testData/compileKotlinAgainstKotlin/PlatformNames.A.kt @@ -1,12 +1,10 @@ package lib -import kotlin.platform.* - -@platformName("bar") +@JvmName("bar") fun foo() = "foo" var v: Int = 1 - @platformName("vget") + @JvmName("vget") get - @platformName("vset") + @JvmName("vset") set diff --git a/compiler/testData/loadJava/compiledKotlinWithStdlib/platformNames/functionName.kt b/compiler/testData/loadJava/compiledKotlinWithStdlib/platformNames/functionName.kt index 2153834c8f8..558c2082036 100644 --- a/compiler/testData/loadJava/compiledKotlinWithStdlib/platformNames/functionName.kt +++ b/compiler/testData/loadJava/compiledKotlinWithStdlib/platformNames/functionName.kt @@ -1,18 +1,16 @@ package test -import kotlin.platform.* - annotation class A(val s: String) -@platformName("bar") @A("1") +@JvmName("bar") fun foo() = "foo" @field:A("2") var v: Int = 1 - @platformName("vget") @A("3") + @JvmName("vget") get - @platformName("vset") @A("4") + @JvmName("vset") set diff --git a/compiler/testData/loadJava/compiledKotlinWithStdlib/platformNames/functionName.txt b/compiler/testData/loadJava/compiledKotlinWithStdlib/platformNames/functionName.txt index 1b02e351c5d..bf665ff0785 100644 --- a/compiler/testData/loadJava/compiledKotlinWithStdlib/platformNames/functionName.txt +++ b/compiler/testData/loadJava/compiledKotlinWithStdlib/platformNames/functionName.txt @@ -1,9 +1,9 @@ package test @field:test.A(s = "2") public var v: kotlin.Int - @kotlin.platform.platformName(name = "vget") @test.A(s = "3") public fun (): kotlin.Int - @kotlin.platform.platformName(name = "vset") @test.A(s = "4") public fun (/*0*/ : kotlin.Int): kotlin.Unit -@kotlin.platform.platformName(name = "bar") @test.A(s = "1") public fun foo(): kotlin.String + @test.A(s = "3") @kotlin.jvm.JvmName(name = "vget") public fun (): kotlin.Int + @test.A(s = "4") @kotlin.jvm.JvmName(name = "vset") public fun (/*0*/ : kotlin.Int): kotlin.Unit +@test.A(s = "1") @kotlin.jvm.JvmName(name = "bar") public fun foo(): kotlin.String public final annotation class A : kotlin.Annotation { /*primary*/ public constructor A(/*0*/ s: kotlin.String) diff --git a/core/descriptors/src/org/jetbrains/kotlin/resolve/DescriptorUtils.java b/core/descriptors/src/org/jetbrains/kotlin/resolve/DescriptorUtils.java index 38e1828b256..f446718e5b2 100644 --- a/core/descriptors/src/org/jetbrains/kotlin/resolve/DescriptorUtils.java +++ b/core/descriptors/src/org/jetbrains/kotlin/resolve/DescriptorUtils.java @@ -50,7 +50,6 @@ public class DescriptorUtils { public static final Name ENUM_VALUES = Name.identifier("values"); public static final Name ENUM_VALUE_OF = Name.identifier("valueOf"); public static final FqName JVM_NAME = new FqName("kotlin.jvm.JvmName"); - public static final FqName PLATFORM_NAME = new FqName("kotlin.platform.platformName"); public static final FqName VOLATILE = new FqName("kotlin.jvm.Volatile"); public static final FqName SYNCHRONIZED = new FqName("kotlin.jvm.Synchronized"); @@ -531,9 +530,6 @@ public class DescriptorUtils { @Nullable public static AnnotationDescriptor getJvmNameAnnotation(@NotNull Annotations annotations) { AnnotationWithTarget jvmName = Annotations.Companion.findAnyAnnotation(annotations, JVM_NAME); - if (jvmName == null) { - jvmName = Annotations.Companion.findAnyAnnotation(annotations, PLATFORM_NAME); - } return jvmName == null ? null : jvmName.getAnnotation(); } diff --git a/core/reflection.jvm/src/kotlin/reflect/jvm/internal/KFunctionImpl.kt b/core/reflection.jvm/src/kotlin/reflect/jvm/internal/KFunctionImpl.kt index 400b8e57b97..bc575cbab11 100644 --- a/core/reflection.jvm/src/kotlin/reflect/jvm/internal/KFunctionImpl.kt +++ b/core/reflection.jvm/src/kotlin/reflect/jvm/internal/KFunctionImpl.kt @@ -61,7 +61,6 @@ internal open class KFunctionImpl protected constructor( is Constructor<*> -> FunctionCaller.Constructor(member) is Method -> when { !Modifier.isStatic(member.modifiers) -> FunctionCaller.InstanceMethod(member) - descriptor.annotations.findAnnotation(PLATFORM_STATIC) != null, descriptor.annotations.findAnnotation(JVM_STATIC) != null -> FunctionCaller.JvmStaticInObject(member) @@ -90,7 +89,6 @@ internal open class KFunctionImpl protected constructor( when (member) { is Constructor<*> -> FunctionCaller.Constructor(member) is Method -> when { - descriptor.annotations.findAnnotation(PLATFORM_STATIC) != null, descriptor.annotations.findAnnotation(JVM_STATIC) != null -> FunctionCaller.JvmStaticInObject(member) diff --git a/core/reflection.jvm/src/kotlin/reflect/jvm/internal/KPropertyImpl.kt b/core/reflection.jvm/src/kotlin/reflect/jvm/internal/KPropertyImpl.kt index 8938763e2ed..34a904120a9 100644 --- a/core/reflection.jvm/src/kotlin/reflect/jvm/internal/KPropertyImpl.kt +++ b/core/reflection.jvm/src/kotlin/reflect/jvm/internal/KPropertyImpl.kt @@ -97,7 +97,6 @@ private fun KPropertyImpl.Accessor<*>.computeCallerForAccessor(isGetter: Boolean return false } fun isJvmStaticProperty() = - property.descriptor.annotations.findAnnotation(PLATFORM_STATIC) != null || property.descriptor.annotations.findAnnotation(JVM_STATIC) != null diff --git a/core/reflection.jvm/src/kotlin/reflect/jvm/internal/util.kt b/core/reflection.jvm/src/kotlin/reflect/jvm/internal/util.kt index 49cf8095b61..9cabf9c8204 100644 --- a/core/reflection.jvm/src/kotlin/reflect/jvm/internal/util.kt +++ b/core/reflection.jvm/src/kotlin/reflect/jvm/internal/util.kt @@ -19,7 +19,6 @@ package kotlin.reflect.jvm.internal import org.jetbrains.kotlin.name.FqName import kotlin.reflect.IllegalCallableAccessException -internal val PLATFORM_STATIC = FqName("kotlin.platform.platformStatic") internal val JVM_STATIC = FqName("kotlin.jvm.JvmStatic") // TODO: wrap other exceptions diff --git a/core/runtime.jvm/src/kotlin/jvm/internal/CallableReference.java b/core/runtime.jvm/src/kotlin/jvm/internal/CallableReference.java index e1a87f2e193..ad3bd33acf4 100644 --- a/core/runtime.jvm/src/kotlin/jvm/internal/CallableReference.java +++ b/core/runtime.jvm/src/kotlin/jvm/internal/CallableReference.java @@ -45,7 +45,7 @@ public abstract class CallableReference implements KCallable { } /** - * @return Kotlin name of the callable, the one which was declared in the source code (@platformName doesn't change it) + * @return Kotlin name of the callable, the one which was declared in the source code (@JvmName doesn't change it) */ @Override public String getName() { diff --git a/idea/idea-completion/testData/smart/callableReference/NoQualifier11.kt.disabled b/idea/idea-completion/testData/smart/callableReference/NoQualifier11.kt.disabled index 5afc765192b..9f651fbc7ce 100644 --- a/idea/idea-completion/testData/smart/callableReference/NoQualifier11.kt.disabled +++ b/idea/idea-completion/testData/smart/callableReference/NoQualifier11.kt.disabled @@ -1,5 +1,3 @@ -import kotlin.platform.platformName - class C(i: Int){ class Nested inner class Inner @@ -9,10 +7,10 @@ class C(i: Int){ } } -platformName("foo1") +@JvmName("foo1") fun foo(p: () -> C.Nested){} -platformName("foo2") +@JvmName("foo2") fun foo(p: () -> C.Inner){} // EXIST: ::Nested diff --git a/idea/testData/copyPaste/conversion/AddImportsClassInSamePackage.dependency.kt b/idea/testData/copyPaste/conversion/AddImportsClassInSamePackage.dependency.kt index c5df11fc1e2..d9509297ce8 100644 --- a/idea/testData/copyPaste/conversion/AddImportsClassInSamePackage.dependency.kt +++ b/idea/testData/copyPaste/conversion/AddImportsClassInSamePackage.dependency.kt @@ -1,8 +1,6 @@ package ppp -import kotlin.platform.platformStatic - public object Dependency { - @platformStatic + @JvmStatic public val FIELD: Int = 1 } \ No newline at end of file diff --git a/idea/testData/findUsages/kotlin/companionObject/javaUsage.0.kt b/idea/testData/findUsages/kotlin/companionObject/javaUsage.0.kt index 51f5c27fda8..b6044109f58 100644 --- a/idea/testData/findUsages/kotlin/companionObject/javaUsage.0.kt +++ b/idea/testData/findUsages/kotlin/companionObject/javaUsage.0.kt @@ -1,14 +1,12 @@ // PSI_ELEMENT: org.jetbrains.kotlin.psi.KtObjectDeclaration // OPTIONS: usages -import kotlin.platform.platformStatic - class Foo { companion object { fun f() { } - @platformStatic fun s() { + @JvmStatic fun s() { } val CONST = 42 diff --git a/idea/testData/inspections/unusedSymbol/object/companionObjectUsedInJava.kt b/idea/testData/inspections/unusedSymbol/object/companionObjectUsedInJava.kt index 636b40523b6..9af462362ec 100644 --- a/idea/testData/inspections/unusedSymbol/object/companionObjectUsedInJava.kt +++ b/idea/testData/inspections/unusedSymbol/object/companionObjectUsedInJava.kt @@ -1,7 +1,5 @@ package companionObjectUsedInJava -import kotlin.platform.platformStatic - class A { companion object { val CONST = 42 @@ -10,7 +8,7 @@ class A { class B { companion object { - platformStatic fun foo() { + @JvmStatic fun foo() { } } } @@ -23,7 +21,7 @@ class C { class D { companion object Named { - platformStatic fun foo() { + @JvmStatic fun foo() { } } } diff --git a/idea/testData/inspections/unusedSymbol/object/companionObjectWithStatics.kt b/idea/testData/inspections/unusedSymbol/object/companionObjectWithStatics.kt index 6aafba50900..2d824484be0 100644 --- a/idea/testData/inspections/unusedSymbol/object/companionObjectWithStatics.kt +++ b/idea/testData/inspections/unusedSymbol/object/companionObjectWithStatics.kt @@ -2,7 +2,7 @@ package companionObjectWithStatics class Foo { companion object { - platformStatic fun foo() { + @JvmStatic fun foo() { } val CONST = 111 diff --git a/idea/testData/inspections/unusedSymbol/object/unusedButEntryPointMain.kt b/idea/testData/inspections/unusedSymbol/object/unusedButEntryPointMain.kt index 494a26506a8..c17aa223eba 100644 --- a/idea/testData/inspections/unusedSymbol/object/unusedButEntryPointMain.kt +++ b/idea/testData/inspections/unusedSymbol/object/unusedButEntryPointMain.kt @@ -2,10 +2,8 @@ package entryPoint // WITH_RUNTIME -import kotlin.platform.platformStatic - object EntryPoint { - @platformStatic public fun main(args: Array) { + @JvmStatic public fun main(args: Array) { } } diff --git a/idea/testData/inspections/unusedSymbol/property/serialVersionUid.kt b/idea/testData/inspections/unusedSymbol/property/serialVersionUid.kt index 92ed1eab1c1..65b423a9016 100644 --- a/idea/testData/inspections/unusedSymbol/property/serialVersionUid.kt +++ b/idea/testData/inspections/unusedSymbol/property/serialVersionUid.kt @@ -1,10 +1,8 @@ // FULL_JDK -import kotlin.platform.platformStatic - class Klass : java.io.Serializable { companion object { - private platformStatic val serialVersionUID: Long = 239 + private @JvmStatic val serialVersionUID: Long = 239 } } diff --git a/idea/testData/refactoring/rename/companionObject/after/toBeRenamed.kt b/idea/testData/refactoring/rename/companionObject/after/toBeRenamed.kt index 4738d34f5d0..68d327efcc4 100644 --- a/idea/testData/refactoring/rename/companionObject/after/toBeRenamed.kt +++ b/idea/testData/refactoring/rename/companionObject/after/toBeRenamed.kt @@ -3,7 +3,7 @@ class Foo { fun f() { } - platformStatic fun s() { + @JvmStatic fun s() { } val CONST = 42 diff --git a/idea/testData/refactoring/rename/companionObject/before/toBeRenamed.kt b/idea/testData/refactoring/rename/companionObject/before/toBeRenamed.kt index 06743a34047..cfe3a637839 100644 --- a/idea/testData/refactoring/rename/companionObject/before/toBeRenamed.kt +++ b/idea/testData/refactoring/rename/companionObject/before/toBeRenamed.kt @@ -3,7 +3,7 @@ class Foo { fun f() { } - platformStatic fun s() { + @JvmStatic fun s() { } val CONST = 42 diff --git a/idea/testData/refactoring/rename/companionObjectWithDefaultName/after/toBeRenamed.kt b/idea/testData/refactoring/rename/companionObjectWithDefaultName/after/toBeRenamed.kt index 4738d34f5d0..68d327efcc4 100644 --- a/idea/testData/refactoring/rename/companionObjectWithDefaultName/after/toBeRenamed.kt +++ b/idea/testData/refactoring/rename/companionObjectWithDefaultName/after/toBeRenamed.kt @@ -3,7 +3,7 @@ class Foo { fun f() { } - platformStatic fun s() { + @JvmStatic fun s() { } val CONST = 42 diff --git a/idea/testData/refactoring/rename/companionObjectWithDefaultName/before/toBeRenamed.kt b/idea/testData/refactoring/rename/companionObjectWithDefaultName/before/toBeRenamed.kt index ec134e6bec4..c47a2494c7b 100644 --- a/idea/testData/refactoring/rename/companionObjectWithDefaultName/before/toBeRenamed.kt +++ b/idea/testData/refactoring/rename/companionObjectWithDefaultName/before/toBeRenamed.kt @@ -3,7 +3,7 @@ class Foo { fun f() { } - platformStatic fun s() { + @JvmStatic fun s() { } val CONST = 42 diff --git a/idea/testData/refactoring/rename/companionObjectWithNameMatchingClass/after/toBeRenamed.kt b/idea/testData/refactoring/rename/companionObjectWithNameMatchingClass/after/toBeRenamed.kt index 06743a34047..cfe3a637839 100644 --- a/idea/testData/refactoring/rename/companionObjectWithNameMatchingClass/after/toBeRenamed.kt +++ b/idea/testData/refactoring/rename/companionObjectWithNameMatchingClass/after/toBeRenamed.kt @@ -3,7 +3,7 @@ class Foo { fun f() { } - platformStatic fun s() { + @JvmStatic fun s() { } val CONST = 42 diff --git a/idea/testData/refactoring/rename/companionObjectWithNameMatchingClass/before/toBeRenamed.kt b/idea/testData/refactoring/rename/companionObjectWithNameMatchingClass/before/toBeRenamed.kt index 5ea6079dd5a..75367eca3ea 100644 --- a/idea/testData/refactoring/rename/companionObjectWithNameMatchingClass/before/toBeRenamed.kt +++ b/idea/testData/refactoring/rename/companionObjectWithNameMatchingClass/before/toBeRenamed.kt @@ -3,7 +3,7 @@ class Foo { fun f() { } - platformStatic fun s() { + @JvmStatic fun s() { } val CONST = 42 diff --git a/idea/testData/resolve/referenceInJava/dependencies.kt b/idea/testData/resolve/referenceInJava/dependencies.kt index b86cd5da1e1..62f969bc364 100644 --- a/idea/testData/resolve/referenceInJava/dependencies.kt +++ b/idea/testData/resolve/referenceInJava/dependencies.kt @@ -1,7 +1,5 @@ package k -import kotlin.platform.platformStatic - public class Class() { public val prop: Int = 0 fun function() = 1 @@ -32,7 +30,7 @@ public interface StaticFieldInClassObjectInTrait { } object PlatformStaticFun { - platformStatic + @JvmStatic fun test() { } } diff --git a/idea/testData/run/ClassesAndObjects/module/src/test.kt b/idea/testData/run/ClassesAndObjects/module/src/test.kt index f1ea508617e..ec4caadccc5 100644 --- a/idea/testData/run/ClassesAndObjects/module/src/test.kt +++ b/idea/testData/run/ClassesAndObjects/module/src/test.kt @@ -1,11 +1,9 @@ package q -import kotlin.platform.platformStatic - // RUN: q.Foo object Foo { // RUN: q.Foo - @platformStatic fun main(s: Array) { + @JvmStatic fun main(s: Array) { println("Foo") } @@ -13,7 +11,7 @@ object Foo { class InnerFoo { companion object { // RUN: q.Foo.InnerFoo - @platformStatic fun main(s: Array) { + @JvmStatic fun main(s: Array) { println("InnerFoo") } } @@ -22,7 +20,7 @@ object Foo { // RUN: q.Foo class InnerFoo2 { // RUN: q.Foo - @platformStatic fun main(s: Array) { + @JvmStatic fun main(s: Array) { println("InnerFoo") } } @@ -40,7 +38,7 @@ object Foo2 { class Bar { companion object { // RUN: q.Bar - @platformStatic fun main(s: Array) { + @JvmStatic fun main(s: Array) { println("Bar") } } @@ -59,7 +57,7 @@ class Bar2 { // RUN: q.TestKt class Baz { // RUN: q.TestKt - platformStatic fun main(s: Array) { + @JvmStatic fun main(s: Array) { println("Baz") } } diff --git a/idea/testData/run/MainInTest/module/src/mainInCompanion.kt b/idea/testData/run/MainInTest/module/src/mainInCompanion.kt index fdbd8ab5eea..6b25ca681f1 100644 --- a/idea/testData/run/MainInTest/module/src/mainInCompanion.kt +++ b/idea/testData/run/MainInTest/module/src/mainInCompanion.kt @@ -1,11 +1,8 @@ package companions -import kotlin.platform.platformName -import kotlin.platform.platformStatic - class A { companion object { - @platformStatic + @JvmStatic fun main(args: Array) { // yes } @@ -22,8 +19,8 @@ class B { class C { companion object { - @platformStatic - @platformName("main0") + @JvmStatic + @JvmName("main0") fun main(args: Array) { // no } } @@ -31,8 +28,8 @@ class C { class D { companion object { - @platformStatic - @platformName("main") + @JvmStatic + @JvmName("main") fun badName(args: Array) { // yes } } diff --git a/idea/testData/run/MainInTest/module/src/mainInPackageNamedInvalid.kt b/idea/testData/run/MainInTest/module/src/mainInPackageNamedInvalid.kt index 7570afb130e..33ecbb761c0 100644 --- a/idea/testData/run/MainInTest/module/src/mainInPackageNamedInvalid.kt +++ b/idea/testData/run/MainInTest/module/src/mainInPackageNamedInvalid.kt @@ -1,8 +1,6 @@ package pkg2 -import kotlin.platform.platformName - -@platformName("aa") +@JvmName("aa") fun main(args: Array) { // no } diff --git a/idea/testData/run/MainInTest/module/src/mainInPackageNamedValid.kt b/idea/testData/run/MainInTest/module/src/mainInPackageNamedValid.kt index 0a968da931c..17adc20e5bd 100644 --- a/idea/testData/run/MainInTest/module/src/mainInPackageNamedValid.kt +++ b/idea/testData/run/MainInTest/module/src/mainInPackageNamedValid.kt @@ -1,8 +1,6 @@ package pkg3 -import kotlin.platform.platformName - -@platformName("main") +@JvmName("main") fun aaa(args: Array) { // yes } diff --git a/idea/testData/run/UpdateOnClassRename/module/src/Foo.kt b/idea/testData/run/UpdateOnClassRename/module/src/Foo.kt index 71ada26293b..be34d84ea05 100644 --- a/idea/testData/run/UpdateOnClassRename/module/src/Foo.kt +++ b/idea/testData/run/UpdateOnClassRename/module/src/Foo.kt @@ -1,8 +1,6 @@ package renameTest -import kotlin.platform.platformStatic - object Foo { - @platformStatic fun main(args: Array) { + @JvmStatic fun main(args: Array) { } } diff --git a/idea/testData/run/UpdateOnPackageRename/module/src/renameTest/Foo.kt b/idea/testData/run/UpdateOnPackageRename/module/src/renameTest/Foo.kt index 71ada26293b..be34d84ea05 100644 --- a/idea/testData/run/UpdateOnPackageRename/module/src/renameTest/Foo.kt +++ b/idea/testData/run/UpdateOnPackageRename/module/src/renameTest/Foo.kt @@ -1,8 +1,6 @@ package renameTest -import kotlin.platform.platformStatic - object Foo { - @platformStatic fun main(args: Array) { + @JvmStatic fun main(args: Array) { } } diff --git a/j2k/src/org/jetbrains/kotlin/j2k/CodeBuilder.kt b/j2k/src/org/jetbrains/kotlin/j2k/CodeBuilder.kt index 69fa5201bc2..427f40a351a 100644 --- a/j2k/src/org/jetbrains/kotlin/j2k/CodeBuilder.kt +++ b/j2k/src/org/jetbrains/kotlin/j2k/CodeBuilder.kt @@ -28,7 +28,6 @@ import org.jetbrains.kotlin.psi.psiUtil.isAncestor import java.util.ArrayList import java.util.HashSet import java.util.LinkedHashSet -import kotlin.platform.platformName fun CodeBuilder.buildList(generators: Collection<() -> T>, separator: String, prefix: String = "", suffix: String = ""): CodeBuilder { if (generators.isNotEmpty()) { diff --git a/libraries/stdlib/src/kotlin/platform/annotations.kt b/libraries/stdlib/src/kotlin/platform/annotations.kt deleted file mode 100644 index a88ee826c72..00000000000 --- a/libraries/stdlib/src/kotlin/platform/annotations.kt +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright 2010-2014 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 kotlin.platform - -import kotlin.annotation.AnnotationTarget.* - -@Target(FUNCTION, PROPERTY_GETTER, PROPERTY_SETTER) -@Retention(AnnotationRetention.RUNTIME) -@MustBeDocumented -@Deprecated("Use kotlin.jvm.JvmName instead", ReplaceWith("kotlin.jvm.JvmName")) -public annotation class platformName(public val name: String) - -@Target(FUNCTION, PROPERTY, PROPERTY_GETTER, PROPERTY_SETTER) -@Retention(AnnotationRetention.RUNTIME) -@MustBeDocumented -@Deprecated("Use kotlin.jvm.JvmStatic instead", ReplaceWith("kotlin.jvm.JvmStatic")) -public annotation class platformStatic