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

src.samples.java.ex.CCI_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.

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);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy