mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
[java extract method] make method static by default
GitOrigin-RevId: 3cac9f65131e216cc2dd43fe58bf0cccbcb69839
This commit is contained in:
committed by
intellij-monorepo-bot
parent
a9fc45aed4
commit
b41164371c
+1
-1
@@ -137,7 +137,7 @@ class MethodExtractor {
|
||||
val annotationAvailable = ExtractMethodHelper.isNullabilityAvailable(options)
|
||||
return ExtractMethodPopupProvider(
|
||||
annotateDefault = if (hasAnnotation && annotationAvailable) needsNullabilityAnnotations(options.project) else null,
|
||||
makeStaticDefault = if (showStatic) false else null,
|
||||
makeStaticDefault = if (showStatic) !makeStaticAndPassFields else null,
|
||||
staticPassFields = makeStaticAndPassFields
|
||||
)
|
||||
}
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ public class Test{
|
||||
extracted();
|
||||
}
|
||||
|
||||
private void extracted() {
|
||||
private static void extracted() {
|
||||
String local = "local";
|
||||
System.out.println("one");
|
||||
System.out.println("two");
|
||||
|
||||
+1
-1
@@ -10,7 +10,7 @@ public class Test{
|
||||
extracted();
|
||||
}
|
||||
|
||||
private void extracted() {
|
||||
private static void extracted() {
|
||||
String local = "local";
|
||||
System.out.println("one");
|
||||
System.out.println(local.toLowerCase());
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ public class Test {
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private String getString() {
|
||||
private static String getString() {
|
||||
String s = "42";
|
||||
return s;
|
||||
}
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ public class Test {
|
||||
return i;
|
||||
}
|
||||
|
||||
private boolean extracted(int i) {
|
||||
private static boolean extracted(int i) {
|
||||
if (i == 42) {
|
||||
return true;
|
||||
} else if (i == 17) {
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@ public class Test {
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private String getString() {
|
||||
private static String getString() {
|
||||
if (new Random().nextBoolean()) {
|
||||
System.out.println();
|
||||
return "one";
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ class Test {
|
||||
System.out.println(x);
|
||||
}
|
||||
|
||||
private int getAnInt() {
|
||||
private static int getAnInt() {
|
||||
int x = 42;
|
||||
return x;
|
||||
}
|
||||
|
||||
+1
-1
@@ -11,7 +11,7 @@ class T {
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private ArrayList<String> getList1() {
|
||||
private static ArrayList<String> getList1() {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -7,7 +7,7 @@ class Test {
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private byte[] getBytes(String one) {
|
||||
private static byte[] getBytes(String one) {
|
||||
return one.getBytes();
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -4,7 +4,7 @@ class Test {
|
||||
extracted();
|
||||
}
|
||||
|
||||
private void extracted() {
|
||||
private static void extracted() {
|
||||
System.out.println();
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -6,7 +6,7 @@ public class Test {
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private String getR(String p) {
|
||||
private static String getR(String p) {
|
||||
return p.toLowerCase();
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@ public class Test {
|
||||
return getString(s[i]);
|
||||
}
|
||||
|
||||
private String getString(String s) {
|
||||
private static String getString(String s) {
|
||||
return s;
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -4,7 +4,7 @@ class Test {
|
||||
System.out.println(x);
|
||||
}
|
||||
|
||||
private int getX1() {
|
||||
private static int getX1() {
|
||||
int x = 42;
|
||||
return x;
|
||||
}
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ class Test {
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private String getString() {
|
||||
private static String getString() {
|
||||
final String str = "atata";
|
||||
do {
|
||||
System.out.println();
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ public class Sample2 {
|
||||
extracted();
|
||||
}
|
||||
|
||||
private void extracted() {
|
||||
private static void extracted() {
|
||||
int a = 1;
|
||||
int b = 2;
|
||||
a = 42;
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@ public class Test1 {
|
||||
}
|
||||
}
|
||||
|
||||
private void extracted() {
|
||||
private static void extracted() {
|
||||
System.out.println("one");
|
||||
System.out.println("two");
|
||||
}
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@ public class Test {
|
||||
System.out.println();
|
||||
}
|
||||
|
||||
private void extracted() {
|
||||
private static void extracted() {
|
||||
System.out.println();
|
||||
System.out.println();
|
||||
System.out.println();
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@ class Test {
|
||||
extracted("string", "string");
|
||||
}
|
||||
|
||||
private void extracted(String string, String string1) {
|
||||
private static void extracted(String string, String string1) {
|
||||
System.out.println(string);
|
||||
System.out.println(string1);
|
||||
}
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ class Test {
|
||||
renamed();
|
||||
}
|
||||
|
||||
private void renamed() {
|
||||
private static void renamed() {
|
||||
System.out.println();
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -4,7 +4,7 @@ class Test {
|
||||
int avgB = average(100, 200);
|
||||
}
|
||||
|
||||
private int average(int x, int x1) {
|
||||
private static int average(int x, int x1) {
|
||||
return x + x1 / 2;
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -7,7 +7,7 @@ class Test {
|
||||
extracted(s);
|
||||
}
|
||||
|
||||
private void extracted(Stream<Object> s) {
|
||||
private static void extracted(Stream<Object> s) {
|
||||
System.out.println(s);
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -12,7 +12,7 @@ public class Test {
|
||||
return y;
|
||||
}
|
||||
|
||||
private int getY(int x, int y) throws FileNotFoundException {
|
||||
private static int getY(int x, int y) throws FileNotFoundException {
|
||||
new Scanner(new File("file.txt"));
|
||||
y = y + x;
|
||||
y = y / x;
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@ class Test {
|
||||
extracted();
|
||||
}
|
||||
|
||||
private void extracted() {
|
||||
private static void extracted() {
|
||||
System.out.println();
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -11,7 +11,7 @@ public abstract class Test {
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private String renamed() {
|
||||
private static String renamed() {
|
||||
return "4" + "2";
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -3,7 +3,7 @@ class Test {
|
||||
sayHello("Hello!", "user");
|
||||
}
|
||||
|
||||
private void sayHello(String s, String user) {
|
||||
private static void sayHello(String s, String user) {
|
||||
System.out.println(s);
|
||||
System.out.println(user);
|
||||
}
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@ class Test {
|
||||
valid();
|
||||
}
|
||||
|
||||
private void valid() {
|
||||
private static void valid() {
|
||||
System.out.println();
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ class Test {
|
||||
System.out.println(x);
|
||||
}
|
||||
|
||||
private int getX() {
|
||||
private static int getX() {
|
||||
int x = 42;
|
||||
return x;
|
||||
}
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ public class Sample2 {
|
||||
extracted();
|
||||
}
|
||||
|
||||
private void extracted() {
|
||||
private static void extracted() {
|
||||
int a = 1;
|
||||
int b = 2;
|
||||
a = 42;
|
||||
|
||||
+1
-1
@@ -13,7 +13,7 @@ public class Test {
|
||||
};
|
||||
}
|
||||
|
||||
private String getString(String one) {
|
||||
private static String getString(String one) {
|
||||
System.out.println();
|
||||
return one;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user