diff --git a/src/main/java/org/apache/commons/collections/set/ListOrderedSet.java b/src/main/java/org/apache/commons/collections/set/ListOrderedSet.java index 0b5cfa3c7..d68ac8302 100644 --- a/src/main/java/org/apache/commons/collections/set/ListOrderedSet.java +++ b/src/main/java/org/apache/commons/collections/set/ListOrderedSet.java @@ -42,7 +42,7 @@ import org.apache.commons.collections.list.UnmodifiableList; * the set can be obtained via asList(). *

* This class cannot implement the List interface directly as - * various interface methods (notably equals/hashCode) are incompatable with a set. + * various interface methods (notably equals/hashCode) are incompatible with a set. *

* This class is Serializable from Commons Collections 3.1. * @@ -200,7 +200,9 @@ public class ListOrderedSet extends AbstractSerializableSetDecorator imple @Override public boolean remove(Object object) { boolean result = collection.remove(object); - setOrder.remove(object); + if (result) { + setOrder.remove(object); + } return result; }