diff --git a/platform/util/src/com/intellij/util/io/PersistentEnumerator.java b/platform/util/src/com/intellij/util/io/PersistentEnumerator.java index 1b98322993ee..7fb982bd152f 100644 --- a/platform/util/src/com/intellij/util/io/PersistentEnumerator.java +++ b/platform/util/src/com/intellij/util/io/PersistentEnumerator.java @@ -35,7 +35,7 @@ import java.util.List; * @author max * @author jeka */ -public class PersistentEnumerator implements Forceable { +public class PersistentEnumerator implements Forceable, Closeable { private static final Logger LOG = Logger.getInstance("#com.intellij.util.io.PersistentEnumerator"); protected static final int NULL_ID = 0; protected static final int DATA_OFFSET = 8; diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/psi/impl/statements/typedef/GrEnumTypeDefinitionImpl.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/psi/impl/statements/typedef/GrEnumTypeDefinitionImpl.java index f0d412bcef89..46ce8c55f3df 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/psi/impl/statements/typedef/GrEnumTypeDefinitionImpl.java +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/psi/impl/statements/typedef/GrEnumTypeDefinitionImpl.java @@ -36,6 +36,7 @@ import org.jetbrains.plugins.groovy.lang.psi.api.statements.typedef.members.GrEn import org.jetbrains.plugins.groovy.lang.psi.api.statements.typedef.members.GrEnumConstantList; import org.jetbrains.plugins.groovy.lang.psi.impl.statements.expressions.TypesUtil; import org.jetbrains.plugins.groovy.lang.psi.stubs.GrTypeDefinitionStub; +import org.jetbrains.plugins.groovy.lang.psi.util.GroovyCommonClassNames; import org.jetbrains.plugins.groovy.lang.resolve.processors.ClassHint; import static org.jetbrains.plugins.groovy.GroovyFileType.GROOVY_LANGUAGE; @@ -71,7 +72,7 @@ public class GrEnumTypeDefinitionImpl extends GrTypeDefinitionImpl implements Gr @NotNull public PsiClassType[] getExtendsListTypes() { - return new PsiClassType[]{createEnumType()}; + return new PsiClassType[]{createEnumType(), createGroovyObjectSupportType()}; } protected String[] getExtendsNames() { @@ -94,6 +95,10 @@ public class GrEnumTypeDefinitionImpl extends GrTypeDefinitionImpl implements Gr return TypesUtil.createTypeByFQClassName(JAVA_LANG_ENUM, this); } + private PsiClassType createGroovyObjectSupportType() { + return TypesUtil.createTypeByFQClassName(GroovyCommonClassNames.GROOVY_OBJECT_SUPPORT, this); + } + @NotNull public GrField[] getFields() { GrField[] bodyFields = super.getFields(); diff --git a/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/GroovyHighlightingTest.java b/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/GroovyHighlightingTest.java index fdaf9f35de40..ee21a7511492 100644 --- a/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/GroovyHighlightingTest.java +++ b/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/GroovyHighlightingTest.java @@ -44,8 +44,8 @@ public class GroovyHighlightingTest extends LightCodeInsightFixtureTestCase { @Override public void configureModule(Module module, ModifiableRootModel model, ContentEntry contentEntry) { final Library.ModifiableModel modifiableModel = model.getModuleLibraryTable().createLibrary("GROOVY").getModifiableModel(); - final VirtualFile groovyJar = - JarFileSystem.getInstance().refreshAndFindFileByPath(TestUtils.getMockGroovy1_8LibraryName()+"!/"); + final VirtualFile groovyJar = JarFileSystem.getInstance().refreshAndFindFileByPath(TestUtils.getMockGroovy1_8LibraryName()+"!/"); + assertTrue(groovyJar != null); modifiableModel.addRoot(groovyJar, OrderRootType.CLASSES); modifiableModel.commit(); } @@ -428,4 +428,8 @@ public class GroovyHighlightingTest extends LightCodeInsightFixtureTestCase { public void testDelegatedMethodIsImplemented() { doTest(); } + + public void testEnumImplementsAllGroovyObjectMethods() { + doTest(); + } } \ No newline at end of file diff --git a/plugins/groovy/testdata/highlighting/EnumImplementsAllGroovyObjectMethods.groovy b/plugins/groovy/testdata/highlighting/EnumImplementsAllGroovyObjectMethods.groovy new file mode 100644 index 000000000000..cfa2a5e0b606 --- /dev/null +++ b/plugins/groovy/testdata/highlighting/EnumImplementsAllGroovyObjectMethods.groovy @@ -0,0 +1,11 @@ +enum E { + a, b, c +} + +interface I { + def foo() +} + +enum EI implements I { + +} \ No newline at end of file diff --git a/plugins/groovy/testdata/refactoring/move/moveMembers/outerClassTypeParameters/after/pack1/A.groovy b/plugins/groovy/testdata/refactoring/move/moveMembers/outerClassTypeParameters/after/pack1/A.groovy index 1768d2266225..b53d354d83cf 100644 --- a/plugins/groovy/testdata/refactoring/move/moveMembers/outerClassTypeParameters/after/pack1/A.groovy +++ b/plugins/groovy/testdata/refactoring/move/moveMembers/outerClassTypeParameters/after/pack1/A.groovy @@ -1,5 +1,7 @@ package pack1; +import java.util.ArrayList; +import java.util.List; public class A { } \ No newline at end of file diff --git a/plugins/maven/src/main/java/org/jetbrains/idea/maven/indices/MavenIndex.java b/plugins/maven/src/main/java/org/jetbrains/idea/maven/indices/MavenIndex.java index 39b104c7738a..e541585e25ee 100644 --- a/plugins/maven/src/main/java/org/jetbrains/idea/maven/indices/MavenIndex.java +++ b/plugins/maven/src/main/java/org/jetbrains/idea/maven/indices/MavenIndex.java @@ -651,7 +651,7 @@ public class MavenIndex { if (exceptions[0] != null) throw exceptions[0]; } - private void safeClose(PersistentEnumerator enumerator, MavenIndexException[] exceptions) { + private void safeClose(Closeable enumerator, MavenIndexException[] exceptions) { try { if (enumerator != null) enumerator.close(); }