mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-10 18:09:38 +07:00
[java-inspections] More tests for preview
GitOrigin-RevId: 6b6405ee4491ad1d58947547c40df6fb2d291ab7
This commit is contained in:
committed by
intellij-monorepo-bot
parent
bbb218a972
commit
dd689d3a39
@@ -1,4 +1,4 @@
|
||||
// "Remove switch branch 'default'" "true"
|
||||
// "Remove switch branch 'default'" "true-preview"
|
||||
enum Day {
|
||||
MONDAY, TUESDAY, WEDNESDAY
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Remove switch branch '"baz"'" "true"
|
||||
// "Remove switch branch '"baz"'" "true-preview"
|
||||
class Main {
|
||||
public void test() {
|
||||
switch ("foo") {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Remove switch label '"qux"'" "true"
|
||||
// "Remove switch label '"qux"'" "true-preview"
|
||||
class Main {
|
||||
public void test() {
|
||||
switch ("foo") {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Remove switch label '"bar"'" "true"
|
||||
// "Remove switch label '"bar"'" "true-preview"
|
||||
class Main {
|
||||
public void test() {
|
||||
switch ("foo") {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Remove switch label '0-/*x*/1'" "true"
|
||||
// "Remove switch label '0-/*x*/1'" "true-preview"
|
||||
class Main {
|
||||
static void fff(int x) {
|
||||
if (x > 0) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Remove switch branch '-/*x*/1'" "true"
|
||||
// "Remove switch branch '-/*x*/1'" "true-preview"
|
||||
class Main {
|
||||
static void fff(int x) {
|
||||
if (x > 0) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Remove switch branch '"bar"'" "true"
|
||||
// "Remove switch branch '"bar"'" "true-preview"
|
||||
class Main {
|
||||
public void test() {
|
||||
switch ("foo") {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Remove unreachable branches" "true"
|
||||
// "Remove unreachable branches" "true-preview"
|
||||
class Main {
|
||||
static void fff() {
|
||||
System.out.println("one");
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Remove switch branch 'Integer i'" "true"
|
||||
// "Remove switch branch 'Integer i'" "true-preview"
|
||||
class Test {
|
||||
int foo(Object o) {
|
||||
return switch (o) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Remove switch branch '2'" "true"
|
||||
// "Remove switch branch '2'" "true-preview"
|
||||
class Main {
|
||||
void test(Integer i) {
|
||||
switch (i) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Remove switch branch 'default'" "true"
|
||||
// "Remove switch branch 'default'" "true-preview"
|
||||
class Main {
|
||||
void test(Integer i) {
|
||||
switch (i) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Remove switch label 'default'" "true"
|
||||
// "Remove switch label 'default'" "true-preview"
|
||||
class Main {
|
||||
void test(Integer i) {
|
||||
switch (i) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Remove switch label '2'" "true"
|
||||
// "Remove switch label '2'" "true-preview"
|
||||
class Main {
|
||||
void test(Integer i) {
|
||||
switch (i) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Remove switch branch 'null'" "true"
|
||||
// "Remove switch branch 'null'" "true-preview"
|
||||
class Main {
|
||||
void test(Integer i) {
|
||||
switch (i) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Remove switch label 'null'" "true"
|
||||
// "Remove switch label 'null'" "true-preview"
|
||||
class Main {
|
||||
void test(Integer i) {
|
||||
switch (i) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Remove switch branch 'A'" "true"
|
||||
// "Remove switch branch 'A'" "true-preview"
|
||||
class X {
|
||||
enum X {A,B,C}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Remove switch label 'default'" "true"
|
||||
// "Remove switch label 'default'" "true-preview"
|
||||
enum Day {
|
||||
MONDAY, TUESDAY, WEDNESDAY
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Remove switch branch '((Integer ii && true))'" "true"
|
||||
// "Remove switch branch '((Integer ii && true))'" "true-preview"
|
||||
class Test {
|
||||
Integer i = 1;
|
||||
void test() {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Remove switch branch 'Day dd && true'" "true"
|
||||
// "Remove switch branch 'Day dd && true'" "true-preview"
|
||||
enum Day {
|
||||
MONDAY, TUESDAY, WEDNESDAY
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Remove unreachable branches" "true"
|
||||
// "Remove unreachable branches" "true-preview"
|
||||
class Main {
|
||||
static void fff(int x) {
|
||||
if (x == 5) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Remove unreachable branches" "true"
|
||||
// "Remove unreachable branches" "true-preview"
|
||||
class Main {
|
||||
static void fff(int x) {
|
||||
if (x == 5) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Remove unreachable branches" "true"
|
||||
// "Remove unreachable branches" "true-preview"
|
||||
class Main {
|
||||
static void fff(int x) {
|
||||
if (x == 5) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Remove unreachable branches" "true"
|
||||
// "Remove unreachable branches" "true-preview"
|
||||
class Main {
|
||||
static void fff(int x) {
|
||||
if (x == 5) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Remove unreachable branches" "true"
|
||||
// "Remove unreachable branches" "true-preview"
|
||||
class Main {
|
||||
void foo(int x) {
|
||||
if (x == 42) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Remove unreachable branches" "true"
|
||||
// "Remove unreachable branches" "true-preview"
|
||||
class Main {
|
||||
void foo(int x) {
|
||||
if (x == 42) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Remove unreachable branches" "true"
|
||||
// "Remove unreachable branches" "true-preview"
|
||||
class Main {
|
||||
void foo(int x) {
|
||||
if (x == 42) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Remove unreachable branches" "true"
|
||||
// "Remove unreachable branches" "true-preview"
|
||||
class Main {
|
||||
void foo(int x) {
|
||||
if (x == 42) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Remove unreachable branches" "true"
|
||||
// "Remove unreachable branches" "true-preview"
|
||||
class Main {
|
||||
static void fff(int x) {
|
||||
if (x == 5) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Remove unreachable branches" "true"
|
||||
// "Remove unreachable branches" "true-preview"
|
||||
class Test {
|
||||
void test(Number n) {
|
||||
n = 1;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Remove unreachable branches" "true"
|
||||
// "Remove unreachable branches" "true-preview"
|
||||
class Test {
|
||||
void test(Number n) {
|
||||
n = 1;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Remove unreachable branches" "true"
|
||||
// "Remove unreachable branches" "true-preview"
|
||||
class Test {
|
||||
void test(Number n) {
|
||||
n = 1;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Remove unreachable branches" "true"
|
||||
// "Remove unreachable branches" "true-preview"
|
||||
class Test {
|
||||
void test(Number n) {
|
||||
n = 1;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Remove unreachable branches" "true"
|
||||
// "Remove unreachable branches" "true-preview"
|
||||
class Test {
|
||||
void test(Number n) {
|
||||
n = 1;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Remove unreachable branches" "true"
|
||||
// "Remove unreachable branches" "true-preview"
|
||||
class Test {
|
||||
Number n = 1;
|
||||
int result;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Remove unreachable branches" "true"
|
||||
// "Remove unreachable branches" "true-preview"
|
||||
class Test {
|
||||
|
||||
int test(Number n) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Remove unreachable branches" "true"
|
||||
// "Remove unreachable branches" "true-preview"
|
||||
import java.util.concurrent.ThreadLocalRandom;
|
||||
|
||||
class Test {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Remove unreachable branches" "true"
|
||||
// "Remove unreachable branches" "true-preview"
|
||||
import java.util.concurrent.ThreadLocalRandom;
|
||||
class Test {
|
||||
void test(Number n) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Remove unreachable branches" "true"
|
||||
// "Remove unreachable branches" "true-preview"
|
||||
|
||||
class Test {
|
||||
final String s = "abc";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Remove unreachable branches" "true"
|
||||
// "Remove unreachable branches" "true-preview"
|
||||
class Test {
|
||||
final String s = "abc";
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Remove unreachable branches" "true"
|
||||
// "Remove unreachable branches" "true-preview"
|
||||
class Test {
|
||||
|
||||
int test(Number n) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Remove unreachable branches" "true"
|
||||
// "Remove unreachable branches" "true-preview"
|
||||
class Main {
|
||||
static void fff(int x) {
|
||||
if (x == 5) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Remove unreachable branches" "true"
|
||||
// "Remove unreachable branches" "true-preview"
|
||||
class Main {
|
||||
static void fff(int x) {
|
||||
if (x == 5) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Remove unreachable branches" "true"
|
||||
// "Remove unreachable branches" "true-preview"
|
||||
class Main {
|
||||
static void fff(int x) {
|
||||
if (x == 5) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Remove switch branch 'default'" "true"
|
||||
// "Remove switch branch 'default'" "true-preview"
|
||||
enum Day {
|
||||
MONDAY, TUESDAY, WEDNESDAY
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Remove switch branch '"baz"'" "true"
|
||||
// "Remove switch branch '"baz"'" "true-preview"
|
||||
class Main {
|
||||
public void test() {
|
||||
switch ("foo") {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Remove switch label '"qux"'" "true"
|
||||
// "Remove switch label '"qux"'" "true-preview"
|
||||
class Main {
|
||||
public void test() {
|
||||
switch ("foo") {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Remove switch label '"bar"'" "true"
|
||||
// "Remove switch label '"bar"'" "true-preview"
|
||||
class Main {
|
||||
public void test() {
|
||||
switch ("foo") {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Remove switch label '0-/*x*/1'" "true"
|
||||
// "Remove switch label '0-/*x*/1'" "true-preview"
|
||||
class Main {
|
||||
static void fff(int x) {
|
||||
if (x > 0) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Remove switch branch '-/*x*/1'" "true"
|
||||
// "Remove switch branch '-/*x*/1'" "true-preview"
|
||||
class Main {
|
||||
static void fff(int x) {
|
||||
if (x > 0) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Remove switch branch '"bar"'" "true"
|
||||
// "Remove switch branch '"bar"'" "true-preview"
|
||||
class Main {
|
||||
public void test() {
|
||||
switch ("foo") {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Remove unreachable branches" "true"
|
||||
// "Remove unreachable branches" "true-preview"
|
||||
class Main {
|
||||
static void fff() {
|
||||
switch ("one") {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Remove switch branch 'Integer i'" "true"
|
||||
// "Remove switch branch 'Integer i'" "true-preview"
|
||||
class Test {
|
||||
int foo(Object o) {
|
||||
return switch (o) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Remove switch branch '2'" "true"
|
||||
// "Remove switch branch '2'" "true-preview"
|
||||
class Main {
|
||||
void test(Integer i) {
|
||||
switch (i) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Remove switch branch 'default'" "true"
|
||||
// "Remove switch branch 'default'" "true-preview"
|
||||
class Main {
|
||||
void test(Integer i) {
|
||||
switch (i) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Remove switch label 'default'" "true"
|
||||
// "Remove switch label 'default'" "true-preview"
|
||||
class Main {
|
||||
void test(Integer i) {
|
||||
switch (i) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Remove switch label '2'" "true"
|
||||
// "Remove switch label '2'" "true-preview"
|
||||
class Main {
|
||||
void test(Integer i) {
|
||||
switch (i) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Remove switch branch 'null'" "true"
|
||||
// "Remove switch branch 'null'" "true-preview"
|
||||
class Main {
|
||||
void test(Integer i) {
|
||||
switch (i) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Remove switch label 'null'" "true"
|
||||
// "Remove switch label 'null'" "true-preview"
|
||||
class Main {
|
||||
void test(Integer i) {
|
||||
switch (i) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Remove switch branch 'A'" "true"
|
||||
// "Remove switch branch 'A'" "true-preview"
|
||||
class X {
|
||||
enum X {A,B,C}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Remove switch label 'default'" "true"
|
||||
// "Remove switch label 'default'" "true-preview"
|
||||
enum Day {
|
||||
MONDAY, TUESDAY, WEDNESDAY
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Remove switch branch '((Integer ii && true))'" "true"
|
||||
// "Remove switch branch '((Integer ii && true))'" "true-preview"
|
||||
class Test {
|
||||
Integer i = 1;
|
||||
void test() {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Remove switch branch 'Day dd && true'" "true"
|
||||
// "Remove switch branch 'Day dd && true'" "true-preview"
|
||||
enum Day {
|
||||
MONDAY, TUESDAY, WEDNESDAY
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Remove unreachable branches" "true"
|
||||
// "Remove unreachable branches" "true-preview"
|
||||
class Main {
|
||||
static void fff(int x) {
|
||||
if (x == 5) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Remove unreachable branches" "true"
|
||||
// "Remove unreachable branches" "true-preview"
|
||||
class Main {
|
||||
static void fff(int x) {
|
||||
if (x == 5) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Remove unreachable branches" "true"
|
||||
// "Remove unreachable branches" "true-preview"
|
||||
class Main {
|
||||
static void fff(int x) {
|
||||
if (x == 5) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Remove unreachable branches" "true"
|
||||
// "Remove unreachable branches" "true-preview"
|
||||
class Main {
|
||||
static void fff(int x) {
|
||||
if (x == 5) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Remove unreachable branches" "true"
|
||||
// "Remove unreachable branches" "true-preview"
|
||||
class Main {
|
||||
void foo(int x) {
|
||||
if (x == 42) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Remove unreachable branches" "true"
|
||||
// "Remove unreachable branches" "true-preview"
|
||||
class Main {
|
||||
void foo(int x) {
|
||||
if (x == 42) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Remove unreachable branches" "true"
|
||||
// "Remove unreachable branches" "true-preview"
|
||||
class Main {
|
||||
void foo(int x) {
|
||||
if (x == 42) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Remove unreachable branches" "true"
|
||||
// "Remove unreachable branches" "true-preview"
|
||||
class Main {
|
||||
void foo(int x) {
|
||||
if (x == 42) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Remove unreachable branches" "true"
|
||||
// "Remove unreachable branches" "true-preview"
|
||||
class Main {
|
||||
static void fff(int x) {
|
||||
if (x == 5) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Remove unreachable branches" "true"
|
||||
// "Remove unreachable branches" "true-preview"
|
||||
class Test {
|
||||
void test(Number n) {
|
||||
n = 1;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Remove unreachable branches" "true"
|
||||
// "Remove unreachable branches" "true-preview"
|
||||
class Test {
|
||||
void test(Number n) {
|
||||
n = 1;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Remove unreachable branches" "true"
|
||||
// "Remove unreachable branches" "true-preview"
|
||||
class Test {
|
||||
void test(Number n) {
|
||||
n = 1;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Remove unreachable branches" "true"
|
||||
// "Remove unreachable branches" "true-preview"
|
||||
class Test {
|
||||
void test(Number n) {
|
||||
n = 1;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Remove unreachable branches" "true"
|
||||
// "Remove unreachable branches" "true-preview"
|
||||
class Test {
|
||||
void test(Number n) {
|
||||
n = 1;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Remove unreachable branches" "true"
|
||||
// "Remove unreachable branches" "true-preview"
|
||||
class Test {
|
||||
Number n = 1;
|
||||
int result = switch (n) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Remove unreachable branches" "true"
|
||||
// "Remove unreachable branches" "true-preview"
|
||||
class Test {
|
||||
|
||||
int test(Number n) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Remove unreachable branches" "true"
|
||||
// "Remove unreachable branches" "true-preview"
|
||||
import java.util.concurrent.ThreadLocalRandom;
|
||||
|
||||
class Test {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Remove unreachable branches" "true"
|
||||
// "Remove unreachable branches" "true-preview"
|
||||
import java.util.concurrent.ThreadLocalRandom;
|
||||
class Test {
|
||||
void test(Number n) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Remove unreachable branches" "true"
|
||||
// "Remove unreachable branches" "true-preview"
|
||||
|
||||
class Test {
|
||||
final String s = "abc";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Remove unreachable branches" "true"
|
||||
// "Remove unreachable branches" "true-preview"
|
||||
class Test {
|
||||
final String s = "abc";
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Remove unreachable branches" "true"
|
||||
// "Remove unreachable branches" "true-preview"
|
||||
class Test {
|
||||
|
||||
int test(Number n) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Remove unreachable branches" "true"
|
||||
// "Remove unreachable branches" "true-preview"
|
||||
class Main {
|
||||
static void fff(int x) {
|
||||
if (x == 5) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Remove unreachable branches" "true"
|
||||
// "Remove unreachable branches" "true-preview"
|
||||
class Main {
|
||||
static void fff(int x) {
|
||||
if (x == 5) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Remove unreachable branches" "true"
|
||||
// "Remove unreachable branches" "true-preview"
|
||||
class Main {
|
||||
static void fff(int x) {
|
||||
if (x == 5) {
|
||||
|
||||
Reference in New Issue
Block a user