mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
disable override object/annotation methods in annotation interface
This commit is contained in:
+1
@@ -30,6 +30,7 @@ public class OverrideImplementExploreUtil {
|
||||
|
||||
@NotNull
|
||||
public static Collection<MethodSignature> getMethodSignaturesToOverride(@NotNull PsiClass aClass) {
|
||||
if (aClass.isInterface()) return Collections.emptySet();
|
||||
return getMapToOverrideImplement(aClass, false).keySet();
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
@interface ff{
|
||||
<caret>
|
||||
}
|
||||
@@ -15,6 +15,7 @@
|
||||
*/
|
||||
package com.intellij.codeInsight;
|
||||
|
||||
import com.intellij.codeInsight.generation.JavaOverrideMethodsHandler;
|
||||
import com.intellij.codeInsight.generation.OverrideImplementUtil;
|
||||
import com.intellij.codeInsight.generation.PsiMethodMember;
|
||||
import com.intellij.codeInsight.intention.impl.ImplementAbstractMethodHandler;
|
||||
@@ -129,6 +130,16 @@ public class OverrideImplementTest extends LightCodeInsightTestCase {
|
||||
checkResultByFile(BASE_DIR + "after" + name + ".java");
|
||||
}
|
||||
|
||||
public void testInAnnotationType() {
|
||||
String name = getTestName(false);
|
||||
configureByFile(BASE_DIR + "before" + name + ".java");
|
||||
int offset = getEditor().getCaretModel().getOffset();
|
||||
PsiElement context = getFile().findElementAt(offset);
|
||||
final PsiClass aClass = PsiTreeUtil.getParentOfType(context, PsiClass.class);
|
||||
assertTrue(aClass != null && aClass.isAnnotationType());
|
||||
assertFalse(new JavaOverrideMethodsHandler().isValidFor(getEditor(), getFile()));
|
||||
}
|
||||
|
||||
private void doTest(boolean copyJavadoc) { doTest(copyJavadoc, null); }
|
||||
|
||||
private void doTest8(boolean copyJavadoc, @Nullable Boolean toImplement) {
|
||||
|
||||
Reference in New Issue
Block a user