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

src.samples.java.ex.MTA_Sample Maven / Gradle / Ivy

Go to download

An auxiliary findbugs.sourceforge.net plugin for java bug detectors that fall outside the narrow scope of detectors to be packaged with the product itself.

There is a newer version: 7.6.8
Show newest version
package ex;
import java.util.Iterator;
import java.util.List;

public class MTA_Sample {
    public String[] testForCopy(List l) {
        String[] result = new String[l.size()];
        for (int i = 0; i < l.size(); i++) {
            result[i] = l.get(i);
        }

        return result;
    }

    public String[] testIterCopy(List l) {
        String[] result = new String[l.size()];
        Iterator it = l.iterator();
        int i = 0;
        while (it.hasNext()) {
            result[i] = it.next();
            i++;
        }

        return result;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy