Minor, improve comment about ReflectProperties usefulness
This commit is contained in:
@@ -25,9 +25,6 @@ import org.jetbrains.kotlin.serialization.deserialization.findClassAcrossModuleD
|
|||||||
import kotlin.reflect.*
|
import kotlin.reflect.*
|
||||||
|
|
||||||
class KClassImpl<T>(override val jClass: Class<T>) : KCallableContainerImpl(), KClass<T> {
|
class KClassImpl<T>(override val jClass: Class<T>) : KCallableContainerImpl(), KClass<T> {
|
||||||
// Don't use kotlin.properties.Delegates here because it's a Kotlin class which will invoke KClassImpl() in <clinit>,
|
|
||||||
// resulting in infinite recursion
|
|
||||||
|
|
||||||
val descriptor by ReflectProperties.lazySoft {
|
val descriptor by ReflectProperties.lazySoft {
|
||||||
val classId = classId
|
val classId = classId
|
||||||
|
|
||||||
|
|||||||
@@ -23,6 +23,10 @@ import org.jetbrains.annotations.Nullable;
|
|||||||
import java.lang.ref.SoftReference;
|
import java.lang.ref.SoftReference;
|
||||||
import java.lang.ref.WeakReference;
|
import java.lang.ref.WeakReference;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The fact that this is a Java class is used in reflection implementation classes: otherwise if it were a Kotlin class, KClassImpl()
|
||||||
|
* instance would have been invoked in its static initializer (to create and cache $kotlinClass field), resulting in infinite recursion.
|
||||||
|
*/
|
||||||
/* package */ class ReflectProperties {
|
/* package */ class ReflectProperties {
|
||||||
public static abstract class Val<T> {
|
public static abstract class Val<T> {
|
||||||
private static final Object NULL_VALUE = new Object() {};
|
private static final Object NULL_VALUE = new Object() {};
|
||||||
|
|||||||
Reference in New Issue
Block a user