Fix annotations on Java elements in reflection
#KT-10840 Fixed
This commit is contained in:
+1
-1
@@ -23,7 +23,7 @@ import org.jetbrains.kotlin.load.java.structure.JavaElement
|
||||
import org.jetbrains.kotlin.load.java.structure.reflect.ReflectJavaElement
|
||||
|
||||
object RuntimeSourceElementFactory : JavaSourceElementFactory {
|
||||
private class RuntimeSourceElement(override val javaElement: ReflectJavaElement) : JavaSourceElement {
|
||||
class RuntimeSourceElement(override val javaElement: ReflectJavaElement) : JavaSourceElement {
|
||||
override fun toString() = javaClass.name + ": " + javaElement.toString()
|
||||
override fun getContainingFile(): SourceFile = SourceFile.NO_SOURCE_FILE
|
||||
}
|
||||
|
||||
+1
-1
@@ -21,7 +21,7 @@ import org.jetbrains.kotlin.load.java.structure.JavaAnnotationArgument
|
||||
import org.jetbrains.kotlin.name.Name
|
||||
import java.lang.reflect.Method
|
||||
|
||||
class ReflectJavaAnnotation(private val annotation: Annotation) : ReflectJavaElement(), JavaAnnotation {
|
||||
class ReflectJavaAnnotation(val annotation: Annotation) : ReflectJavaElement(), JavaAnnotation {
|
||||
override fun findArgument(name: Name): JavaAnnotationArgument? {
|
||||
return getArgumentValue(annotation.annotationClass.java.getDeclaredMethod(name.asString()))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user