diff --git a/plugins/groovy/resources/standardDsls/defaultMethods.gdsl b/plugins/groovy/resources/standardDsls/defaultMethods.gdsl index e9f72c8e0e48..1dad375ed268 100644 --- a/plugins/groovy/resources/standardDsls/defaultMethods.gdsl +++ b/plugins/groovy/resources/standardDsls/defaultMethods.gdsl @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 JetBrains s.r.o. + * Copyright 2000-2014 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -63,8 +63,3 @@ contributor(ctype:"groovy.lang.GString") { contributor(ctype: 'groovy.lang.MetaClass') { property name: 'static' } - -contributor(ctype: 'java.lang.Enum') { - method(type: psiClass.qualName, name: 'valueOf', params: [name: 'java.lang.String'], isStatic: true) -} - 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 de7d4cfb5ae0..7d7951dd4fe7 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 @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 JetBrains s.r.o. + * Copyright 2000-2014 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -133,7 +133,7 @@ public class GrEnumTypeDefinitionImpl extends GrTypeDefinitionImpl implements Gr return CachedValuesManager.getCachedValue(this, new CachedValueProvider() { @Override public Result compute() { - PsiMethod[] defMethods = new PsiMethod[3]; + PsiMethod[] defMethods = new PsiMethod[4]; final PsiManagerEx manager = getManager(); final PsiElementFactory factory = JavaPsiFacade.getElementFactory(getProject()); defMethods[0] = new LightMethodBuilder(manager, GROOVY_LANGUAGE, "values") @@ -151,6 +151,14 @@ public class GrEnumTypeDefinitionImpl extends GrTypeDefinitionImpl implements Gr .setMethodReturnType(factory.createType(GrEnumTypeDefinitionImpl.this)) .setContainingClass(GrEnumTypeDefinitionImpl.this) .addModifier(PsiModifier.PUBLIC); + + defMethods[3] = new LightMethodBuilder(manager, GROOVY_LANGUAGE, "valueOf") + .setMethodReturnType(factory.createType(GrEnumTypeDefinitionImpl.this)) + .setContainingClass(GrEnumTypeDefinitionImpl.this) + .addParameter("name", CommonClassNames.JAVA_LANG_STRING) + .addModifier(PsiModifier.PUBLIC) + .addModifier(PsiModifier.STATIC); + return Result.create(defMethods, GrEnumTypeDefinitionImpl.this); } });