-
Enhancement
-
Resolution: Unresolved
-
P4
-
None
-
17
-
generic
-
generic
A DESCRIPTION OF THE PROBLEM :
In current versions of the JDK, AbstractCollection#remove(Object) uses an iterator to locate the Object in O(n) time. Because AbstractList does not override this method, it does the same.
List implementations may provide a List#indexOf(Object) method which performs better, possibly even reduce time complexity below O(n).
Consequently, AbstractList should override #remove(Object) of AbstractCollection to use List#indexOf(Object) to locate the object with possibly better performance.
In current versions of the JDK, AbstractCollection#remove(Object) uses an iterator to locate the Object in O(n) time. Because AbstractList does not override this method, it does the same.
List implementations may provide a List#indexOf(Object) method which performs better, possibly even reduce time complexity below O(n).
Consequently, AbstractList should override #remove(Object) of AbstractCollection to use List#indexOf(Object) to locate the object with possibly better performance.