commons.java subversion repository

sventon subversion web client - http://www.sventon.org
[show recent changes]
 
  Help
HEAD
Rev: 699 - https://secure.bioinfweb.info/Code/svn/commons.java / trunk / main / info.bioinfweb.commons.core / src / info / bioinfweb / commons / collections / ListDecorator.java
Unified Diff View - ListDecorator.java
/trunk/main/info.bioinfweb.commons.core/src/info/bioinfweb/commons/collections/ListDecorator.java @ revision 698
/trunk/main/info.bioinfweb.commons.core/src/info/bioinfweb/commons/collections/ListDecorator.java @ revision 699
@@ -252,11 +252,11 @@  @Override  public void clear() { -  Collection<E> copy = new ArrayList<E>(size()); // Clone cannot be used here, because changes there also affect the original list. -  copy.addAll(this); -  copy = Collections.unmodifiableCollection(copy); +  if (!isEmpty()) { +   Collection<E> copy = new ArrayList<E>(size()); // Clone cannot be used here, because changes there also affect the original list. +   copy.addAll(this); +   copy = Collections.unmodifiableCollection(copy); -  if (copy.isEmpty() == false) {    beforeRemove(0, copy);    getUnderlyingList().clear();    afterRemove(0, copy);


feed icon

sventon 2.5.1

bioinfweb RSS feed bioinfweb on twitter bioinfweb.commons.java on GitHub
bioinfweb - Biology & Informatics Website