Home
last modified time | relevance | path

Searched refs:putIfAbsent (Results 1 – 25 of 78) sorted by relevance

1234

/libcore/ojluni/src/main/java/java/util/concurrent/
DConcurrentMap.java157 V putIfAbsent(K key, V value); in putIfAbsent() method
331 && (oldValue = putIfAbsent(key, newValue)) == null) in computeIfAbsent()
427 else if ((oldValue = putIfAbsent(key, newValue)) == null) in compute()
493 if ((oldValue = putIfAbsent(key, value)) == null) in merge()
/libcore/luni/src/test/java/libcore/java/util/
DMapDefaultMethodTester.java154 assertNull(m.putIfAbsent(1, 1.0)); in test_putIfAbsent()
159 assertEquals(1.0, m.putIfAbsent(1, 2.0)); in test_putIfAbsent()
164 assertNull(m.putIfAbsent(1, 1.0)); in test_putIfAbsent()
168 assertNull(m.putIfAbsent(1, null)); in test_putIfAbsent()
173 m.putIfAbsent(1, null); in test_putIfAbsent()
181 assertEquals(1.0, m.putIfAbsent(null, 5.0)); in test_putIfAbsent()
185 m.putIfAbsent(null, 1.0); in test_putIfAbsent()
DCollectionsTest.java475 Collections.unmodifiableMap(new HashMap<>()).putIfAbsent(1, 5.0); in test_unmodifiableMap_putIfAbsent()
484 Collections.unmodifiableMap(m).putIfAbsent(1, 5.0); in test_unmodifiableMap_putIfAbsent()
922 assertThrowsUoe(() -> { map.putIfAbsent(absentKey, absentValue); }); in check_unmodifiableOrderedMap_defaultMethods()
934 assertThrowsUoe(() -> { map.putIfAbsent(sampleKey, absentValue); }); in check_unmodifiableOrderedMap_defaultMethods()
1021 assertThrowsCce(() -> { map.putIfAbsent(presentKey, new Object()); }); in check_map_isChecked()
1022 assertThrowsCce(() -> { map.putIfAbsent(absentKey, new Object()); }); in check_map_isChecked()
1023 assertThrowsCce(() -> { map.putIfAbsent(new Object(), presentValue); }); in check_map_isChecked()
1220 Collections.emptyMap().putIfAbsent(1, 5.0); in test_EmptyMap_putIfAbsent()
1297 Collections.singletonMap(1, 11.0).putIfAbsent(1, 5.0); in test_SingletonMap_putIfAbsent()
1506 checkedMap2.putIfAbsent(1, A_STRING); in test_CheckedMap_putIfAbsent()
[all …]
DLinkedHashMapTest.java69 m.putIfAbsent("key", "value"); in test_putIfAbsent()
70 m.putIfAbsent("key1", "value1"); in test_putIfAbsent()
71 m.putIfAbsent("key2", "value2"); in test_putIfAbsent()
80 m.putIfAbsent("key1", "value1"); in test_putIfAbsent()
/libcore/jsr166-tests/src/test/java/jsr166/
DConcurrentHashMapTest.java148 assertTrue(m.putIfAbsent(bis, true) == null); in testGenericComparable()
150 if (m.putIfAbsent(bss, true) == null) in testGenericComparable()
434 map.putIfAbsent(six, "Z"); in testPutIfAbsent()
443 assertEquals("A", map.putIfAbsent(one, "Z")); in testPutIfAbsent2()
672 c.putIfAbsent(null, "whatever"); in testPutIfAbsent1_NullPointerException()
705 c.putIfAbsent("whatever", null); in testPutIfAbsent2_NullPointerException()
DConcurrentSkipListSubMapTest.java282 map.putIfAbsent(six, "Z");
291 assertEquals("A", map.putIfAbsent(one, "Z"));
556 c.putIfAbsent(null, "whatever");
956 map.putIfAbsent(six, "Z");
965 assertEquals("A", map.putIfAbsent(m1, "Z"));
1230 c.putIfAbsent(null, "whatever");
/libcore/ojluni/src/test/java/util/concurrent/tck/
DConcurrentHashMapTest.java173 assertTrue(m.putIfAbsent(bis, true) == null); in testGenericComparable()
175 if (m.putIfAbsent(bss, true) == null) in testGenericComparable()
474 map.putIfAbsent(six, "Z"); in testPutIfAbsent()
483 assertEquals("A", map.putIfAbsent(one, "Z")); in testPutIfAbsent2()
712 c.putIfAbsent(null, "whatever"); in testPutIfAbsent1_NullPointerException()
745 c.putIfAbsent("whatever", null); in testPutIfAbsent2_NullPointerException()
/libcore/ojluni/src/main/java/java/lang/reflect/
DWeakCache.java111 = map.putIfAbsent(cacheKey, in get()
142 supplier = valuesMap.putIfAbsent(subKey, factory); in get()
/libcore/ojluni/src/main/java/sun/util/locale/
DLocaleObjectCache.java68 entry = map.putIfAbsent(key, newEntry); in get()
/libcore/ojluni/src/test/java/util/Properties/
DCheckOverrides.java54 .forEach(m -> unoverriddenMethods.putIfAbsent(new MethodSignature(m), m)); in main()
/libcore/ojluni/src/test/java/util/Map/
DDefaults.java94 assertNull(map.putIfAbsent(null, EXTRA_VALUE), "previous not null"); in testPutIfAbsentNulls()
98 assertSame(map.putIfAbsent(null, null), EXTRA_VALUE, "previous not expected value"); in testPutIfAbsentNulls()
105 assertNull(map.putIfAbsent(null, null), "previous not null"); in testPutIfAbsentNulls()
109 assertNull(map.putIfAbsent(null, EXTRA_VALUE), "previous not null"); in testPutIfAbsentNulls()
119 assertSame(map.putIfAbsent(KEYS[1], EXTRA_VALUE), expected); in testPutIfAbsent()
124 assertSame(map.putIfAbsent(EXTRA_KEY, EXTRA_VALUE), null); in testPutIfAbsent()
126 assertSame(map.putIfAbsent(EXTRA_KEY, VALUES[2]), EXTRA_VALUE); in testPutIfAbsent()
1047 @Override public V putIfAbsent(K k, V v) {
1048 return map.putIfAbsent(requireNonNull(k), requireNonNull(v));
/libcore/ojluni/src/main/java/sun/util/calendar/
DCalendarSystem.java218 CalendarSystem cs = calendars.putIfAbsent(calendarName, cal); in forName()
/libcore/ojluni/src/main/java/java/time/zone/
DZoneRulesProvider.java322 ZoneRulesProvider old = ZONES.putIfAbsent(zoneId, provider); in registerProvider0()
/libcore/ojluni/src/main/java/java/time/
DZoneOffset.java417 SECONDS_CACHE.putIfAbsent(totalSecs, result); in ofTotalSeconds()
419 ID_CACHE.putIfAbsent(result.getId(), result); in ofTotalSeconds()
/libcore/ojluni/src/test/java/util/Collections/
DDelegatingIteratorForEachRemaining.java141 @Override public V putIfAbsent(K key, V value) { return delegate.putIfAbsent(key, value); } in putIfAbsent() method in DelegatingIteratorForEachRemaining.ForwardingMap
/libcore/ojluni/src/main/java/sun/security/util/
DDisabledAlgorithmConstraints.java264 constraintsMap.putIfAbsent( in Constraints()
306 constraintsMap.putIfAbsent(algorithm, in Constraints()
/libcore/ojluni/src/main/java/java/time/format/
DDecimalStyle.java164 CACHE.putIfAbsent(locale, info); in of()
/libcore/ojluni/annotations/flagged_api/java/util/
DHashMap.annotated.java66 public V putIfAbsent(K key, V value) { throw new RuntimeException("Stub!"); } in putIfAbsent() method in HashMap
/libcore/luni/src/main/java/libcore/icu/
DDecimalFormatData.java107 DecimalFormatData prev = CACHE.putIfAbsent(languageTag, data); in getInstance()
DSimpleDateFormatData.java110 SimpleDateFormatData prev = CACHE.putIfAbsent(languageTag, data); in getInstance()
/libcore/ojluni/src/main/java/java/util/stream/
DDistinctOps.java87 map.putIfAbsent(t, Boolean.TRUE); in makeRef()
DStreamOpFlag.java427 map.putIfAbsent(t, 0b00); in build()
/libcore/ojluni/src/main/java/java/util/
DCurrency.java322 instance = instances.putIfAbsent(currencyCode, currencyVal); in getInstance()
/libcore/ojluni/src/test/java/lang/StackWalker/
DAcrossThreads.java98 Integer i = methods.putIfAbsent(f.getMethodName(), 1); in assertWalker()
/libcore/ojluni/src/main/java/sun/nio/ch/
DFileLockTable.java134 prev = lockMap.putIfAbsent(fileKey, list); in add()

1234