src.samples.java.ex.DLC_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.ArrayList;
import java.util.List;
public class DLC_Sample {
private List badList = new ArrayList();
private List goodList = new ArrayList();
private List questionableList = new ArrayList();
public void test1(String s1, String s2) {
if (badList.contains(s1))
badList.add(s2);
for (int i = 0; i < badList.size(); i++) {
String s3 = badList.get(i);
if (badList.indexOf(s1 + s2) >= 0)
badList.remove(s3);
}
}
public void test2(String s1, String s2) {
int idx = goodList.indexOf(s1);
goodList.set(idx, s2);
}
public List test3(String s1) {
if (questionableList.contains(s1))
return questionableList;
List nl = new ArrayList();
nl.add(s1);
return nl;
}
}