completion in interfaces: avoid default/static combination

This commit is contained in:
Anna.Kozlova
2016-11-28 15:38:48 +01:00
parent 5098bf49fc
commit 6c9fe553e9
2 changed files with 3 additions and 9 deletions
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2013 JetBrains s.r.o.
* Copyright 2000-2016 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -477,12 +477,6 @@ public class JavaKeywordCompletion {
for (String s : ModifierChooser.getKeywords(position)) {
result.consume(new OverrideableSpace(createKeyword(position, s), TailType.HUMBLE_SPACE_BEFORE_WORD));
}
if (PsiUtil.isLanguageLevel8OrHigher(position)) {
PsiClass containingClass = PsiTreeUtil.getParentOfType(position, PsiClass.class);
if (containingClass != null && containingClass.isInterface()) {
result.consume(new OverrideableSpace(createKeyword(position, PsiKeyword.DEFAULT), TailType.HUMBLE_SPACE_BEFORE_WORD));
}
}
result.consume(new OverrideableSpace(createKeyword(position, PsiKeyword.CLASS), TailType.HUMBLE_SPACE_BEFORE_WORD));
if (PsiTreeUtil.getParentOfType(position, PsiCodeBlock.class, true, PsiMember.class) == null) {
@@ -51,13 +51,13 @@ public class ModifierChooser {
private static final String[][] INTERFACE_9_MEMBER_MODIFIERS = {
{PsiKeyword.PUBLIC, PsiKeyword.PROTECTED, PsiKeyword.PRIVATE},
{PsiKeyword.STATIC},
{PsiKeyword.STATIC, PsiKeyword.DEFAULT},
{PsiKeyword.FINAL, PsiKeyword.ABSTRACT}
};
private static final String[][] INTERFACE_8_MEMBER_MODIFIERS = {
{PsiKeyword.PUBLIC, PsiKeyword.PROTECTED},
{PsiKeyword.STATIC},
{PsiKeyword.STATIC, PsiKeyword.DEFAULT},
{PsiKeyword.FINAL, PsiKeyword.ABSTRACT}
};