List.indexOf()
expressions that can be replaced with the
List.contains()
method.
Example:
boolean hasEmptyString(List<String> list) { // Warning: can be simplified return list.indexOf("") >= 0; }A quick-fix is provided that will replace the
indexOf
call with a contains
call:
boolean hasEmptyString(List<String> list) { // Quick-fix is applied return list.contains(""); }