Minor, improve comment about ReflectProperties usefulness

This commit is contained in:
Alexander Udalov
2015-07-21 19:46:36 +03:00
parent 83bcfd090c
commit 4af0ed822f
2 changed files with 4 additions and 3 deletions
@@ -25,9 +25,6 @@ import org.jetbrains.kotlin.serialization.deserialization.findClassAcrossModuleD
import kotlin.reflect.*
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 classId = classId
@@ -23,6 +23,10 @@ import org.jetbrains.annotations.Nullable;
import java.lang.ref.SoftReference;
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 {
public static abstract class Val<T> {
private static final Object NULL_VALUE = new Object() {};