mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Support parentheses, fix bug when the array branch has a primitive array, more tests: IDEA-244144
GitOrigin-RevId: 4c644d8b1e11869e4f3853763d09d7e0b91b5740
This commit is contained in:
committed by
intellij-monorepo-bot
parent
25c8da92e3
commit
9845c0a0c2
+12
@@ -0,0 +1,12 @@
|
||||
// "Replace with 'new Object[]{a}'" "false"
|
||||
// "Replace with 'new Object[]{b}'" "false"
|
||||
|
||||
class Test {
|
||||
static void bar(boolean flag) {
|
||||
Object[] a = {1, 2};
|
||||
Object b = "hello";
|
||||
foo(0, 1, flag ? a : b);
|
||||
}
|
||||
static void foo(int x, Object... xs) {
|
||||
}
|
||||
}
|
||||
+2
-7
@@ -1,15 +1,10 @@
|
||||
// "Replace with 'new Object[]{b}'" "true"
|
||||
|
||||
class Test {
|
||||
public static void main(String[] args) {
|
||||
static void bar(boolean flag) {
|
||||
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);
|
||||
}
|
||||
foo(0, flag ? a : new Object[]{b});
|
||||
}
|
||||
static void foo(int x, Object... xs) {
|
||||
}
|
||||
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
// "Replace with 'new Object[]{b}'" "false"
|
||||
|
||||
class Test {
|
||||
static void bar(boolean flag) {
|
||||
int[] a = {1, 2};
|
||||
Integer b = 42;
|
||||
foo(0, flag ? a : b);
|
||||
}
|
||||
static void foo(int x, Object... xs) {
|
||||
}
|
||||
}
|
||||
+2
-7
@@ -3,15 +3,10 @@
|
||||
import java.io.Serializable;
|
||||
|
||||
class Test {
|
||||
public static void main(String[] args) {
|
||||
static void bar(boolean flag) {
|
||||
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);
|
||||
}
|
||||
foo(0, flag ? a : new Serializable[]{b});
|
||||
}
|
||||
static void foo(int x, Serializable... xs) {
|
||||
}
|
||||
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
// "Replace with 'new Object[]{getObject(/*empty*/)}'" "true"
|
||||
|
||||
class Test {
|
||||
static void foo(Object... data) { }
|
||||
|
||||
void test(boolean b, Object[] obj2) {
|
||||
foo(b ? new Object[]{getObject(/*empty*/)} : obj2);
|
||||
}
|
||||
|
||||
native Object getObject();
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
// "Replace with 'new Object[]{b}'" "true"
|
||||
|
||||
class Test {
|
||||
static void bar(boolean flag) {
|
||||
Integer[] a = {1, 2};
|
||||
Integer b = 42;
|
||||
foo(0, (((flag ? a : new Object[]{b}))));
|
||||
}
|
||||
static void foo(int x, Object... xs) {
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
bar(true);
|
||||
}
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
// "Replace with 'new Object[]{a}'" "false"
|
||||
// "Replace with 'new Object[]{b}'" "false"
|
||||
|
||||
class Test {
|
||||
static void bar(boolean flag) {
|
||||
Object[] a = {1, 2};
|
||||
Object b = "hello";
|
||||
foo(0, 1, flag ? a : b<caret>);
|
||||
}
|
||||
static void foo(int x, Object... xs) {
|
||||
}
|
||||
}
|
||||
+2
-7
@@ -1,15 +1,10 @@
|
||||
// "Replace with 'new Object[]{b}'" "true"
|
||||
|
||||
class Test {
|
||||
public static void main(String[] args) {
|
||||
static void bar(boolean flag) {
|
||||
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);
|
||||
}
|
||||
foo(0, flag ? a : b<caret>);
|
||||
}
|
||||
static void foo(int x, Object... xs) {
|
||||
}
|
||||
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
// "Replace with 'new Object[]{b}'" "false"
|
||||
|
||||
class Test {
|
||||
static void bar(boolean flag) {
|
||||
int[] a = {1, 2};
|
||||
Integer b = 42;
|
||||
foo(0, flag ? a : b<caret>);
|
||||
}
|
||||
static void foo(int x, Object... xs) {
|
||||
}
|
||||
}
|
||||
+2
-7
@@ -3,15 +3,10 @@
|
||||
import java.io.Serializable;
|
||||
|
||||
class Test {
|
||||
public static void main(String[] args) {
|
||||
static void bar(boolean flag) {
|
||||
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);
|
||||
}
|
||||
foo(0, flag ? a : b<caret>);
|
||||
}
|
||||
static void foo(int x, Serializable... xs) {
|
||||
}
|
||||
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
// "Replace with 'new Object[]{getObject(/*empty*/)}'" "true"
|
||||
|
||||
class Test {
|
||||
static void foo(Object... data) { }
|
||||
|
||||
void test(boolean b, Object[] obj2) {
|
||||
foo(b ? getObject(/*empty*/<caret>) : obj2);
|
||||
}
|
||||
|
||||
native Object getObject();
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
// "Replace with 'new Object[]{b}'" "true"
|
||||
|
||||
class Test {
|
||||
static void bar(boolean flag) {
|
||||
Integer[] a = {1, 2};
|
||||
Integer b = 42;
|
||||
foo(0, (((flag ? a : b<caret>))));
|
||||
}
|
||||
static void foo(int x, Object... xs) {
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
bar(true);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user