mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-26 19:06:24 +07:00
introduce code block parameter: extract from code block
This commit is contained in:
+1
-1
@@ -10,7 +10,7 @@ class Test {
|
||||
});
|
||||
}
|
||||
|
||||
void foo(int i, Consumer<Integer> anObject){
|
||||
void foo(int i, Consumer<Integer> anObject) {
|
||||
|
||||
anObject.accept(i);
|
||||
|
||||
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
import java.util.function.Consumer;
|
||||
|
||||
class Test {
|
||||
void bar() {
|
||||
foo(1, new Consumer<Integer>() {
|
||||
public void accept(Integer i) {
|
||||
System.out.println(i);
|
||||
System.out.println(i);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
void foo(int i, Consumer<Integer> anObject) {
|
||||
if (i > 0) {
|
||||
|
||||
anObject.accept(i);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -8,7 +8,7 @@ class Test {
|
||||
});
|
||||
}
|
||||
|
||||
void foo(Runnable anObject){
|
||||
void foo(Runnable anObject) {
|
||||
|
||||
anObject.run();
|
||||
|
||||
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
class Test {
|
||||
void bar() {
|
||||
foo(1);
|
||||
}
|
||||
|
||||
void foo(int i) {
|
||||
if (i > 0) {
|
||||
<selection>
|
||||
System.out.println(i);
|
||||
System.out.println(i);
|
||||
</selection>
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user