diff --git a/core/builtins/src/kotlin/reflect/KPackage.kt b/core/builtins/src/kotlin/reflect/KPackage.kt deleted file mode 100644 index 0bc292c8f71..00000000000 --- a/core/builtins/src/kotlin/reflect/KPackage.kt +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright 2010-2015 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.reflect - -/** - * Represents a package and provides introspection capabilities. - */ -@Deprecated("This class will be deleted soon because reflection on packages is going to be redesigned " + - "after the introduction of new kinds of runtime representations of packages on JVM.") -public interface KPackage : KDeclarationContainer diff --git a/core/reflection.jvm/src/kotlin/reflect/jvm/internal/KPackageImpl.kt b/core/reflection.jvm/src/kotlin/reflect/jvm/internal/KPackageImpl.kt index fd3559b5d4a..266593065c8 100644 --- a/core/reflection.jvm/src/kotlin/reflect/jvm/internal/KPackageImpl.kt +++ b/core/reflection.jvm/src/kotlin/reflect/jvm/internal/KPackageImpl.kt @@ -14,7 +14,6 @@ * limitations under the License. */ -@file:Suppress("DEPRECATION") package kotlin.reflect.jvm.internal import org.jetbrains.kotlin.descriptors.ConstructorDescriptor @@ -26,9 +25,8 @@ import org.jetbrains.kotlin.name.Name import org.jetbrains.kotlin.resolve.scopes.MemberScope import kotlin.jvm.internal.KotlinPackage import kotlin.reflect.KCallable -import kotlin.reflect.KPackage -internal class KPackageImpl(override val jClass: Class<*>, val moduleName: String) : KDeclarationContainerImpl(), KPackage { +internal class KPackageImpl(override val jClass: Class<*>, val moduleName: String) : KDeclarationContainerImpl() { private val descriptor = ReflectProperties.lazySoft { with(moduleData) { packageFacadeProvider.registerModule(moduleName) @@ -44,7 +42,6 @@ internal class KPackageImpl(override val jClass: Class<*>, val moduleName: Strin override val constructorDescriptors: Collection get() = emptyList() - @Suppress("UNCHECKED_CAST") override fun getProperties(name: Name): Collection = scope.getContributedVariables(name, NoLookupLocation.FROM_REFLECTION) diff --git a/core/reflection.jvm/src/kotlin/reflect/jvm/internal/ReflectionFactoryImpl.java b/core/reflection.jvm/src/kotlin/reflect/jvm/internal/ReflectionFactoryImpl.java index aadfb30fa27..cf4e08b70c1 100644 --- a/core/reflection.jvm/src/kotlin/reflect/jvm/internal/ReflectionFactoryImpl.java +++ b/core/reflection.jvm/src/kotlin/reflect/jvm/internal/ReflectionFactoryImpl.java @@ -87,16 +87,4 @@ public class ReflectionFactoryImpl extends ReflectionFactory { public KMutableProperty2 mutableProperty2(MutablePropertyReference2 p) { return p instanceof MutablePropertyReference2Impl ? new KMutableProperty2Augmented(p) : new KMutableProperty2FromReferenceImpl(p); } - - // Deprecated - - @Override - public KClass foreignKotlinClass(Class javaClass) { - return getOrCreateKotlinClass(javaClass); - } - - @Override - public KPackage createKotlinPackage(Class javaClass, String moduleName) { - return new KPackageImpl(javaClass, moduleName); - } } diff --git a/core/runtime.jvm/src/kotlin/jvm/internal/Reflection.java b/core/runtime.jvm/src/kotlin/jvm/internal/Reflection.java index df59ac90357..fc37e966593 100644 --- a/core/runtime.jvm/src/kotlin/jvm/internal/Reflection.java +++ b/core/runtime.jvm/src/kotlin/jvm/internal/Reflection.java @@ -22,6 +22,7 @@ import kotlin.reflect.*; * This class serves as a facade to the actual reflection implementation. JVM back-end generates calls to static methods of this class * on any reflection-using construct. */ +@SuppressWarnings("unused") public class Reflection { private static final ReflectionFactory factory; @@ -104,22 +105,4 @@ public class Reflection { public static KMutableProperty2 mutableProperty2(MutablePropertyReference2 p) { return factory.mutableProperty2(p); } - - // Deprecated - // TODO: drop before 1.0 - - @Deprecated - public static KPackage createKotlinPackage(Class javaClass, String moduleName) { - return (KPackage) factory.getOrCreateKotlinPackage(javaClass, moduleName); - } - - @Deprecated - public static KClass foreignKotlinClass(Class javaClass) { - return getOrCreateKotlinClass(javaClass); - } - - @Deprecated - public static KClass[] foreignKotlinClasses(Class[] javaClasses) { - return getOrCreateKotlinClasses(javaClasses); - } } diff --git a/core/runtime.jvm/src/kotlin/jvm/internal/ReflectionFactory.java b/core/runtime.jvm/src/kotlin/jvm/internal/ReflectionFactory.java index 82b5c2fb603..17770f25ddb 100644 --- a/core/runtime.jvm/src/kotlin/jvm/internal/ReflectionFactory.java +++ b/core/runtime.jvm/src/kotlin/jvm/internal/ReflectionFactory.java @@ -70,16 +70,4 @@ public class ReflectionFactory { public KMutableProperty2 mutableProperty2(MutablePropertyReference2 p) { return p; } - - // Deprecated - - @Deprecated - public KClass foreignKotlinClass(Class javaClass) { - return new ClassReference(javaClass); - } - - @Deprecated - public KPackage createKotlinPackage(Class javaClass, String moduleName) { - return null; - } }