This was introduced when I upgraded sb-contrib from 7.6.0 to 7.6.1 and spotbugs from 5.2.3 to 5.2.4. It looks like a regression of #39
public class FbFail {
private final List<String> list = List.of("foo", "bar");
public void fail() {
list.forEach(System.out::println);
/*
for (var obj : list) {
System.out.println(obj);
}
*/
}
}
The forEach fails the WOC_WRITE_ONLY_COLLECTION_LOCAL check, but if it is replaced by the for-loop the check passes.
This was introduced when I upgraded sb-contrib from 7.6.0 to 7.6.1 and spotbugs from 5.2.3 to 5.2.4. It looks like a regression of #39
The
forEach
fails theWOC_WRITE_ONLY_COLLECTION_LOCAL
check, but if it is replaced by the for-loop the check passes.