[java-highlighting] Provide fixes for unexpected primitive type pattern: fixes after review (IJ-CR-15006)

GitOrigin-RevId: 7d13a79dbf52273c15f6d24b4957a68d8e1e9715
This commit is contained in:
Andrey.Cherkasov
2021-10-18 17:39:43 +03:00
committed by intellij-monorepo-bot
parent 48d2830934
commit 23fbe72cac
16 changed files with 81 additions and 48 deletions

View File

@@ -0,0 +1,6 @@
// "Replace 'int' with 'java.lang.Integer'" "true"
class Test {
void foo(Object o) {
boolean b = o instanceof Integer;
}
}

View File

@@ -0,0 +1,6 @@
// "Replace 'int' with 'java.lang.Integer'" "true"
class Test {
void foo(Object o) {
boolean b = o instanceof Integer i;
}
}

View File

@@ -0,0 +1,9 @@
// "Replace 'int' with 'java.lang.Integer'" "true"
class Test {
void foo(Object o) {
switch (o) {
case Integer i -> System.out.println("int");
default -> System.out.println("default");
}
}
}

View File

@@ -0,0 +1,6 @@
// "Replace 'int' with 'java.lang.Integer'" "true"
class Test {
void foo(Object o) {
boolean b = o instanceof int<caret>;
}
}

View File

@@ -0,0 +1,6 @@
// "Replace 'int' with 'java.lang.Integer'" "false"
class Test {
void foo(String o) {
boolean b = o instanceof int<caret>;
}
}

View File

@@ -0,0 +1,6 @@
// "Replace 'int' with 'java.lang.Integer'" "true"
class Test {
void foo(Object o) {
boolean b = o instanceof int<caret> i;
}
}

View File

@@ -0,0 +1,9 @@
// "Replace 'int' with 'java.lang.Integer'" "true"
class Test {
void foo(Object o) {
switch (o) {
case int i<caret> -> System.out.println("int");
default -> System.out.println("default");
}
}
}

View File

@@ -0,0 +1,9 @@
// "Replace 'int' with 'java.lang.Integer'" "false"
class Test {
void foo(String o) {
switch (o) {
case int i<caret> -> System.out.println("int");
default -> System.out.println("default");
}
}
}