public static void falsePositive1() {
List<Boolean> list = new ArrayList<>();
list.stream().filter(b -> !b.booleanValue()).sequential().collect(Collectors.toList());
list.stream().filter(b -> !b.booleanValue()).collect(Collectors.toList());
}
private static boolean a(Iterable<Boolean> iterable) { return true; }
public static boolean falsePositive2() {
List<Boolean> list = new ArrayList<>();
Stream<Boolean> filter = StreamSupport.stream(list.spliterator(), false).filter(Boolean::booleanValue);
return a(filter::iterator);
}
public static boolean ok2() {
List<Boolean> list = new ArrayList<>();
Stream<Boolean> filter = StreamSupport.stream(list.spliterator(), false).filter(Boolean::booleanValue);
filter.iterator();
return true;
}
--
You received this message because you are subscribed to the Google Groups "SonarQube" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonarqube+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarqube/aca1bbda-40b0-42f8-a065-edd91129d901%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Hey Paul,Thanks for your feedback and precise, self-contained, reproducers. I created the following tickets to handle these cases independently: