wording: don't suggest to make enum constant abstract (IDEA-98165)

This commit is contained in:
anna
2012-12-28 18:33:13 +01:00
parent 4f7a6d0de0
commit 7646fda820
3 changed files with 4 additions and 3 deletions
@@ -93,7 +93,7 @@ public class HighlightClassUtil {
}
String baseClassName = HighlightUtil.formatClass(aClass, false);
String methodName = HighlightUtil.formatMethod(abstractMethod);
String message = JavaErrorMessages.message("class.must.be.abstract",
String message = JavaErrorMessages.message(aClass instanceof PsiEnumConstantInitializer ? "enum.constant.should.implement.method" : "class.must.be.abstract",
baseClassName,
methodName,
HighlightUtil.formatClass(abstractMethod.getContainingClass(), false));
@@ -95,6 +95,7 @@ implements.after.interface=No implements clause allowed for interface
extends.after.enum=No extends clause allowed for enum
static.declaration.in.inner.class=Inner classes cannot have static declarations
class.must.be.abstract=Class ''{0}'' must either be declared abstract or implement abstract method ''{1}'' in ''{2}''
enum.constant.should.implement.method=Class ''{0}'' must implement abstract method ''{1}'' in ''{2}''
abstract.cannot.be.instantiated=''{0}'' is abstract; cannot be instantiated
duplicate.class.in.other.file=Duplicate class found in the file ''{0}''
duplicate.class=Duplicate class: ''{0}''
@@ -1,5 +1,5 @@
<error descr="Modifier 'abstract' not allowed here">abstract</error> enum OurEnum {
A <error descr="Class 'Anonymous class derived from OurEnum' must either be declared abstract or implement abstract method 'foo()' in 'OurEnum'">{</error>
A <error descr="Class 'Anonymous class derived from OurEnum' must implement abstract method 'foo()' in 'OurEnum'">{</error>
},
<error descr="'OurEnum' is abstract; cannot be instantiated">B</error>,
C {
@@ -12,7 +12,7 @@
enum xxx {
<error descr="'xxx' is abstract; cannot be instantiated">X</error>,
Y <error descr="Class 'Anonymous class derived from xxx' must either be declared abstract or implement abstract method 'f()' in 'xxx'">{</error>
Y <error descr="Class 'Anonymous class derived from xxx' must implement abstract method 'f()' in 'xxx'">{</error>
};
abstract void f();