From 72ecc025e2677e2f94bb8d198ee505ddd3bd2384 Mon Sep 17 00:00:00 2001 From: peter Date: Mon, 18 Jun 2012 16:39:52 +0200 Subject: [PATCH] suggest abstract in interface (IDEA-85701) --- .../com/intellij/codeInsight/completion/ModifierChooser.java | 2 +- .../codeInsight/completion/keywords/abstractInInterface.java | 3 +++ .../intellij/codeInsight/completion/KeywordCompletionTest.java | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 java/java-tests/testData/codeInsight/completion/keywords/abstractInInterface.java diff --git a/java/java-impl/src/com/intellij/codeInsight/completion/ModifierChooser.java b/java/java-impl/src/com/intellij/codeInsight/completion/ModifierChooser.java index 71c70f4c657e..f972eddcf227 100644 --- a/java/java-impl/src/com/intellij/codeInsight/completion/ModifierChooser.java +++ b/java/java-impl/src/com/intellij/codeInsight/completion/ModifierChooser.java @@ -71,7 +71,7 @@ public class ModifierChooser { return addKeywords(list, inInterface ? new String[][]{ new String[]{"public", "protected"}, new String[]{"static"}, - new String[]{"final"} + new String[]{"final", "abstract"} } : new String[][]{ new String[]{"public", "protected", "private"}, new String[]{"static"}, diff --git a/java/java-tests/testData/codeInsight/completion/keywords/abstractInInterface.java b/java/java-tests/testData/codeInsight/completion/keywords/abstractInInterface.java new file mode 100644 index 000000000000..701fa8c4096f --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/keywords/abstractInInterface.java @@ -0,0 +1,3 @@ +interface I { + +} \ No newline at end of file diff --git a/java/java-tests/testSrc/com/intellij/codeInsight/completion/KeywordCompletionTest.java b/java/java-tests/testSrc/com/intellij/codeInsight/completion/KeywordCompletionTest.java index 7e407253dab0..1539a06e4bfa 100644 --- a/java/java-tests/testSrc/com/intellij/codeInsight/completion/KeywordCompletionTest.java +++ b/java/java-tests/testSrc/com/intellij/codeInsight/completion/KeywordCompletionTest.java @@ -90,6 +90,7 @@ public class KeywordCompletionTest extends LightCompletionTestCase { public void testNullInMethodCall() throws Exception { doTest(false); } public void testNullInMethodCall2() throws Exception { doTest(false); } public void testNewInMethodRefs() throws Exception { doTest(false); } + public void testAbstractInInterface() throws Exception { doTest(1, "abstract"); } public void testTryInExpression() throws Exception { configureByFile(BASE_PATH + "/" + getTestName(true) + ".java");