Skip to content

Files

Latest commit

 

History

History
21 lines (13 loc) · 1.07 KB

VectorIsObsolete.md

File metadata and controls

21 lines (13 loc) · 1.07 KB

Pattern: Use of Vector

Issue: -

Description

Checks for references to the (effectively) obsolete java.util.Vector class. Use the Java Collections Framework classes instead, including ArrayList or Collections.synchronizedList().

Note: As of the Java 2 platform v1.2, this class was retrofitted to implement the List interface, making it a member of the Java Collections Framework. Unlike the new collection implementations, Vector is synchronized. If a thread-safe implementation is not needed, it is recommended to use ArrayList in place of Vector.

Example of violations:

def someList = new Vector()           // violation

Further Reading