mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-16 22:51:17 +07:00
introduce functional: combine extract method & introduce
IDEA-174011; IDEA-174021
This commit is contained in:
@@ -1,14 +1,14 @@
|
||||
import java.util.function.Supplier;
|
||||
|
||||
class Test {
|
||||
void foo() {
|
||||
void foo() {
|
||||
if (true) {
|
||||
Supplier<String> stringSupplier = new Supplier<String>() {
|
||||
Supplier<String> supplier = new Supplier<String>() {
|
||||
public String get() {
|
||||
return "Hello, world";
|
||||
}
|
||||
};
|
||||
System.out.println(stringSupplier.get());
|
||||
System.out.println(supplier.get());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,12 +1,12 @@
|
||||
import java.util.function.Supplier;
|
||||
|
||||
class Test {
|
||||
void foo() {
|
||||
Supplier<String> stringSupplier = new Supplier<String>() {
|
||||
public String get() {
|
||||
return "Hello, world";
|
||||
}
|
||||
};
|
||||
System.out.println(stringSupplier.get());
|
||||
void foo() {
|
||||
Supplier<String> supplier = new Supplier<String>() {
|
||||
public String get() {
|
||||
return "Hello, world";
|
||||
}
|
||||
};
|
||||
System.out.println(supplier.get());
|
||||
}
|
||||
}
|
||||
@@ -1,15 +1,15 @@
|
||||
import java.util.function.Consumer;
|
||||
|
||||
class Test {
|
||||
String myName;
|
||||
String myName;
|
||||
void foo() {
|
||||
if (true) {
|
||||
Consumer<String> stringConsumer = new Consumer<String>() {
|
||||
Consumer<String> consumer = new Consumer<String>() {
|
||||
public void accept(String myName) {
|
||||
System.out.println("Hello, world " + myName);
|
||||
}
|
||||
};
|
||||
stringConsumer.accept(myName);
|
||||
consumer.accept(myName);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,14 +1,14 @@
|
||||
import java.util.function.Consumer;
|
||||
|
||||
class Test {
|
||||
void foo(String s) {
|
||||
void foo(String s) {
|
||||
if (true) {
|
||||
Consumer<String> stringConsumer = new Consumer<String>() {
|
||||
Consumer<String> consumer = new Consumer<String>() {
|
||||
public void accept(String s) {
|
||||
System.out.println("Hello, world " + s);
|
||||
}
|
||||
};
|
||||
stringConsumer.accept(s);
|
||||
consumer.accept(s);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,16 +1,16 @@
|
||||
import java.util.function.Consumer;
|
||||
|
||||
class Test {
|
||||
void foo(String s) {
|
||||
void foo(String s) {
|
||||
if (true) {
|
||||
Consumer<String> stringConsumer = new Consumer<String>() {
|
||||
Consumer<String> consumer = new Consumer<String>() {
|
||||
public void accept(String s) {
|
||||
System.out.println("Hello, world " + s);
|
||||
System.out.println();
|
||||
}
|
||||
};
|
||||
stringConsumer.accept(s);
|
||||
|
||||
consumer.accept(s);
|
||||
|
||||
System.out.println();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user