src.samples.java.ex.CCI_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.Collections;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
public class CCI_Sample {
private Map> map = new ConcurrentHashMap<>();
public void update(String key, String value) {
Set values = map.get(key);
if (values == null) {
values = Collections.newSetFromMap(new ConcurrentHashMap());
map.put(key, values);
}
values.add(value);
}
}