diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameters/orderWithValue.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameters/orderWithValue.kt new file mode 100644 index 00000000000..464d1bced00 --- /dev/null +++ b/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameters/orderWithValue.kt @@ -0,0 +1,9 @@ +// FILE: A.java +public @interface A { + double b(); + Class x1(); + int a(); + String value(); + Class x(); + Class x2(); +} diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameters/orderWithValue.txt b/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameters/orderWithValue.txt new file mode 100644 index 00000000000..095e0821656 --- /dev/null +++ b/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameters/orderWithValue.txt @@ -0,0 +1,14 @@ +package + +public final annotation class A : kotlin.Annotation { + public constructor A(/*0*/ value: kotlin.String, /*1*/ b: kotlin.Double, /*2*/ x1: java.lang.Class<*>, /*3*/ a: kotlin.Int, /*4*/ x: java.lang.Class<*>, /*5*/ x2: java.lang.Class<*>) + public abstract fun a(): kotlin.Int + public abstract fun b(): kotlin.Double + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String + public abstract fun value(): kotlin.String + public abstract fun x(): java.lang.Class<*> + public abstract fun x1(): java.lang.Class<*> + public abstract fun x2(): java.lang.Class<*> +} diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameters/orderWithoutValue.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameters/orderWithoutValue.kt new file mode 100644 index 00000000000..97e7759bf6c --- /dev/null +++ b/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameters/orderWithoutValue.kt @@ -0,0 +1,8 @@ +// FILE: A.java +public @interface A { + double b(); + Class x1(); + int a(); + Class x(); + Class x2(); +} diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameters/orderWithoutValue.txt b/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameters/orderWithoutValue.txt new file mode 100644 index 00000000000..936f82acf84 --- /dev/null +++ b/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameters/orderWithoutValue.txt @@ -0,0 +1,13 @@ +package + +public final annotation class A : kotlin.Annotation { + public constructor A(/*0*/ b: kotlin.Double, /*1*/ x1: java.lang.Class<*>, /*2*/ a: kotlin.Int, /*3*/ x: java.lang.Class<*>, /*4*/ x2: java.lang.Class<*>) + public abstract fun a(): kotlin.Int + public abstract fun b(): kotlin.Double + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String + public abstract fun x(): java.lang.Class<*> + public abstract fun x1(): java.lang.Class<*> + public abstract fun x2(): java.lang.Class<*> +} diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameters/valueArray.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameters/valueArray.kt new file mode 100644 index 00000000000..b37561c565b --- /dev/null +++ b/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameters/valueArray.kt @@ -0,0 +1,23 @@ +// FILE: A.java +public @interface A { + String[] value(); + Class x() default Integer.class; + int y(); +} + +// FILE: b.kt +[A("1", "2", "3", y = 1)] fun test1() {} + +[A("4", y = 2)] fun test2() {} + +[A(*array("5", "6"), "7", y = 3)] fun test3() {} + +[A("1", "2", "3", x = javaClass(), y = 4)] fun test4() {} + +[A("4", y = 5)] fun test5() {} + +[A(*array("5", "6"), "7", x = javaClass(), y = 6)] fun test6() {} + +[A(y = 7)] fun test7() {} + +[A("8", "9", "10")] fun test8() {} diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameters/valueArray.txt b/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameters/valueArray.txt new file mode 100644 index 00000000000..63104a923f3 --- /dev/null +++ b/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameters/valueArray.txt @@ -0,0 +1,20 @@ +package + +A(value = {"1", "2", "3"}: kotlin.Array, y = IntegerValueType(1): IntegerValueType(1)) internal fun test1(): kotlin.Unit +A(value = {"4"}: kotlin.Array, y = IntegerValueType(2): IntegerValueType(2)) internal fun test2(): kotlin.Unit +A(value = {{"5", "6"}, "7"}: kotlin.Array, y = IntegerValueType(3): IntegerValueType(3)) internal fun test3(): kotlin.Unit +A(value = {"1", "2", "3"}: kotlin.Array, x = kotlin.String.class: java.lang.Class, y = IntegerValueType(4): IntegerValueType(4)) internal fun test4(): kotlin.Unit +A(value = {"4"}: kotlin.Array, y = IntegerValueType(5): IntegerValueType(5)) internal fun test5(): kotlin.Unit +A(value = {{"5", "6"}, "7"}: kotlin.Array, x = kotlin.Any.class: java.lang.Class, y = IntegerValueType(6): IntegerValueType(6)) internal fun test6(): kotlin.Unit +A(value = {}: kotlin.Array, y = IntegerValueType(7): IntegerValueType(7)) internal fun test7(): kotlin.Unit +A(value = {"8", "9", "10"}: kotlin.Array) internal fun test8(): kotlin.Unit + +public final annotation class A : kotlin.Annotation { + public constructor A(/*0*/ vararg value: kotlin.String /*kotlin.Array*/, /*1*/ x: java.lang.Class<*> = ..., /*2*/ y: kotlin.Int) + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String + public abstract fun value(): kotlin.Array + public abstract fun x(): java.lang.Class<*> + public abstract fun y(): kotlin.Int +} diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameters/valueArrayAndOtherDefault.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameters/valueArrayAndOtherDefault.kt new file mode 100644 index 00000000000..3b43f857b55 --- /dev/null +++ b/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameters/valueArrayAndOtherDefault.kt @@ -0,0 +1,27 @@ +// FILE: A.java +public @interface A { + String[] value(); + Class x() default Integer.class; + int y() default 1; +} + +// FILE: b.kt +[A("1", "2", "3")] fun test1() {} + +[A("4")] fun test2() {} + +[A(*array("5", "6"), "7")] fun test3() {} + +[A("1", "2", "3", x = javaClass())] fun test4() {} + +[A("4", y = 2)] fun test5() {} + +[A(*array("5", "6"), "7", x = javaClass(), y = 3)] fun test6() {} + +[A()] fun test7() {} + +[A] fun test8() {} + +[A(x = javaClass(), *array("5", "6"), "7", y = 3)] fun test9() {} +[A(x = javaClass(), value = *array("5", "6"), "7", y = 3)] fun test10() {} +[A(x = javaClass(), value = *array("5", "6", "7"), y = 3)] fun test11() {} diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameters/valueArrayAndOtherDefault.txt b/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameters/valueArrayAndOtherDefault.txt new file mode 100644 index 00000000000..6b445a2c118 --- /dev/null +++ b/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameters/valueArrayAndOtherDefault.txt @@ -0,0 +1,23 @@ +package + +A(value = {"1", "2", "3"}: kotlin.Array) internal fun test1(): kotlin.Unit +A(value = {"5", "6"}: kotlin.Array, x = kotlin.Any.class: java.lang.Class, y = IntegerValueType(3): IntegerValueType(3)) internal fun test10(): kotlin.Unit +A(value = {"5", "6", "7"}: kotlin.Array, x = kotlin.Any.class: java.lang.Class, y = IntegerValueType(3): IntegerValueType(3)) internal fun test11(): kotlin.Unit +A(value = {"4"}: kotlin.Array) internal fun test2(): kotlin.Unit +A(value = {{"5", "6"}, "7"}: kotlin.Array) internal fun test3(): kotlin.Unit +A(value = {"1", "2", "3"}: kotlin.Array, x = kotlin.String.class: java.lang.Class) internal fun test4(): kotlin.Unit +A(value = {"4"}: kotlin.Array, y = IntegerValueType(2): IntegerValueType(2)) internal fun test5(): kotlin.Unit +A(value = {{"5", "6"}, "7"}: kotlin.Array, x = kotlin.Any.class: java.lang.Class, y = IntegerValueType(3): IntegerValueType(3)) internal fun test6(): kotlin.Unit +A(value = {}: kotlin.Array) internal fun test7(): kotlin.Unit +A(value = {}: kotlin.Array) internal fun test8(): kotlin.Unit +A(value = {}: kotlin.Array, x = kotlin.Any.class: java.lang.Class, y = IntegerValueType(3): IntegerValueType(3)) internal fun test9(): kotlin.Unit + +public final annotation class A : kotlin.Annotation { + public constructor A(/*0*/ vararg value: kotlin.String /*kotlin.Array*/, /*1*/ x: java.lang.Class<*> = ..., /*2*/ y: kotlin.Int = ...) + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String + public abstract fun value(): kotlin.Array + public abstract fun x(): java.lang.Class<*> + public abstract fun y(): kotlin.Int +} diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameters/valueArrayOnly.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameters/valueArrayOnly.kt new file mode 100644 index 00000000000..a0d9dbeb350 --- /dev/null +++ b/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameters/valueArrayOnly.kt @@ -0,0 +1,15 @@ +// FILE: A.java +public @interface A { + String[] value(); +} + +// FILE: b.kt +[A("1", "2", "3")] fun test1() {} + +[A("4")] fun test2() {} + +[A(*array("5", "6"), "7")] fun test3() {} + +[A()] fun test4() {} + +[A] fun test5() {} diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameters/valueArrayOnly.txt b/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameters/valueArrayOnly.txt new file mode 100644 index 00000000000..72cd3d644a1 --- /dev/null +++ b/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameters/valueArrayOnly.txt @@ -0,0 +1,15 @@ +package + +A(value = {"1", "2", "3"}: kotlin.Array) internal fun test1(): kotlin.Unit +A(value = {"4"}: kotlin.Array) internal fun test2(): kotlin.Unit +A(value = {{"5", "6"}, "7"}: kotlin.Array) internal fun test3(): kotlin.Unit +A(value = {}: kotlin.Array) internal fun test4(): kotlin.Unit +A(value = {}: kotlin.Array) internal fun test5(): kotlin.Unit + +public final annotation class A : kotlin.Annotation { + public constructor A(/*0*/ vararg value: kotlin.String /*kotlin.Array*/) + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String + public abstract fun value(): kotlin.Array +} diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationWithVarargParameter/javaAnnotationWithVarargArgument.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationWithVarargParameter/javaAnnotationWithVarargArgument.kt index 3aaf83cbcde..b8e7bcc6938 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationWithVarargParameter/javaAnnotationWithVarargArgument.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationWithVarargParameter/javaAnnotationWithVarargArgument.kt @@ -1,6 +1,6 @@ // FILE: A.java public @interface A { - String[] arg(); + String[] value(); } // FILE: b.kt diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationWithVarargParameter/javaAnnotationWithVarargArgument.txt b/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationWithVarargParameter/javaAnnotationWithVarargArgument.txt index 81688ec81d9..96c2194c0d8 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationWithVarargParameter/javaAnnotationWithVarargArgument.txt +++ b/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationWithVarargParameter/javaAnnotationWithVarargArgument.txt @@ -1,11 +1,11 @@ package -A(arg = {IntegerValueType(1), "b"}: kotlin.Array) internal fun test(): kotlin.Unit +A(value = {IntegerValueType(1), "b"}: kotlin.Array) internal fun test(): kotlin.Unit public final annotation class A : kotlin.Annotation { - public constructor A(/*0*/ vararg arg: kotlin.String /*kotlin.Array*/) - public abstract fun arg(): kotlin.Array + public constructor A(/*0*/ vararg value: kotlin.String /*kotlin.Array*/) public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String + public abstract fun value(): kotlin.Array } diff --git a/compiler/testData/loadJava/sourceJava/NullInAnnotation.txt b/compiler/testData/loadJava/sourceJava/NullInAnnotation.txt index 1edda0d3929..1c937884030 100644 --- a/compiler/testData/loadJava/sourceJava/NullInAnnotation.txt +++ b/compiler/testData/loadJava/sourceJava/NullInAnnotation.txt @@ -3,10 +3,10 @@ package test public /*synthesized*/ fun NullInAnnotation(/*0*/ function: () -> kotlin.Unit): test.NullInAnnotation public trait NullInAnnotation { - test.NullInAnnotation.Ann(a = null: kotlin.Nothing?, b = {null}: kotlin.Array) public abstract fun foo(): kotlin.Unit + test.NullInAnnotation.Ann(a = null: kotlin.Nothing?, b = {null}: kotlin.Array) public abstract fun foo(): kotlin.Unit public final annotation class Ann : kotlin.Annotation { - public constructor Ann(/*0*/ a: kotlin.String, /*1*/ vararg b: kotlin.String /*kotlin.Array*/) + public constructor Ann(/*0*/ a: kotlin.String, /*1*/ b: kotlin.Array) public abstract fun a(): kotlin.String public abstract fun b(): kotlin.Array } diff --git a/compiler/tests/org/jetbrains/kotlin/checkers/JetDiagnosticsTestWithStdLibGenerated.java b/compiler/tests/org/jetbrains/kotlin/checkers/JetDiagnosticsTestWithStdLibGenerated.java index e5cf965d29f..1accc1e0e47 100644 --- a/compiler/tests/org/jetbrains/kotlin/checkers/JetDiagnosticsTestWithStdLibGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/checkers/JetDiagnosticsTestWithStdLibGenerated.java @@ -54,6 +54,7 @@ public class JetDiagnosticsTestWithStdLibGenerated extends AbstractJetDiagnostic @InnerTestClasses({ Annotations.AnnotationApplicability.class, Annotations.AnnotationParameterMustBeConstant.class, + Annotations.AnnotationParameters.class, Annotations.AnnotationWithVarargParameter.class, Annotations.JvmOverloads.class, Annotations.PlatformStatic.class, @@ -130,6 +131,45 @@ public class JetDiagnosticsTestWithStdLibGenerated extends AbstractJetDiagnostic } } + @TestMetadata("compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameters") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class AnnotationParameters extends AbstractJetDiagnosticsTestWithStdLib { + public void testAllFilesPresentInAnnotationParameters() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameters"), Pattern.compile("^(.+)\\.kt$"), true); + } + + @TestMetadata("orderWithValue.kt") + public void testOrderWithValue() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameters/orderWithValue.kt"); + doTest(fileName); + } + + @TestMetadata("orderWithoutValue.kt") + public void testOrderWithoutValue() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameters/orderWithoutValue.kt"); + doTest(fileName); + } + + @TestMetadata("valueArray.kt") + public void testValueArray() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameters/valueArray.kt"); + doTest(fileName); + } + + @TestMetadata("valueArrayAndOtherDefault.kt") + public void testValueArrayAndOtherDefault() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameters/valueArrayAndOtherDefault.kt"); + doTest(fileName); + } + + @TestMetadata("valueArrayOnly.kt") + public void testValueArrayOnly() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameters/valueArrayOnly.kt"); + doTest(fileName); + } + } + @TestMetadata("compiler/testData/diagnostics/testsWithStdLib/annotations/annotationWithVarargParameter") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) diff --git a/core/descriptor.loader.java/src/org/jetbrains/kotlin/load/java/lazy/descriptors/LazyJavaClassMemberScope.kt b/core/descriptor.loader.java/src/org/jetbrains/kotlin/load/java/lazy/descriptors/LazyJavaClassMemberScope.kt index a350d5a5a2c..6055415095e 100644 --- a/core/descriptor.loader.java/src/org/jetbrains/kotlin/load/java/lazy/descriptors/LazyJavaClassMemberScope.kt +++ b/core/descriptor.loader.java/src/org/jetbrains/kotlin/load/java/lazy/descriptors/LazyJavaClassMemberScope.kt @@ -33,6 +33,7 @@ import org.jetbrains.kotlin.types.TypeUtils import org.jetbrains.kotlin.descriptors.annotations.Annotations import org.jetbrains.kotlin.load.java.lazy.resolveAnnotations import org.jetbrains.kotlin.load.java.JavaVisibilities +import org.jetbrains.kotlin.load.java.JvmAnnotationNames import org.jetbrains.kotlin.load.java.descriptors.JavaConstructorDescriptor import org.jetbrains.kotlin.load.java.components.DescriptorResolverUtils import org.jetbrains.kotlin.types.JetType @@ -167,38 +168,61 @@ public class LazyJavaClassMemberScope( val methods = jClass.getMethods() val result = ArrayList(methods.size()) - for ((index, method) in methods.withIndices()) { - assert(method.getValueParameters().isEmpty(), "Annotation method can't have parameters: " + method) + val attr = TypeUsage.MEMBER_SIGNATURE_INVARIANT.toAttributes(allowFlexible = false) - val jReturnType = method.getReturnType() ?: throw AssertionError("Annotation method has no return type: " + method) + val (methodsNamedValue, otherMethods) = methods. + partition { it.getName() == JvmAnnotationNames.DEFAULT_ANNOTATION_MEMBER_NAME } - val attr = TypeUsage.MEMBER_SIGNATURE_INVARIANT.toAttributes(allowFlexible = false) - - val (returnType, varargElementType) = - if (index == methods.size() - 1 && jReturnType is JavaArrayType) - Pair(c.typeResolver.transformArrayType(jReturnType, attr, isVararg = true), - c.typeResolver.transformJavaType(jReturnType.getComponentType(), attr)) + assert(methodsNamedValue.size() <= 1, "There can't be to methods named 'value' in annotation class: " + jClass) + val methodNamedValue = methodsNamedValue.firstOrNull() + if (methodNamedValue != null) { + val parameterNamedValueJavaType = methodNamedValue.getAnnotationMethodReturnJavaType() + val (parameterType, varargType) = + if (parameterNamedValueJavaType is JavaArrayType) + Pair(c.typeResolver.transformArrayType(parameterNamedValueJavaType, attr, isVararg = true), + c.typeResolver.transformJavaType(parameterNamedValueJavaType.getComponentType(), attr)) else - Pair(c.typeResolver.transformJavaType(jReturnType, attr), null) + Pair(c.typeResolver.transformJavaType(parameterNamedValueJavaType, attr), null) - result.add(ValueParameterDescriptorImpl( - constructor, - null, - index, - Annotations.EMPTY, - method.getName(), - // Parameters of annotation constructors in Java are never nullable - TypeUtils.makeNotNullable(returnType), - method.hasAnnotationParameterDefaultValue(), - // Nulls are not allowed in annotation arguments in Java - varargElementType?.let { TypeUtils.makeNotNullable(it) }, - c.sourceElementFactory.source(method) - )) + result.addAnnotationValueParameter(constructor, 0, methodNamedValue, parameterType, varargType) + } + + val startIndex = if (methodNamedValue != null) 1 else 0 + for ((index, method) in otherMethods.withIndex()) { + val parameterType = c.typeResolver.transformJavaType(method.getAnnotationMethodReturnJavaType(), attr) + result.addAnnotationValueParameter(constructor, index + startIndex, method, parameterType, null) } return result } + private fun JavaMethod.getAnnotationMethodReturnJavaType(): JavaType { + assert(getValueParameters().isEmpty(), "Annotation method can't have parameters: " + this) + return getReturnType() ?: throw AssertionError("Annotation method has no return type: " + this) + } + + private fun MutableList.addAnnotationValueParameter( + constructor: ConstructorDescriptor, + index: Int, + method: JavaMethod, + returnType: JetType, + varargElementType: JetType? + ) { + add(ValueParameterDescriptorImpl( + constructor, + null, + index, + Annotations.EMPTY, + method.getName(), + // Parameters of annotation constructors in Java are never nullable + TypeUtils.makeNotNullable(returnType), + method.hasAnnotationParameterDefaultValue(), + // Nulls are not allowed in annotation arguments in Java + varargElementType?.let { TypeUtils.makeNotNullable(it) }, + c.sourceElementFactory.source(method) + )) + } + private val nestedClassIndex = c.storageManager.createLazyValue { jClass.getInnerClasses().valuesToMap { c -> c.getName() } }