mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
SuspiciousTernaryOperatorInVarargsCallInspection created: IDEA-244144
GitOrigin-RevId: cc56e98bf46b87d1b685177a72bccfd4fc80a596
This commit is contained in:
committed by
intellij-monorepo-bot
parent
11c6134b4a
commit
eb5e81dcb4
+16
@@ -0,0 +1,16 @@
|
||||
// "Replace with 'new Object[]{b}'" "true"
|
||||
|
||||
class Test {
|
||||
public static void main(String[] args) {
|
||||
Object[] a = {1, 2};
|
||||
Object b = "hello";
|
||||
foo(0, a);
|
||||
foo(0, b);
|
||||
for (boolean flag : new boolean[]{true, false}) {
|
||||
foo(0, flag ? a : new Object[]{b});
|
||||
foo(0, 1, flag ? a : b);
|
||||
}
|
||||
}
|
||||
static void foo(int x, Object... xs) {
|
||||
}
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
// "Replace with 'new Serializable[]{b}'" "true"
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
class Test {
|
||||
public static void main(String[] args) {
|
||||
Serializable[] a = {1, 2};
|
||||
Serializable b = "hello";
|
||||
foo(0, a);
|
||||
foo(0, b);
|
||||
for (boolean flag : new boolean[]{true, false}) {
|
||||
foo(0, flag ? a : new Serializable[]{b});
|
||||
foo(0, 1, flag ? a : b);
|
||||
}
|
||||
}
|
||||
static void foo(int x, Serializable... xs) {
|
||||
}
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
// "Replace with 'new Object[]{b}'" "true"
|
||||
|
||||
class Test {
|
||||
public static void main(String[] args) {
|
||||
Object[] a = {1, 2};
|
||||
Object b = "hello";
|
||||
foo(0, a);
|
||||
foo(0, b);
|
||||
for (boolean flag : new boolean[]{true, false}) {
|
||||
foo(0, flag ? a : b<caret>);
|
||||
foo(0, 1, flag ? a : b);
|
||||
}
|
||||
}
|
||||
static void foo(int x, Object... xs) {
|
||||
}
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
// "Replace with 'new Serializable[]{b}'" "true"
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
class Test {
|
||||
public static void main(String[] args) {
|
||||
Serializable[] a = {1, 2};
|
||||
Serializable b = "hello";
|
||||
foo(0, a);
|
||||
foo(0, b);
|
||||
for (boolean flag : new boolean[]{true, false}) {
|
||||
foo(0, flag ? a : b<caret>);
|
||||
foo(0, 1, flag ? a : b);
|
||||
}
|
||||
}
|
||||
static void foo(int x, Serializable... xs) {
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user