From fb09c9171491545f4154ebc6b4ca79ce26a35734 Mon Sep 17 00:00:00 2001 From: Alexander Udalov Date: Sat, 29 Aug 2015 18:42:09 +0300 Subject: [PATCH] Minor, rename PlatformStatic* -> JvmStatic* in reflection --- .../src/kotlin/reflect/jvm/internal/FunctionCaller.kt | 6 +++--- .../src/kotlin/reflect/jvm/internal/KFunctionImpl.kt | 4 ++-- .../src/kotlin/reflect/jvm/internal/KPropertyImpl.kt | 10 +++++----- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/core/reflection.jvm/src/kotlin/reflect/jvm/internal/FunctionCaller.kt b/core/reflection.jvm/src/kotlin/reflect/jvm/internal/FunctionCaller.kt index 480afec8429..cf872b3799c 100644 --- a/core/reflection.jvm/src/kotlin/reflect/jvm/internal/FunctionCaller.kt +++ b/core/reflection.jvm/src/kotlin/reflect/jvm/internal/FunctionCaller.kt @@ -99,7 +99,7 @@ internal abstract class FunctionCaller( } } - class PlatformStaticInObject(method: ReflectMethod) : Method(method, requiresInstance = true) { + class JvmStaticInObject(method: ReflectMethod) : Method(method, requiresInstance = true) { override fun call(args: Array<*>): Any? { checkArguments(args) checkObjectInstance(args.firstOrNull()) @@ -151,7 +151,7 @@ internal abstract class FunctionCaller( class InstanceFieldGetter(field: ReflectField) : FieldGetter(field) - class PlatformStaticInObjectFieldGetter(field: ReflectField) : FieldGetter(field, requiresInstance = true) { + class JvmStaticInObjectFieldGetter(field: ReflectField) : FieldGetter(field, requiresInstance = true) { override fun checkArguments(args: Array<*>) { super.checkArguments(args) checkObjectInstance(args.firstOrNull()) @@ -162,7 +162,7 @@ internal abstract class FunctionCaller( class InstanceFieldSetter(field: ReflectField, notNull: Boolean) : FieldSetter(field, notNull) - class PlatformStaticInObjectFieldSetter(field: ReflectField, notNull: Boolean) : FieldSetter(field, notNull, requiresInstance = true) { + class JvmStaticInObjectFieldSetter(field: ReflectField, notNull: Boolean) : FieldSetter(field, notNull, requiresInstance = true) { override fun checkArguments(args: Array<*>) { super.checkArguments(args) checkObjectInstance(args.firstOrNull()) 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 01b80c985d2..564974e5df9 100644 --- a/core/reflection.jvm/src/kotlin/reflect/jvm/internal/KFunctionImpl.kt +++ b/core/reflection.jvm/src/kotlin/reflect/jvm/internal/KFunctionImpl.kt @@ -69,7 +69,7 @@ open class KFunctionImpl protected constructor( descriptor.annotations.findAnnotation(PLATFORM_STATIC) != null, descriptor.annotations.findAnnotation(JVM_STATIC) != null -> - FunctionCaller.PlatformStaticInObject(member) + FunctionCaller.JvmStaticInObject(member) else -> FunctionCaller.StaticMethod(member) } @@ -100,7 +100,7 @@ open class KFunctionImpl protected constructor( is Method -> when { descriptor.annotations.findAnnotation(PLATFORM_STATIC) != null, descriptor.annotations.findAnnotation(JVM_STATIC) != null -> - FunctionCaller.PlatformStaticInObject(member) + FunctionCaller.JvmStaticInObject(member) else -> FunctionCaller.StaticMethod(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 63aa048862a..ce902707872 100644 --- a/core/reflection.jvm/src/kotlin/reflect/jvm/internal/KPropertyImpl.kt +++ b/core/reflection.jvm/src/kotlin/reflect/jvm/internal/KPropertyImpl.kt @@ -85,7 +85,7 @@ interface KMutablePropertyImpl : KMutableProperty, KPropertyImpl { private fun KPropertyImpl.Accessor<*>.computeCallerForAccessor(isGetter: Boolean): FunctionCaller<*> { - fun isPlatformStaticProperty() = + fun isJvmStaticProperty() = property.descriptor.annotations.findAnnotation(PLATFORM_STATIC) != null || property.descriptor.annotations.findAnnotation(JVM_STATIC) != null @@ -96,9 +96,9 @@ private fun KPropertyImpl.Accessor<*>.computeCallerForAccessor(isGetter: Boolean !Modifier.isStatic(field.modifiers) -> if (isGetter) FunctionCaller.InstanceFieldGetter(field) else FunctionCaller.InstanceFieldSetter(field, isNotNullProperty()) - isPlatformStaticProperty() -> - if (isGetter) FunctionCaller.PlatformStaticInObjectFieldGetter(field) - else FunctionCaller.PlatformStaticInObjectFieldSetter(field, isNotNullProperty()) + isJvmStaticProperty() -> + if (isGetter) FunctionCaller.JvmStaticInObjectFieldGetter(field) + else FunctionCaller.JvmStaticInObjectFieldSetter(field, isNotNullProperty()) else -> if (isGetter) FunctionCaller.StaticFieldGetter(field) else FunctionCaller.StaticFieldSetter(field, isNotNullProperty()) @@ -123,7 +123,7 @@ private fun KPropertyImpl.Accessor<*>.computeCallerForAccessor(isGetter: Boolean when { accessor == null -> computeFieldCaller(property.javaField!!) !Modifier.isStatic(accessor.modifiers) -> FunctionCaller.InstanceMethod(accessor) - isPlatformStaticProperty() -> FunctionCaller.PlatformStaticInObject(accessor) + isJvmStaticProperty() -> FunctionCaller.JvmStaticInObject(accessor) else -> FunctionCaller.StaticMethod(accessor) } }