Search Options

Results per page
Sort
Preferred Languages
Advance

Results 21 - 30 of 46 for putIfAbsent (0.06 sec)

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

        assertEquals(Integer.valueOf(50), asMap.get(10));
        assertEquals(null, cache.getIfPresent(2));
        assertEquals(null, asMap.get(2));
    
        asMap.putIfAbsent(2, 20);
        asMap.putIfAbsent(10, 20);
    
        assertEquals(Integer.valueOf(20), cache.getIfPresent(2));
        assertEquals(Integer.valueOf(20), asMap.get(2));
        assertEquals(Integer.valueOf(50), cache.getIfPresent(10));
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Fri Oct 18 19:07:49 UTC 2024
    - 14.4K bytes
    - Viewed (0)
  2. guava/src/com/google/common/util/concurrent/AtomicLongMap.java

       * zero, associate it with {@code newValue}. Returns the previous value associated with {@code
       * key}, or zero if there was no mapping for {@code key}.
       */
      long putIfAbsent(K key, long newValue) {
        AtomicBoolean noValue = new AtomicBoolean(false);
        Long result =
            map.compute(
                key,
                (k, oldValue) -> {
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Mon Apr 01 16:15:01 UTC 2024
    - 11.8K bytes
    - Viewed (0)
  3. guava-tests/test/com/google/common/cache/PopulatedCachesTest.java

            Entry<Object, Object> entry = warmed.get(i - WARMUP_MIN);
            Object newValue = new Object();
            assertSame(entry.getValue(), cache.asMap().putIfAbsent(entry.getKey(), newValue));
            Object newKey = new Object();
            assertNull(cache.asMap().putIfAbsent(newKey, entry.getValue()));
            // this getUnchecked() call shouldn't be a cache miss; verified below
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Tue Jul 02 18:21:29 UTC 2024
    - 15K bytes
    - Viewed (0)
  4. 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.incrementAndGet() > 100) return;
    
        Request request = new Request.Builder()
            .url(url)
            .build();
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Thu Aug 12 07:26:27 UTC 2021
    - 4.6K bytes
    - Viewed (0)
  5. compat/maven-model-builder/src/main/java/org/apache/maven/model/composition/DefaultDependencyManagementImporter.java

                    for (Dependency dependency : source.getDependencies()) {
                        String key = dependency.getManagementKey();
                        Dependency present = dependencies.putIfAbsent(key, dependency);
                        if (present != null && !equals(dependency, present) && !directDependencies.contains(key)) {
                            // TODO: https://issues.apache.org/jira/browse/MNG-8004
    Registered: Sun Nov 03 03:35:11 UTC 2024
    - Last Modified: Fri Oct 25 12:31:46 UTC 2024
    - 6.1K bytes
    - Viewed (0)
  6. 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...
               *
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Mon Mar 13 14:30:51 UTC 2023
    - 5.9K bytes
    - Viewed (0)
  7. src/main/java/org/codelibs/fess/helper/ProcessHelper.java

            destroyProcess(sessionId);
            JobProcess jobProcess;
            try {
                jobProcess = new JobProcess(pb.start(), bufferSize, outputCallback);
                destroyProcess(sessionId, runningProcessMap.putIfAbsent(sessionId, jobProcess));
                return jobProcess;
            } catch (final IOException e) {
                throw new JobProcessingException("Crawler Process terminated.", e);
            }
        }
    
    Registered: Thu Oct 31 13:40:30 UTC 2024
    - Last Modified: Fri Oct 11 21:20:39 UTC 2024
    - 6.4K bytes
    - Viewed (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 {
    Registered: Sun Nov 03 03:35:11 UTC 2024
    - Last Modified: Fri Oct 25 12:31:46 UTC 2024
    - 8.4K bytes
    - Viewed (0)
  9. 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...
               *
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Mon Mar 13 14:30:51 UTC 2023
    - 5.9K bytes
    - Viewed (0)
  10. fess-crawler-opensearch/src/main/java/org/codelibs/fess/crawler/service/impl/OpenSearchUrlQueueService.java

            QueueHolder queueHolder = sessionCache.get(sessionId);
            if (queueHolder == null) {
                queueHolder = new QueueHolder();
                final QueueHolder prevQueueHolder = sessionCache.putIfAbsent(sessionId, queueHolder);
                return prevQueueHolder == null ? queueHolder : prevQueueHolder;
            }
            return queueHolder;
        }
    
        protected static class QueueHolder {
    Registered: Sun Nov 10 03:50:12 UTC 2024
    - Last Modified: Thu Nov 07 04:44:10 UTC 2024
    - 13.4K bytes
    - Viewed (0)
Back to top