src.samples.java.ex.ABC_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.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.TreeMap;
public class ABC_Sample {
public Map testMaps(String[] key, String value) {
Map m = new HashMap();
m.put(key, value);
return m;
}
public Set testSets(String[] values) {
Set s = new HashSet();
s.add(values);
return s;
}
public boolean testLists(List l, String[] value) {
return l.contains(value);
}
public static class UseComparator {
private Map testComp;
public UseComparator() {
testComp = new TreeMap(new Comparator() {
@Override
public int compare(byte[] b1, byte[] b2) {
return b1.length - b2.length;
}
});
}
public void testc() {
testComp.put(new byte[5], new byte[3]);
}
}
}