mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[java-inspection] IDEA-363631 Highlight redundant instanceof with primitive type
- add one more test GitOrigin-RevId: b9b75efe82711ceb4179614b2bab696b6058c02f
This commit is contained in:
committed by
intellij-monorepo-bot
parent
5b7611c45e
commit
dc39a8897c
+12
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user