- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 76 for computeIfAbsent (0.78 sec)
-
android/guava-testlib/src/com/google/common/collect/testing/testers/MapComputeIfAbsentTester.java
@MapFeature.Require(SUPPORTS_PUT) public void testComputeIfAbsent_supportedAbsent() { assertEquals( "computeIfAbsent(notPresent, function) should return new value", v3(), getMap() .computeIfAbsent( k3(), k -> { assertEquals(k3(), k); return v3(); }));
Registered: Fri Dec 26 12:43:10 UTC 2025 - Last Modified: Thu Oct 31 14:51:04 UTC 2024 - 6.7K bytes - Viewed (0) -
guava-tests/test/com/google/common/cache/LocalCacheMapComputeTest.java
count, n -> { cache.asMap().computeIfAbsent(key, k -> "value" + n); }); assertThat(cache.size()).isEqualTo(1); } public void testComputeIfAbsentEviction() { // b/80241237 Cache<String, String> c = CacheBuilder.newBuilder().maximumSize(1).build(); assertThat(c.asMap().computeIfAbsent("hash-1", k -> "")).isEqualTo("");Registered: Fri Dec 26 12:43:10 UTC 2025 - Last Modified: Tue Sep 30 22:03:28 UTC 2025 - 7K bytes - Viewed (0) -
okhttp/src/jvmTest/kotlin/okhttp3/internal/TagsTest.kt
val tags = EmptyTags val atomicTags = AtomicReference<Tags>(tags) val result = atomicTags.computeIfAbsent(String::class) { // 'Race' by making another computeIfAbsent call. In practice this would be another thread. assertThat(atomicTags.computeIfAbsent(Integer::class) { 5 as Integer }).isEqualTo(5) "a" } assertThat(result).isEqualTo("a")Registered: Fri Dec 26 11:42:13 UTC 2025 - Last Modified: Fri Oct 24 11:37:46 UTC 2025 - 7.1K bytes - Viewed (0) -
guava-testlib/src/com/google/common/collect/testing/testers/MapComputeIfAbsentTester.java
@MapFeature.Require(SUPPORTS_PUT) public void testComputeIfAbsent_supportedAbsent() { assertEquals( "computeIfAbsent(notPresent, function) should return new value", v3(), getMap() .computeIfAbsent( k3(), k -> { assertEquals(k3(), k); return v3(); }));
Registered: Fri Dec 26 12:43:10 UTC 2025 - Last Modified: Thu Nov 14 23:40:07 UTC 2024 - 6.7K bytes - Viewed (0) -
okhttp/src/commonJvmAndroid/kotlin/okhttp3/Call.kt
* [computeIfAbsent] implementation. No locks are held while calling this function. */ fun <T : Any> tag( type: KClass<T>, computeIfAbsent: () -> T, ): T /** * Returns the tag attached with [type] as a key. If it is absent, then [computeIfAbsent] is * called and that value is both inserted and returned. *
Registered: Fri Dec 26 11:42:13 UTC 2025 - Last Modified: Wed Nov 05 18:28:35 UTC 2025 - 6.8K bytes - Viewed (0) -
okhttp/src/commonJvmAndroid/kotlin/okhttp3/internal/connection/RealCall.kt
override fun <T : Any> tag( type: KClass<T>, computeIfAbsent: () -> T, ): T = tags.computeIfAbsent(type, computeIfAbsent) override fun <T : Any> tag( type: Class<T>, computeIfAbsent: () -> T, ): T = tags.computeIfAbsent(type.kotlin, computeIfAbsent) @SuppressWarnings("CloneDoesntCallSuperClone") // We are a final type & this saves clearing state.
Registered: Fri Dec 26 11:42:13 UTC 2025 - Last Modified: Wed Nov 05 18:28:35 UTC 2025 - 19.7K bytes - Viewed (0) -
impl/maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultPluginValidationManager.java
if (pluginDeclaration != null) { pluginDeclarations.add(pluginDeclaration); } mojoIssues .computeIfAbsent(issueLocality, k -> new LinkedHashMap<>()) .computeIfAbsent(mojoInfo, k -> new LinkedHashSet<>()) .add(issue); } }
Registered: Sun Dec 28 03:35:09 UTC 2025 - Last Modified: Sat Apr 05 11:52:32 UTC 2025 - 17.5K bytes - Viewed (0) -
build-logic/binary-compatibility/src/main/kotlin/gradlebuild/binarycompatibility/sources/SourcesRepository.kt
fun <T : Any?> executeQuery(apiSourceFile: ApiSourceFile.Java, query: JavaSourceQuery<T>): T = openJavaCompilationUnitsByFile .computeIfAbsent(apiSourceFile.currentFile) { JavaParser().parse(it).getResult().get() } .accept(query.visitor, null) ?: query.defaultValueRegistered: Wed Dec 31 11:36:14 UTC 2025 - Last Modified: Mon Apr 28 14:56:52 UTC 2025 - 4.1K bytes - Viewed (0) -
impl/maven-core/src/main/java/org/apache/maven/graph/FilteredProjectDependencyGraph.java
public List<MavenProject> getDownstreamProjects(MavenProject project, boolean transitive) { Key key = new Key(project, transitive, false); // Do not use computeIfAbsent here, as the computation is recursive // and this is not supported by computeIfAbsent. List<MavenProject> list = cache.get(key); if (list == null) {
Registered: Sun Dec 28 03:35:09 UTC 2025 - Last Modified: Thu Jun 19 16:34:39 UTC 2025 - 6.4K bytes - Viewed (0) -
okhttp-testing-support/src/main/kotlin/okhttp3/FailingCall.kt
override fun <T> tag(type: Class<out T>): T? = error("unexpected") override fun <T : Any> tag( type: KClass<T>, computeIfAbsent: () -> T, ): T = error("unexpected") override fun <T : Any> tag( type: Class<T>, computeIfAbsent: () -> T, ): T = error("unexpected") override fun clone(): Call = error("unexpected")
Registered: Fri Dec 26 11:42:13 UTC 2025 - Last Modified: Wed Nov 05 18:28:35 UTC 2025 - 1.6K bytes - Viewed (0)