Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 1 - 10 of 11 for computeIfAbsent (0.1 seconds)

  1. guava-tests/test/com/google/common/cache/LocalCacheMapComputeTest.java

        doParallelCacheOp(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("");
        assertThat(c.asMap().computeIfAbsent("hash-1", k -> "")).isEqualTo("");
    Created: Fri Apr 03 12:43:13 GMT 2026
    - Last Modified: Wed Mar 18 18:06:14 GMT 2026
    - 6.4K bytes
    - Click Count (0)
  2. okhttp/src/jvmTest/kotlin/okhttp3/KotlinSourceModernTest.kt

            override fun <T> tag(type: Class<out T>): T? = TODO()
    
            override fun <T : Any> tag(
              type: KClass<T>,
              computeIfAbsent: () -> T,
            ): T = TODO()
    
            override fun <T : Any> tag(
              type: Class<T>,
              computeIfAbsent: () -> T,
            ): T = TODO()
    
            override fun clone(): Call = TODO()
          }
      }
    
      @Test
      fun callback() {
    Created: Fri Apr 03 11:42:14 GMT 2026
    - Last Modified: Tue Mar 10 21:47:20 GMT 2026
    - 49.7K bytes
    - Click Count (0)
  3. guava/src/com/google/common/collect/ImmutableMap.java

       *
       * @throws UnsupportedOperationException always
       * @deprecated Unsupported operation.
       */
      @Deprecated
      @Override
      @DoNotCall("Always throws UnsupportedOperationException")
      public final V computeIfAbsent(K key, Function<? super K, ? extends V> mappingFunction) {
        throw new UnsupportedOperationException();
      }
    
      /**
       * Guaranteed to throw an exception and leave the map unmodified.
       *
    Created: Fri Apr 03 12:43:13 GMT 2026
    - Last Modified: Sun Mar 08 16:16:42 GMT 2026
    - 44.7K bytes
    - Click Count (0)
  4. build-logic-commons/gradle-plugin/src/main/kotlin/gradlebuild/testcleanup/TestFilesCleanupService.kt

        val reportOnly: Provider<Boolean>
    )
    
    private class ConcurrentMultiMap<K, V> {
        private val map = ConcurrentHashMap<K, MutableSet<V>>()
    
        fun add(key: K, value: V) =
            map.computeIfAbsent(key, { _ -> ConcurrentHashMap.newKeySet() }).add(value)
    
        fun getOrEmpty(key: K): Set<V> = map[key] ?: emptySet()
    }
    
    abstract class TestFilesCleanupService @Inject constructor(
    Created: Wed Apr 01 11:36:16 GMT 2026
    - Last Modified: Wed Feb 11 11:05:07 GMT 2026
    - 14.3K bytes
    - Click Count (1)
  5. guava/src/com/google/common/collect/Maps.java

        }
    
        @Override
        public @Nullable V replace(K key, V value) {
          throw new UnsupportedOperationException();
        }
    
        @Override
        public V computeIfAbsent(
            K key, java.util.function.Function<? super K, ? extends V> mappingFunction) {
          throw new UnsupportedOperationException();
        }
    
        @Override
        public @Nullable V computeIfPresent(
    Created: Fri Apr 03 12:43:13 GMT 2026
    - Last Modified: Wed Apr 01 17:27:13 GMT 2026
    - 163.4K bytes
    - Click Count (0)
  6. guava-tests/test/com/google/common/cache/LocalCacheTest.java

        Cache<Object, Object> cache =
            CacheBuilder.newBuilder().removalListener(removalListener).build();
        cache.put("a", "b");
        cache.asMap().computeIfAbsent("a", k -> "c");
        assertThat(notifications).isEmpty();
      }
    
      public void testCopyEntry_computing() {
        CountDownLatch startSignal = new CountDownLatch(1);
    Created: Fri Apr 03 12:43:13 GMT 2026
    - Last Modified: Wed Mar 18 18:06:14 GMT 2026
    - 116.4K bytes
    - Click Count (0)
  7. src/test/java/org/codelibs/fess/cors/CorsHandlerTest.java

                    responseHeaders.put(name, values);
                }
    
                @Override
                public void addHeader(String name, String value) {
                    responseHeaders.computeIfAbsent(name, k -> new ArrayList<>()).add(value);
                }
    
                @Override
                public void setIntHeader(String name, int value) {
                }
    
                @Override
    Created: Tue Mar 31 13:07:34 GMT 2026
    - Last Modified: Sat Mar 21 06:04:58 GMT 2026
    - 26.3K bytes
    - Click Count (0)
  8. src/main/java/org/codelibs/fess/helper/CoordinatorHelper.java

         * @param handler the consumer to invoke when the event is received.
         */
        public void addEventHandler(final String eventName, final Consumer<EventInfo> handler) {
            eventHandlers.computeIfAbsent(eventName, k -> new ArrayList<>()).add(handler);
        }
    
        /**
         * Fetches new events from OpenSearch that were created after the last check time.
         *
         * @return the list of new events.
         */
    Created: Tue Mar 31 13:07:34 GMT 2026
    - Last Modified: Sat Mar 28 06:59:19 GMT 2026
    - 33.3K bytes
    - Click Count (0)
  9. src/test/java/org/codelibs/curl/io/IOIntegrationTest.java

                return Collections.emptyMap();
            }
    
            @Override
            public void addRequestProperty(String key, String value) {
                requestProperties.computeIfAbsent(key, k -> new ArrayList<>()).add(value);
            }
    
            @Override
            public void setRequestProperty(String key, String value) {
                List<String> list = new ArrayList<>();
    Created: Thu Apr 02 15:34:12 GMT 2026
    - Last Modified: Sat Mar 21 12:00:34 GMT 2026
    - 44.1K bytes
    - Click Count (0)
  10. guava/src/com/google/common/cache/LocalCache.java

        checkNotNull(key);
        checkNotNull(function);
        int hash = hash(key);
        return segmentFor(hash).compute(key, hash, function);
      }
    
      @Override
      public V computeIfAbsent(K key, Function<? super K, ? extends V> function) {
        checkNotNull(key);
        checkNotNull(function);
        return compute(key, (k, oldValue) -> (oldValue == null) ? function.apply(key) : oldValue);
      }
    
    Created: Fri Apr 03 12:43:13 GMT 2026
    - Last Modified: Wed Apr 01 17:27:13 GMT 2026
    - 148.9K bytes
    - Click Count (0)
Back to Top