Java: Fixed modifiers when extracting method from default or private method in interface (IDEA-211141)

This commit is contained in:
Pavel Dolgov
2019-04-18 16:28:01 +03:00
parent 0b05b96778
commit aa1b72ba7a
8 changed files with 103 additions and 10 deletions
@@ -0,0 +1,8 @@
public interface FromDefaultMethodInInterface {
default void test(String a, String b) {
<selection>
String c = a + b;
System.out.println(c);
</selection>
}
}
@@ -0,0 +1,12 @@
public interface FromDefaultMethodInInterface {
default void test(String a, String b) {
newMethod(a, b);
}
private void newMethod(String a, String b) {
String c = a + b;
System.out.println(c);
}
}
@@ -0,0 +1,8 @@
public interface FromPrivateMethodInInterface {
private void test(String a, String b) {
<selection>
String c = a + b;
System.out.println(c);
</selection>
}
}
@@ -0,0 +1,12 @@
public interface FromPrivateMethodInInterface {
private void test(String a, String b) {
newMethod(a, b);
}
private void newMethod(String a, String b) {
String c = a + b;
System.out.println(c);
}
}
@@ -0,0 +1,8 @@
public interface FromStaticMethodInInterface {
static void test(String a, String b) {
<selection>
String c = a + b;
System.out.println(c);
</selection>
}
}
@@ -0,0 +1,12 @@
public interface FromStaticMethodInInterface {
static void test(String a, String b) {
newMethod(a, b);
}
static void newMethod(String a, String b) {
String c = a + b;
System.out.println(c);
}
}