Minor, rename PlatformStatic* -> JvmStatic* in reflection
This commit is contained in:
@@ -99,7 +99,7 @@ internal abstract class FunctionCaller<out M : Member>(
|
||||
}
|
||||
}
|
||||
|
||||
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<out M : Member>(
|
||||
|
||||
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<out M : Member>(
|
||||
|
||||
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())
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
@@ -85,7 +85,7 @@ interface KMutablePropertyImpl<R> : KMutableProperty<R>, KPropertyImpl<R> {
|
||||
|
||||
|
||||
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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user