From a2d38777967a48c16025d3ae90f7a2cb08decd77 Mon Sep 17 00:00:00 2001 From: "samskivert@gmail.com" Date: Mon, 25 Oct 2004 18:42:38 +0000 Subject: [PATCH] Upon further thought- nobody should be calling SortableArrayList.contains() with null elements anyway because SortableArrayList just plain does not support nulls. That's fine, Collections have the option of suporting null elements, but let's just have the underlying implementation (ListUtil) throw a NPE if needed. git-svn-id: https://samskivert.googlecode.com/svn/trunk@1521 6335cc39-0255-0410-8fd6-9bcaacd3b74c --- .../src/java/com/samskivert/util/SortableArrayList.java | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/projects/samskivert/src/java/com/samskivert/util/SortableArrayList.java b/projects/samskivert/src/java/com/samskivert/util/SortableArrayList.java index f9eab756..d5636a25 100644 --- a/projects/samskivert/src/java/com/samskivert/util/SortableArrayList.java +++ b/projects/samskivert/src/java/com/samskivert/util/SortableArrayList.java @@ -156,11 +156,7 @@ public class SortableArrayList extends AbstractList // documentation inherited from interface public boolean contains (Object o) { - // we can't use ListUtil.contains() because our _elements - // array is larger than _size and we want to do the right thing - // if null is passed in. - int dex = ListUtil.indexOf(_elements, o); - return (dex >= 0 && dex < _size); + return ListUtil.contains(_elements, o); } // documentation inherited from interface