[java-inspection] IDEA-363631 Highlight redundant instanceof with primitive type

- add one more test

GitOrigin-RevId: b9b75efe82711ceb4179614b2bab696b6058c02f
This commit is contained in:
Mikhail Pyltsin
2024-11-21 14:58:08 +00:00
committed by intellij-monorepo-bot
parent 5b7611c45e
commit dc39a8897c
@@ -1,5 +1,10 @@
package dfa;
import org.jetbrains.annotations.NotNull;
import java.util.ArrayList;
import java.util.List;
public class InstanceofFromPrimitiveToPrimitive {
public static void main(String[] args) {
System.out.println("testBoolean");
@@ -18,6 +23,13 @@ public class InstanceofFromPrimitiveToPrimitive {
testFloat();
System.out.println("testDouble");
testDouble();
System.out.println("testWithInference");
testWithInference(new ArrayList<>());
}
private static void testWithInference(List<@NotNull Short> list) {
if(<warning descr="Condition 'list.get(0) instanceof int' is always 'true'">list.get(0) instanceof int</warning>) { //redundant
}
}
private static void testDouble() {