follow IDEA-CR-26141

This commit is contained in:
Anna.Kozlova
2017-10-27 20:18:47 +02:00
parent 03e604991a
commit f368f326dc
3 changed files with 4 additions and 5 deletions
@@ -479,9 +479,8 @@ public class HighlightClassUtil {
@Nullable
static HighlightInfo checkCannotInheritFromFinal(PsiClass superClass, PsiElement elementToHighlight) {
HighlightInfo errorResult = null;
boolean isFinal = superClass.hasModifierProperty(PsiModifier.FINAL);
if (isFinal || superClass.isEnum()) {
String message = JavaErrorMessages.message("inheritance.from.final.class", superClass.getQualifiedName(), isFinal ? PsiKeyword.FINAL : PsiKeyword.ENUM);
if (superClass.hasModifierProperty(PsiModifier.FINAL) || superClass.isEnum()) {
String message = JavaErrorMessages.message("inheritance.from.final.class", superClass.getQualifiedName(), superClass.isEnum() ? PsiKeyword.ENUM : PsiKeyword.FINAL);
errorResult =
HighlightInfo.newHighlightInfo(HighlightInfoType.ERROR).range(elementToHighlight).descriptionAndTooltip(message).create();
QuickFixAction.registerQuickFixAction(errorResult,
@@ -38,7 +38,7 @@ enum Operation {
<error descr="'valueOf(String)' is already defined in 'Operation'">void valueOf(String s)</error> {}
}
<error descr="There is no default constructor available in 'Operation'">class exte extends <error descr="Cannot inherit from final 'Operation'">Operation</error></error> {
<error descr="There is no default constructor available in 'Operation'">class exte extends <error descr="Cannot inherit from enum 'Operation'">Operation</error></error> {
}
enum withConstant {
@@ -38,7 +38,7 @@ enum Operation {
<error descr="'valueOf(String)' is already defined in 'Operation'">void valueOf(String s)</error> {}
}
<error descr="There is no default constructor available in 'Operation'">class exte extends <error descr="Cannot inherit from final 'Operation'">Operation</error></error> {
<error descr="There is no default constructor available in 'Operation'">class exte extends <error descr="Cannot inherit from enum 'Operation'">Operation</error></error> {
}
class use {