Minor, add clarifying comment & inline useless property
This commit is contained in:
+1
-1
@@ -33,5 +33,5 @@ fun getAnnotations(annotations: Array<Annotation>): List<ReflectJavaAnnotation>
|
||||
}
|
||||
|
||||
fun findAnnotation(annotations: Array<Annotation>, fqName: FqName): ReflectJavaAnnotation? {
|
||||
return annotations.firstOrNull { it.annotationType().fqName == fqName }?.let { ReflectJavaAnnotation(it) }
|
||||
return annotations.firstOrNull { it.annotationType().classId.asSingleFqName() == fqName }?.let { ReflectJavaAnnotation(it) }
|
||||
}
|
||||
|
||||
+1
-1
@@ -44,7 +44,7 @@ public class ReflectJavaClass(
|
||||
.map(::ReflectJavaClass)
|
||||
.toList()
|
||||
|
||||
override fun getFqName() = klass.fqName
|
||||
override fun getFqName() = klass.classId.asSingleFqName()
|
||||
|
||||
override fun getOuterClass() = klass.getDeclaringClass()?.let(::ReflectJavaClass)
|
||||
|
||||
|
||||
+3
-3
@@ -27,9 +27,9 @@ public val Class<*>.classLoader: ClassLoader
|
||||
public fun Class<*>.isEnumClassOrSpecializedEnumEntryClass(): Boolean =
|
||||
javaClass<Enum<*>>().isAssignableFrom(this)
|
||||
|
||||
public val Class<*>.fqName: FqName
|
||||
get() = classId.asSingleFqName()
|
||||
|
||||
/**
|
||||
* NOTE: does not perform a Java -> Kotlin mapping. If this is not expected, consider using KClassImpl#classId instead
|
||||
*/
|
||||
public val Class<*>.classId: ClassId
|
||||
get() = when {
|
||||
isPrimitive() -> throw IllegalArgumentException("Can't compute ClassId for primitive type: $this")
|
||||
|
||||
Reference in New Issue
Block a user