mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
follow IDEA-CR-26141
This commit is contained in:
+2
-3
@@ -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,
|
||||
|
||||
+1
-1
@@ -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 {
|
||||
|
||||
+1
-1
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user