Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 37 for computeIfAbsent (0.12 sec)

  1. 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)
  2. 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)
  3. 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)
  4. 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)
  5. 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)
  6. 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.defaultValue
    
    
    Registered: Wed Dec 31 11:36:14 UTC 2025
    - Last Modified: Mon Apr 28 14:56:52 UTC 2025
    - 4.1K bytes
    - Viewed (0)
  7. 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)
  8. 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)
  9. impl/maven-core/src/main/java/org/apache/maven/execution/ReactorManager.java

        public Map getPluginContext(PluginDescriptor plugin, MavenProject project) {
            Map<String, Map> pluginContextsByKey =
                    pluginContextsByProjectAndPluginKey.computeIfAbsent(project.getId(), k -> new HashMap<>());
    
            return pluginContextsByKey.computeIfAbsent(plugin.getPluginLookupKey(), k -> new HashMap<>());
        }
    
        public void setFailureBehavior(String failureBehavior) {
            if (failureBehavior == null) {
    Registered: Sun Dec 28 03:35:09 UTC 2025
    - Last Modified: Thu Dec 12 11:02:17 UTC 2024
    - 6K bytes
    - Viewed (0)
  10. impl/maven-core/src/main/java/org/apache/maven/project/artifact/DefaultProjectArtifactsCache.java

            }
    
            return cache.computeIfAbsent(key, k -> new CacheRecord(artifacts));
        }
    
        @Override
        public CacheRecord put(Key key, LifecycleExecutionException exception) {
            Objects.requireNonNull(exception, "exception cannot be null");
            assertUniqueKey(key);
            return cache.computeIfAbsent(key, k -> new CacheRecord(exception));
        }
    
    Registered: Sun Dec 28 03:35:09 UTC 2025
    - Last Modified: Mon Sep 29 14:45:25 UTC 2025
    - 8.3K bytes
    - Viewed (0)
Back to top