src.samples.java.ex.MTA_Sample Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sb-contrib Show documentation
Show all versions of sb-contrib Show documentation
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.
The 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;
}
}