void (String arg1, String arg2) { if (<warning descr="Condition 'arg1 != null' covered by subsequent condition 'arg1 instanceof String'">arg1 != null</warning> || arg1 instanceof String) { System.out.println("not very nice, but harmless: DFA would warn anyways on arg1 instanceof String"); } if (arg1 == null && arg1 instanceof String) { System.out.println("this should not trigger a warning"); } if (arg1 != null && arg2 instanceof String) { System.out.println("this should not trigger a warning"); } if (arg1.substring(5) instanceof String && arg1.substring(5) != null) { System.out.println("this should not trigger a warning"); } if (arg1 != null && arg1.length() > 2) { System.out.println("this should not trigger a warning"); } if (arg1 != "hello" || arg1 instanceof String) { System.out.println("this should not trigger a warning"); } if (this.arg1 != null && arg1 instanceof String) { System.out.println("this should not trigger a warning"); } if (arg1 != null && arg1.equals(arg1) && arg1 instanceof String) { System.out.println("no warning"); } }