Examples:
if (array.length < index) {
System.out.println(array[index]);
} // Array index is always out of bounds
if (str == null) System.out.println("str is null");
System.out.println(str.trim());
// the last statement may throw an NPE
@NotNull
Integer square(@Nullable Integer input) {
// the method contract is violated
return input == null ? null : input * input;
}
Use the inspection options to fine-tune annotation processing policy and adjust the list of situations that should be checked.