/** * Adds all content from the given collection into this collection. */ @Override @SuppressWarnings("fallthrough") public boolean addAll(final Collection<? extends Date> dates) { final int c = modCount; if (dates != null) { final Iterator<? extends Date> it = dates.iterator(); switch (size()) { // Fallthrough everywhere. case 0: if (!it.hasNext()) break; date1 = it.next().getTime(); modCount++; case 1: if (!it.hasNext()) break; date2 = it.next().getTime(); modCount++; default: if (!it.hasNext()) break; throw new IllegalArgumentException(Errors.format( Errors.Keys.ExcessiveArgumentSize_3, "dates", 2, dates.size())); } } return modCount != c; }
/** * Adds all content from the given collection into this collection. */ @Override @SuppressWarnings("fallthrough") public boolean addAll(final Collection<? extends Date> dates) { final int c = modCount; if (dates != null) { final Iterator<? extends Date> it = dates.iterator(); switch (size()) { // Fallthrough everywhere. case 0: if (!it.hasNext()) break; date1 = it.next().getTime(); modCount++; case 1: if (!it.hasNext()) break; date2 = it.next().getTime(); modCount++; default: if (!it.hasNext()) break; throw new IllegalArgumentException(Errors.format( Errors.Keys.ExcessiveArgumentSize_3, "dates", 2, dates.size())); } } return modCount != c; }