delegate default param values: don't mark static method in the interface with default modifier (IDEA-148489)

This commit is contained in:
Anna Kozlova
2015-11-26 19:23:09 +01:00
parent a70b23eefd
commit b611e2abee
3 changed files with 14 additions and 1 deletions
@@ -87,8 +87,9 @@ public class DelegateWithDefaultParamValueIntentionAction extends PsiElementBase
prototype.getModifierList().setModifierProperty(PsiModifier.ABSTRACT, false);
prototype.addBefore(emptyBody, null);
}
final PsiClass aClass = method.getContainingClass();
if (aClass != null && aClass.isInterface()) {
if (aClass != null && aClass.isInterface() && !method.hasModifierProperty(PsiModifier.STATIC)) {
prototype.getModifierList().setModifierProperty(PsiModifier.DEFAULT, true);
}
@@ -0,0 +1,8 @@
// "Generate overloaded method with default parameter value" "true"
interface Test {
static void foo() {
foo();
}
static void foo(int ii) {}
}
@@ -0,0 +1,4 @@
// "Generate overloaded method with default parameter value" "true"
interface Test {
static void foo(int i<caret>i) {}
}