...
Code Block | ||
---|---|---|
| ||
public static int cardinality(Object obj, final CollectionCollection<?> col) { int count = 0; if (col == null) { return count; } IteratorIterator<?> it = col.iterator(); while (it.hasNext()) { Object elt = it.next(); if ((null == obj && null == elt) || obj.equals(elt)) { // null pointer dereference count++; } } return count; } |
...