java.util.concurrent.ConcurrentNavigableMap#putIfAbsent ( )源码实例Demo

下面列出了java.util.concurrent.ConcurrentNavigableMap#putIfAbsent ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

/**
 * putIfAbsent(null, x) throws NPE
 */
public void testPutIfAbsent1_NullPointerException() {
    try {
        ConcurrentNavigableMap c = map5();
        c.putIfAbsent(null, "whatever");
        shouldThrow();
    } catch (NullPointerException success) {}
}
 
/**
 * putIfAbsent(null, x) throws NPE
 */
public void testDescendingPutIfAbsent1_NullPointerException() {
    try {
        ConcurrentNavigableMap c = dmap5();
        c.putIfAbsent(null, "whatever");
        shouldThrow();
    } catch (NullPointerException success) {}
}
 
源代码3 项目: scava   文件: BTreeMapTest5.java
/**
 * putIfAbsent(null, x) throws NPE
 */
public void testPutIfAbsent1_NullPointerException() {
    try {
        ConcurrentNavigableMap c = map5();
        c.putIfAbsent(null, "whatever");
        shouldThrow();
    } catch (NullPointerException success) {}
}
 
/**
 * putIfAbsent(null, x) throws NPE
 */
public void testPutIfAbsent1_NullPointerException() {
    try {
        ConcurrentNavigableMap c = map5();
        c.putIfAbsent(null, "whatever");
        shouldThrow();
    } catch (NullPointerException success) {}
}
 
/**
 * putIfAbsent(null, x) throws NPE
 */
public void testDescendingPutIfAbsent1_NullPointerException() {
    try {
        ConcurrentNavigableMap c = dmap5();
        c.putIfAbsent(null, "whatever");
        shouldThrow();
    } catch (NullPointerException success) {}
}
 
/**
 * putIfAbsent(null, x) throws NPE
 */
public void testPutIfAbsent1_NullPointerException() {
    try {
        ConcurrentNavigableMap c = map5();
        c.putIfAbsent(null, "whatever");
        shouldThrow();
    } catch (NullPointerException success) {}
}
 
/**
 * putIfAbsent(null, x) throws NPE
 */
public void testDescendingPutIfAbsent1_NullPointerException() {
    try {
        ConcurrentNavigableMap c = dmap5();
        c.putIfAbsent(null, "whatever");
        shouldThrow();
    } catch (NullPointerException success) {}
}
 
源代码8 项目: anno4j   文件: RoleMatcher.java
private void addPathPrefix(
		ConcurrentNavigableMap<String, ConcurrentNavigableMap<String, Collection<Class<?>>>> map,
		String suffix, String prefix, Class<?> role) {
	ConcurrentNavigableMap<String, Collection<Class<?>>> m, o;
	m = map.get(suffix);
	if (m == null) {
		m = new ConcurrentSkipListMap<String, Collection<Class<?>>>();
		o = map.putIfAbsent(suffix, m);
		if (o != null) {
			m = o;
		}
	}
	add(m, prefix, role);
}
 
源代码9 项目: anno4j   文件: RoleMatcher.java
private void addPath(
		ConcurrentNavigableMap<String, ConcurrentMap<String, Collection<Class<?>>>> map,
		String suffix, String prefix, Class<?> role) {
	ConcurrentMap<String, Collection<Class<?>>> m, o;
	m = map.get(suffix);
	if (m == null) {
		m = new ConcurrentHashMap<String, Collection<Class<?>>>();
		o = map.putIfAbsent(suffix, m);
		if (o != null) {
			m = o;
		}
	}
	add(m, prefix, role);
}
 
源代码10 项目: j2objc   文件: ConcurrentSkipListSubMapTest.java
/**
 * putIfAbsent(null, x) throws NPE
 */
public void testPutIfAbsent1_NullPointerException() {
    try {
        ConcurrentNavigableMap c = map5();
        c.putIfAbsent(null, "whatever");
        shouldThrow();
    } catch (NullPointerException success) {}
}
 
源代码11 项目: j2objc   文件: ConcurrentSkipListSubMapTest.java
/**
 * putIfAbsent(null, x) throws NPE
 */
public void testDescendingPutIfAbsent1_NullPointerException() {
    try {
        ConcurrentNavigableMap c = dmap5();
        c.putIfAbsent(null, "whatever");
        shouldThrow();
    } catch (NullPointerException success) {}
}
 
/**
 * putIfAbsent works when the given key is not present
 */
public void testPutIfAbsent() {
    ConcurrentNavigableMap map = map5();
    map.putIfAbsent(six, "Z");
    assertTrue(map.containsKey(six));
}
 
/**
 * putIfAbsent works when the given key is not present
 */
public void testDescendingPutIfAbsent() {
    ConcurrentNavigableMap map = dmap5();
    map.putIfAbsent(six, "Z");
    assertTrue(map.containsKey(six));
}
 
源代码14 项目: scava   文件: BTreeMapTest5.java
/**
 * putIfAbsent works when the given key is not present
 */
public void testPutIfAbsent() {
    ConcurrentNavigableMap map = map5();
    map.putIfAbsent(six, "Z");
    assertTrue(map.containsKey(six));
}
 
/**
 * putIfAbsent works when the given key is not present
 */
public void testPutIfAbsent() {
    ConcurrentNavigableMap map = map5();
    map.putIfAbsent(six, "Z");
    assertTrue(map.containsKey(six));
}
 
/**
 * putIfAbsent works when the given key is not present
 */
public void testDescendingPutIfAbsent() {
    ConcurrentNavigableMap map = dmap5();
    map.putIfAbsent(six, "Z");
    assertTrue(map.containsKey(six));
}
 
/**
 * putIfAbsent works when the given key is not present
 */
public void testPutIfAbsent() {
    ConcurrentNavigableMap map = map5();
    map.putIfAbsent(six, "Z");
    assertTrue(map.containsKey(six));
}
 
/**
 * putIfAbsent works when the given key is not present
 */
public void testDescendingPutIfAbsent() {
    ConcurrentNavigableMap map = dmap5();
    map.putIfAbsent(six, "Z");
    assertTrue(map.containsKey(six));
}
 
源代码19 项目: j2objc   文件: ConcurrentSkipListSubMapTest.java
/**
 * putIfAbsent works when the given key is not present
 */
public void testPutIfAbsent() {
    ConcurrentNavigableMap map = map5();
    map.putIfAbsent(six, "Z");
    assertTrue(map.containsKey(six));
}
 
源代码20 项目: j2objc   文件: ConcurrentSkipListSubMapTest.java
/**
 * putIfAbsent works when the given key is not present
 */
public void testDescendingPutIfAbsent() {
    ConcurrentNavigableMap map = dmap5();
    map.putIfAbsent(six, "Z");
    assertTrue(map.containsKey(six));
}