diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/annotator/intentions/elements/jvmPsiUtil.kt b/plugins/groovy/src/org/jetbrains/plugins/groovy/annotator/intentions/elements/jvmPsiUtil.kt index a208a628cd06..cbac48cc3089 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/annotator/intentions/elements/jvmPsiUtil.kt +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/annotator/intentions/elements/jvmPsiUtil.kt @@ -41,9 +41,9 @@ internal fun JvmModifier.toPsiModifier(): String = when (this) { } /** - * Compiled classes, type parameters are not considered classes. + * Compiled classes, type parameters, light classes(except GroovyScriptClass) are not considered classes. * - * @return Java PsiClass or `null` if the receiver is not a Java PsiClass + * @return GrTypeDefinition or `null` if the receiver is not a Groovy type definition. */ internal fun JvmClass.toGroovyClassOrNull(): GrTypeDefinition? { if (this !is GrTypeDefinition) return null diff --git a/plugins/groovy/test/org/jetbrains/plugins/groovy/fixes/CreateConstantFromJavaUsageTest.groovy b/plugins/groovy/test/org/jetbrains/plugins/groovy/fixes/CreateConstantFromJavaUsageTest.groovy index 657a01e6910e..d9aa46b0e014 100644 --- a/plugins/groovy/test/org/jetbrains/plugins/groovy/fixes/CreateConstantFromJavaUsageTest.groovy +++ b/plugins/groovy/test/org/jetbrains/plugins/groovy/fixes/CreateConstantFromJavaUsageTest.groovy @@ -1,5 +1,4 @@ // Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. - package org.jetbrains.plugins.groovy.fixes import com.intellij.psi.impl.source.PostprocessReformattingAspect @@ -46,9 +45,7 @@ class CreateConstantFromJavaUsageTest extends GrHighlightingTestBase { doTest() } - void testSuperInterfaceInheritor() { - doTest( "Create constant field 'bar' in 'I'", 0) + void testUppercaseInSuperInterface() { + doTest( "Create constant field 'BAR' in 'I'", 0) } -} - - +} \ No newline at end of file diff --git a/plugins/groovy/test/org/jetbrains/plugins/groovy/fixes/CreateFieldFromJavaUsageTest.groovy b/plugins/groovy/test/org/jetbrains/plugins/groovy/fixes/CreateFieldFromJavaUsageTest.groovy index a0ce5f71a4b6..f9169b3a22c4 100644 --- a/plugins/groovy/test/org/jetbrains/plugins/groovy/fixes/CreateFieldFromJavaUsageTest.groovy +++ b/plugins/groovy/test/org/jetbrains/plugins/groovy/fixes/CreateFieldFromJavaUsageTest.groovy @@ -1,5 +1,4 @@ // Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. - package org.jetbrains.plugins.groovy.fixes import com.intellij.psi.impl.source.PostprocessReformattingAspect @@ -41,7 +40,7 @@ class CreateFieldFromJavaUsageTest extends GrHighlightingTestBase { doTest() } - void testConstant() { + void testUppercaseField() { doTest() } @@ -73,7 +72,6 @@ class CreateFieldFromJavaUsageTest extends GrHighlightingTestBase { doTest() } - void testParametricMethod() { doTest() } diff --git a/plugins/groovy/testdata/fixes/createConstantFromJava/superInterfaceInheritor/After.groovy b/plugins/groovy/testdata/fixes/createConstantFromJava/superInterfaceInheritor/After.groovy deleted file mode 100644 index 575e54c571bf..000000000000 --- a/plugins/groovy/testdata/fixes/createConstantFromJava/superInterfaceInheritor/After.groovy +++ /dev/null @@ -1,5 +0,0 @@ -// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. -class Generic { - - public List[] foo -} \ No newline at end of file diff --git a/plugins/groovy/testdata/fixes/createConstantFromJava/superInterfaceInheritor/Area.java b/plugins/groovy/testdata/fixes/createConstantFromJava/uppercaseInSuperInterface/Area.java similarity index 65% rename from plugins/groovy/testdata/fixes/createConstantFromJava/superInterfaceInheritor/Area.java rename to plugins/groovy/testdata/fixes/createConstantFromJava/uppercaseInSuperInterface/Area.java index 5cd99f744dba..de1f6ae8e62e 100644 --- a/plugins/groovy/testdata/fixes/createConstantFromJava/superInterfaceInheritor/Area.java +++ b/plugins/groovy/testdata/fixes/createConstantFromJava/uppercaseInSuperInterface/Area.java @@ -1,5 +1,5 @@ class Usage { void usage() { - II.bar; + II.BAR; } } \ No newline at end of file diff --git a/plugins/groovy/testdata/fixes/createConstantFromJava/superInterfaceInheritor/Before.groovy b/plugins/groovy/testdata/fixes/createConstantFromJava/uppercaseInSuperInterface/Before.groovy similarity index 100% rename from plugins/groovy/testdata/fixes/createConstantFromJava/superInterfaceInheritor/Before.groovy rename to plugins/groovy/testdata/fixes/createConstantFromJava/uppercaseInSuperInterface/Before.groovy diff --git a/plugins/groovy/testdata/fixes/createFieldFromJava/constant/After.groovy b/plugins/groovy/testdata/fixes/createFieldFromJava/uppercaseField/After.groovy similarity index 100% rename from plugins/groovy/testdata/fixes/createFieldFromJava/constant/After.groovy rename to plugins/groovy/testdata/fixes/createFieldFromJava/uppercaseField/After.groovy diff --git a/plugins/groovy/testdata/fixes/createFieldFromJava/constant/Area.java b/plugins/groovy/testdata/fixes/createFieldFromJava/uppercaseField/Area.java similarity index 100% rename from plugins/groovy/testdata/fixes/createFieldFromJava/constant/Area.java rename to plugins/groovy/testdata/fixes/createFieldFromJava/uppercaseField/Area.java diff --git a/plugins/groovy/testdata/fixes/createFieldFromJava/constant/Before.groovy b/plugins/groovy/testdata/fixes/createFieldFromJava/uppercaseField/Before.groovy similarity index 100% rename from plugins/groovy/testdata/fixes/createFieldFromJava/constant/Before.groovy rename to plugins/groovy/testdata/fixes/createFieldFromJava/uppercaseField/Before.groovy