All Downloads are FREE. Search and download functionalities are using the official Maven repository.

resources.report.rules.pmd.UseArrayListInsteadOfVector.html Maven / Gradle / Ivy



UseArrayListInsteadOfVector


UseArrayListInsteadOfVector

ArrayList is a much better Collection implementation than Vector.

This rule is defined by the following XPath expression:


//AllocationExpression
 /ClassOrInterfaceType[@Image='Vector' or @Image='java.util.Vector']

              

Example:

                

public class SimpleTest extends TestCase {
 public void testX() {
  Collection c = new Vector();
  // This achieves the same with much better performance
  // Collection c = new ArrayList();
 }
}

          
            




© 2015 - 2025 Weber Informatics LLC | Privacy Policy