diff --git a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/resolve/noncode/NewifyMemberContributor.kt b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/resolve/noncode/NewifyMemberContributor.kt index 62122a1ba51b..871a65d737fc 100644 --- a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/resolve/noncode/NewifyMemberContributor.kt +++ b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/resolve/noncode/NewifyMemberContributor.kt @@ -39,13 +39,13 @@ class NewifyMemberContributor : NonCodeMembersContributor() { for (annotation in listNewifyAnnotations(place)) { val newifiedClasses = GrAnnotationUtil.getClassArrayValue(annotation, "value", true) qualifier ?: newifiedClasses.flatMap { it.constructors.asList() }.forEach { - ResolveUtil.processElement(processor, NewifiedConstructor(it, "by @Newify", it.name, true, arrayOf(PsiModifier.STATIC)), state) + ResolveUtil.processElement(processor, NewifiedConstructor(it, "by @Newify", it.name, true), state) } val createNewMethods = GrAnnotationUtil.inferBooleanAttributeNotNull(annotation, "auto") val type = (qualifier as? GrReferenceExpression)?.resolve() as? PsiClass if (type != null && createNewMethods) { type.constructors.forEach { - ResolveUtil.processElement(processor, NewifiedConstructor(it, "by @Newify", "new", false, arrayOf(PsiModifier.STATIC)), state) + ResolveUtil.processElement(processor, NewifiedConstructor(it, "by @Newify", "new", false), state) } } } @@ -67,13 +67,16 @@ class NewifyMemberContributor : NonCodeMembersContributor() { return (elem as? GrReferenceExpression)?.qualifierExpression } - class NewifiedConstructor(val myPrototype: PsiMethod, val myOriginInfo: String, val newName: String, val asConstructor: Boolean, val modifiers:Array) + class NewifiedConstructor(val myPrototype: PsiMethod, + val myOriginInfo: String, + val newName: String, + val asConstructor: Boolean) : LightMethod(myPrototype.manager, myPrototype, myPrototype.containingClass!!), OriginInfoAwareElement, PsiMirrorElement { override fun getPrototype(): PsiElement { return myPrototype } - val myModifierList: LightModifierList = LightModifierList(myPrototype.manager, JavaLanguage.INSTANCE, *modifiers) + val myModifierList: LightModifierList = LightModifierList(myPrototype.manager, JavaLanguage.INSTANCE, PsiModifier.STATIC) override fun getName(): String {