Class InefficientToArray

  • All Implemented Interfaces:
    Detector, Priorities, StatelessDetector, java.lang.Cloneable, org.apache.bcel.classfile.Visitor

    public class InefficientToArray
    extends BytecodeScanningDetector
    implements StatelessDetector
    Find occurrences of collection.toArray( new Foo[0] ); This causes another memory allocation through reflection Much better to do collection.toArray( new Foo[collection.size()] );
    Author:
    Dave Brosius