Details
-
Type:
Enhancement
-
Status: Closed
-
Priority:
P3
-
Resolution: Fixed
-
Affects Version/s: 1.0
-
Fix Version/s: 1.1
-
Component/s: other-libs
-
Labels:
-
Subcomponent:
-
Resolved In Build:1.1
-
CPU:sparc
-
OS:solaris_2.4
-
Verification:Not verified
Description
[pgt, 1/16/1995]
The present interface to the Vector class does not provide a method
to reliably find an element in the Vector. So, I would like to propose
the following extension:
Object findElement( Object elem )
This could be implemented as:
int index = indexOf( elem ) ;
return index >= 0 ? elementAt( index ) : null ;
This needs to be a synchronized method, otherwise the code fragment contains
a race condition.
The present interface to the Vector class does not provide a method
to reliably find an element in the Vector. So, I would like to propose
the following extension:
Object findElement( Object elem )
This could be implemented as:
int index = indexOf( elem ) ;
return index >= 0 ? elementAt( index ) : null ;
This needs to be a synchronized method, otherwise the code fragment contains
a race condition.