mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-05-01 10:48:09 +07:00
MoveFieldAssignmentToInitializer: misc fixes; support Java 12 (IDEA-203693)
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
// "Move assignment to field declaration" "true"
|
||||
public class Main {
|
||||
int i = 1;
|
||||
|
||||
Main() {
|
||||
i += 1;
|
||||
}
|
||||
|
||||
public void test() {
|
||||
i = 1;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
// "Move assignment to field declaration" "true"
|
||||
public class Main {
|
||||
int i = 1;
|
||||
|
||||
public void test(int x) {
|
||||
switch (x) {
|
||||
case 1 -> {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
// "Move assignment to field declaration" "true"
|
||||
public class Main {
|
||||
int i = 1;
|
||||
|
||||
public void test() {
|
||||
Runnable r = () -> {
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
// "Move assignment to field declaration" "false"
|
||||
public class Main {
|
||||
int i;
|
||||
|
||||
Main() {
|
||||
i += 1;
|
||||
}
|
||||
|
||||
public void test() {
|
||||
i +<caret>= 1;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
// "Move assignment to field declaration" "true"
|
||||
public class Main {
|
||||
int i;
|
||||
|
||||
Main() {
|
||||
i += 1;
|
||||
}
|
||||
|
||||
public void test() {
|
||||
i <caret>= 1;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
// "Move assignment to field declaration" "false"
|
||||
public class Main {
|
||||
int i;
|
||||
|
||||
public int test(int x) {
|
||||
return switch (x) {
|
||||
case 1 -> i <caret>= 1;
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
// "Move assignment to field declaration" "true"
|
||||
public class Main {
|
||||
int i;
|
||||
|
||||
public void test(int x) {
|
||||
switch (x) {
|
||||
case 1 -> i <caret>= 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
// "Move assignment to field declaration" "false"
|
||||
import java.util.function.IntSupplier;
|
||||
|
||||
public class Main {
|
||||
int i;
|
||||
|
||||
public void test() {
|
||||
IntSupplier r = () -> i <caret>= 1;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
// "Move assignment to field declaration" "true"
|
||||
public class Main {
|
||||
int i;
|
||||
|
||||
public void test() {
|
||||
Runnable r = () -> i <caret>= 1;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user