Browse Source

frequency used to accept a null Collection before Java8 refactoring

master
Stefan Bodewig 7 years ago
parent
commit
4d0a7d5f26
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      src/main/org/apache/tools/ant/util/CollectionUtils.java

+ 1
- 1
src/main/org/apache/tools/ant/util/CollectionUtils.java View File

@@ -252,7 +252,7 @@ public class CollectionUtils {
*/ */
@Deprecated @Deprecated
public static int frequency(Collection<?> c, Object o) { public static int frequency(Collection<?> c, Object o) {
return Collections.frequency(c, o);
return c == null ? 0 : Collections.frequency(c, o);
} }


private CollectionUtils() { private CollectionUtils() {


Loading…
Cancel
Save