Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 31 - 40 of 58 for putIfAbsent (0.07 seconds)

  1. impl/maven-cli/src/main/java/org/apache/maven/cling/invoker/LayeredOptions.java

                if (up.isPresent()) {
                    had++;
                    for (Map.Entry<String, String> entry : up.get().entrySet()) {
                        items.putIfAbsent(entry.getKey(), entry.getValue());
                    }
                }
            }
            return had == 0 ? Optional.empty() : Optional.of(Map.copyOf(items));
        }
    Created: Sun Apr 05 03:35:12 GMT 2026
    - Last Modified: Wed Feb 26 17:31:44 GMT 2025
    - 5.7K bytes
    - Click Count (0)
  2. guava-tests/test/com/google/common/cache/CacheBuilderGwtTest.java

        assertThat(cache.getIfPresent(10)).isEqualTo(50);
        assertThat(asMap.get(10)).isEqualTo(50);
        assertThat(cache.getIfPresent(2)).isNull();
        assertThat(asMap.get(2)).isNull();
    
        asMap.putIfAbsent(2, 20);
        asMap.putIfAbsent(10, 20);
    
        assertThat(cache.getIfPresent(2)).isEqualTo(20);
        assertThat(asMap.get(2)).isEqualTo(20);
        assertThat(cache.getIfPresent(10)).isEqualTo(50);
    Created: Fri Apr 03 12:43:13 GMT 2026
    - Last Modified: Wed Mar 18 18:06:14 GMT 2026
    - 15K bytes
    - Click Count (0)
  3. guava-tests/benchmark/com/google/common/collect/ConcurrentHashMultisetBenchmark.java

          }
          checkArgument(occurrences > 0, "Invalid occurrences: %s", occurrences);
    
          while (true) {
            int current = count(element);
            if (current == 0) {
              if (countMap.putIfAbsent(element, occurrences) == null) {
                return 0;
              }
            } else {
              checkArgument(
                  occurrences <= Integer.MAX_VALUE - current,
    Created: Fri Apr 03 12:43:13 GMT 2026
    - Last Modified: Mon Jul 14 14:44:08 GMT 2025
    - 16.6K bytes
    - Click Count (0)
  4. guava/src/com/google/common/collect/ImmutableMap.java

       * @deprecated Unsupported operation.
       */
      @CanIgnoreReturnValue
      @Deprecated
      @Override
      @DoNotCall("Always throws UnsupportedOperationException")
      public final @Nullable V putIfAbsent(K key, V value) {
        throw new UnsupportedOperationException();
      }
    
      /**
       * Guaranteed to throw an exception and leave the map unmodified.
       *
       * @throws UnsupportedOperationException always
    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)
  5. impl/maven-cli/src/main/java/org/apache/maven/cling/transfer/SimplexTransferListener.java

        }
    
        private final ConcurrentHashMap<TransferResourceIdentifier, Boolean> ongoing = new ConcurrentHashMap<>();
    
        @Override
        public void transferInitiated(TransferEvent event) {
            ongoing.putIfAbsent(new TransferResourceIdentifier(event.getResource()), Boolean.TRUE);
            put(event, false);
        }
    
        @Override
        public void transferStarted(TransferEvent event) throws TransferCancelledException {
    Created: Sun Apr 05 03:35:12 GMT 2026
    - Last Modified: Thu Feb 06 11:28:05 GMT 2025
    - 8.7K bytes
    - Click Count (0)
  6. samples/crawler/src/main/java/okhttp3/sample/Crawler.java

          }
        }
      }
    
      public void fetch(HttpUrl url) throws IOException {
        // Skip hosts that we've visited many times.
        AtomicInteger hostnameCount = new AtomicInteger();
        AtomicInteger previous = hostnames.putIfAbsent(url.host(), hostnameCount);
        if (previous != null) hostnameCount = previous;
        if (hostnameCount.getAndIncrement() >= hostLimit) return;
    
        Request request = new Request.Builder()
            .url(url)
    Created: Fri Apr 03 11:42:14 GMT 2026
    - Last Modified: Wed Jul 23 00:58:06 GMT 2025
    - 5K bytes
    - Click Count (0)
  7. android/guava/src/com/google/common/collect/Interners.java

                E result = (E) canonical;
                return result;
              }
            }
    
            // didn't see it, trying to put it instead...
            Dummy sneaky = map.putIfAbsent(sample, Dummy.VALUE);
            if (sneaky == null) {
              return sample;
            } else {
              /* Someone beat us to it! Trying again...
               *
    Created: Fri Apr 03 12:43:13 GMT 2026
    - Last Modified: Sun Mar 08 16:16:42 GMT 2026
    - 6K bytes
    - Click Count (0)
  8. compat/maven-embedder/src/main/java/org/apache/maven/cli/transfer/SimplexTransferListener.java

        }
    
        private final ConcurrentHashMap<TransferResourceIdentifier, Boolean> ongoing = new ConcurrentHashMap<>();
    
        @Override
        public void transferInitiated(TransferEvent event) {
            ongoing.putIfAbsent(new TransferResourceIdentifier(event.getResource()), Boolean.TRUE);
            put(event, false);
        }
    
        @Override
        public void transferStarted(TransferEvent event) throws TransferCancelledException {
    Created: Sun Apr 05 03:35:12 GMT 2026
    - Last Modified: Fri Nov 08 08:49:11 GMT 2024
    - 8.4K bytes
    - Click Count (0)
  9. android/guava-tests/test/com/google/common/cache/CacheBuilderGwtTest.java

        assertThat(cache.getIfPresent(10)).isEqualTo(50);
        assertThat(asMap.get(10)).isEqualTo(50);
        assertThat(cache.getIfPresent(2)).isNull();
        assertThat(asMap.get(2)).isNull();
    
        asMap.putIfAbsent(2, 20);
        asMap.putIfAbsent(10, 20);
    
        assertThat(cache.getIfPresent(2)).isEqualTo(20);
        assertThat(asMap.get(2)).isEqualTo(20);
        assertThat(cache.getIfPresent(10)).isEqualTo(50);
    Created: Fri Apr 03 12:43:13 GMT 2026
    - Last Modified: Wed Mar 18 18:06:14 GMT 2026
    - 15K bytes
    - Click Count (0)
  10. guava/src/com/google/common/collect/Interners.java

                E result = (E) canonical;
                return result;
              }
            }
    
            // didn't see it, trying to put it instead...
            Dummy sneaky = map.putIfAbsent(sample, Dummy.VALUE);
            if (sneaky == null) {
              return sample;
            } else {
              /* Someone beat us to it! Trying again...
               *
    Created: Fri Apr 03 12:43:13 GMT 2026
    - Last Modified: Sun Mar 08 16:16:42 GMT 2026
    - 6K bytes
    - Click Count (0)
Back to Top