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

src.samples.java.ex.NMCS_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.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;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy