src.samples.java.ex.UTA_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 UTA_Sample {
public String[] testList1(List l) {
String[] data = new String[l.size()];
for (int i = 0; i < l.size(); i++)
data[i] = l.get(i);
return data;
}
public Integer[] testList2(List l) {
int size = l.size();
Integer[] data = new Integer[size];
for (int i = 0; i < size; i++)
data[i] = l.get(i);
return data;
}
public Long[] testList3(List l) {
Iterator it = l.iterator();
Long[] data = new Long[l.size()];
for (int i = 0; i < l.size(); i++)
data[i] = it.next();
return data;
}
}