import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Maps;
-import com.romix.scala.collection.concurrent.TrieMap;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
+import org.opendaylight.yangtools.triemap.MutableTrieMap;
+import org.opendaylight.yangtools.triemap.TrieMap;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
}
private static int getProperty(final String name, final int defaultValue) {
- try {
- final String p = System.getProperty(name);
- if (p != null) {
- try {
- int pi = Integer.valueOf(p);
- if (pi <= 0) {
- LOG.warn("Ignoring illegal value of {}: has to be a positive number", name);
- } else {
- return pi;
- }
- } catch (NumberFormatException e) {
- LOG.warn("Ignoring non-numerical value of {}", name, e);
- }
- }
- } catch (Exception e) {
- LOG.debug("Failed to get {}", name, e);
+ final int val = Integer.getInteger(name, defaultValue).intValue();
+ if (val > 0) {
+ return val;
}
+
+ LOG.warn("Ignoring illegal value of {}: has to be a positive number", name);
return defaultValue;
}
* which will maintain the size for us.
*/
LOG.trace("Copying input {} to a TrieMap ({} entries)", input, size);
- final TrieMap<K, V> map = new TrieMap<>();
+ final MutableTrieMap<K, V> map = TrieMap.create();
map.putAll(input);
final Map<K, V> ret = new ReadOnlyTrieMap<>(map, size);
LOG.trace("Read-only TrieMap is {}", ret);