Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: parameterized raw types

...

Code Block
bgColor#FFcccc
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;
}

...