src.samples.java.ex.NMCS_Sample Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of fb-contrib Show documentation
Show all versions of fb-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.
package ex;
import java.util.HashSet;
import java.util.Hashtable;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.Vector;
public class NMCS_Sample {
private static List test1 = new Vector();
static {
test1.add("one");
test1.add("two");
test1.add("three");
}
private Map test2 = new Hashtable();
private Set test3 = new HashSet();
private List test4 = new Vector();
public String test1() {
StringBuffer sb = new StringBuffer();
String comma = "";
for (String s : test1) {
sb.append(comma);
comma = ",";
sb.append(s);
}
return sb.toString();
}
public String test2() {
test2 = new Hashtable();
return test2.get("foo");
}
public Set test3() {
Set temp = test3;
temp.add("Foo");
return temp;
}
public List test4(boolean b1, boolean b2) {
return b1 ? test4 : b2 ? new Vector() : test4;
}
}