Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 36 for computeIfAbsent (5.25 sec)

  1. 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)
  2. 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)
  3. 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)
  4. 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)
  5. 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)
  6. 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)
  7. src/main/java/jcifs/util/AuthenticationRateLimiter.java

                return false;
            }
    
            // Check per-account limit
            if (username != null) {
                AccountAttempts account = accountAttempts.computeIfAbsent(username, k -> new AccountAttempts());
                if (account.isLockedOut()) {
                    if (account.getLockoutExpiry().isAfter(Instant.now())) {
                        totalAttemptsBlocked.incrementAndGet();
    Registered: Sat Dec 20 13:44:44 UTC 2025
    - Last Modified: Sat Aug 30 05:58:03 UTC 2025
    - 15.1K bytes
    - Viewed (0)
  8. impl/maven-core/src/main/java/org/apache/maven/configuration/internal/EnhancedCompositeBeanHelper.java

            if (setterInfo == null) {
                // Look for any method named "set" with one parameter
                Map<String, MethodInfo> classMethodCache = METHOD_CACHE.computeIfAbsent(beanType, this::buildMethodCache);
                setterInfo = classMethodCache.get("set");
            }
    
            if (setterInfo == null) {
    Registered: Sun Dec 28 03:35:09 UTC 2025
    - Last Modified: Wed Nov 12 14:59:46 UTC 2025
    - 12.3K bytes
    - Viewed (0)
  9. impl/maven-core/src/main/java/org/apache/maven/ReactorReader.java

                if (allProjects != null) {
                    Map<String, Map<String, Map<String, MavenProject>>> map = new HashMap<>();
                    allProjects.forEach(project -> map.computeIfAbsent(project.getGroupId(), k -> new HashMap<>())
                            .computeIfAbsent(project.getArtifactId(), k -> new HashMap<>())
                            .put(project.getVersion(), project));
                    this.allProjects = map;
                } else {
    Registered: Sun Dec 28 03:35:09 UTC 2025
    - Last Modified: Mon Dec 15 11:20:38 UTC 2025
    - 24.4K bytes
    - Viewed (0)
  10. build-logic-commons/gradle-plugin/src/main/kotlin/gradlebuild/testcleanup/TestFilesCleanupService.kt

        }
    
        private
        fun addExecutedTaskPath(taskPath: String) {
            projectPathToExecutedTaskPaths.computeIfAbsent(taskPathToProjectPath(taskPath)) { mutableListOf() }.add(taskPath)
        }
    
        private
        fun addFailedTaskPath(taskPath: String) {
            projectPathToFailedTaskPaths.computeIfAbsent(taskPathToProjectPath(taskPath)) { mutableListOf() }.add(taskPath)
        }
    
        private
    Registered: Wed Dec 31 11:36:14 UTC 2025
    - Last Modified: Wed Nov 05 11:43:49 UTC 2025
    - 12.5K bytes
    - Viewed (1)
Back to top