mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
disable make method default for annotation types
This commit is contained in:
@@ -47,7 +47,7 @@ public class MakeMethodDefaultIntention extends BaseElementAtCaretIntentionActio
|
||||
if (psiMethod != null && PsiUtil.isLanguageLevel8OrHigher(psiMethod)) {
|
||||
if (psiMethod.getBody() == null && !psiMethod.hasModifierProperty(PsiModifier.DEFAULT)) {
|
||||
final PsiClass containingClass = psiMethod.getContainingClass();
|
||||
if (containingClass != null && containingClass.isInterface()) {
|
||||
if (containingClass != null && containingClass.isInterface() && !containingClass.isAnnotationType()) {
|
||||
text = "Make '" + psiMethod.getName() + "()' default";
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
@interface I {
|
||||
String fo<caret>o() default "foo";
|
||||
}
|
||||
@@ -15,7 +15,6 @@
|
||||
*/
|
||||
package com.siyeh.ipp.types;
|
||||
|
||||
import com.siyeh.IntentionPowerPackBundle;
|
||||
import com.siyeh.ipp.IPPTestCase;
|
||||
|
||||
public class MakeMethodDefaultTest extends IPPTestCase {
|
||||
@@ -41,4 +40,9 @@ public class MakeMethodDefaultTest extends IPPTestCase {
|
||||
public void testAlreadyHasBody() throws Exception {
|
||||
assertIntentionNotAvailable();
|
||||
}
|
||||
|
||||
public void testAnnotationType() throws Exception {
|
||||
assertIntentionNotAvailable();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user