Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 50 for WeakReference (9.06 sec)

  1. platforms/core-runtime/base-services/src/main/java/org/gradle/internal/reflect/CachedInvokable.java

     */
    
    package org.gradle.internal.reflect;
    
    import javax.annotation.Nullable;
    import java.lang.ref.WeakReference;
    
    public class CachedInvokable<T> {
        private final WeakReference<T> invokable;
    
        public CachedInvokable(T invokable) {
            this.invokable = new WeakReference<T>(invokable);
        }
    
        @Nullable
        public T getMethod() {
            return invokable.get();
        }
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Fri Sep 22 08:48:02 UTC 2023
    - 995 bytes
    - Viewed (0)
  2. guava/src/com/google/common/base/Platform.java

        WeakReference<? extends Enum<?>> ref = Enums.getEnumConstants(enumClass).get(value);
        /*
         * We use `fromNullable` instead of `of` because `WeakReference.get()` has a nullable return
         * type.
         *
         * In practice, we are very unlikely to see `null`: The `WeakReference` to the enum constant
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Mon Apr 15 22:32:14 UTC 2024
    - 3.9K bytes
    - Viewed (0)
  3. guava-testlib/test/com/google/common/testing/GcFinalizationTest.java

        GcFinalization.awaitDone(future);
        assertTrue(future.isDone());
        assertTrue(future.isCancelled());
      }
    
      public void testAwaitClear() {
        final WeakReference<Object> ref = new WeakReference<>(new Object());
        GcFinalization.awaitClear(ref);
        assertNull(ref.get());
      }
    
      public void testAwaitDone_FinalizationPredicate() {
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Wed Sep 06 17:04:31 UTC 2023
    - 7.4K bytes
    - Viewed (0)
  4. android/guava-testlib/src/com/google/common/testing/GcFinalization.java

     * leaks, by ensuring that objects are no longer strongly referenced:
     *
     * <pre>{@code
     * // Helper function keeps victim stack-unreachable.
     * private WeakReference<Foo> fooWeakRef() {
     *   Foo x = ....;
     *   WeakReference<Foo> weakRef = new WeakReference<>(x);
     *   // ... use x ...
     *   x = null;  // Hint to the JIT that x is stack-unreachable
     *   return weakRef;
     * }
     * public void testFooLeak() {
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Thu Feb 22 17:40:56 UTC 2024
    - 11.6K bytes
    - Viewed (0)
  5. guava-testlib/src/com/google/common/testing/GcFinalization.java

     * leaks, by ensuring that objects are no longer strongly referenced:
     *
     * <pre>{@code
     * // Helper function keeps victim stack-unreachable.
     * private WeakReference<Foo> fooWeakRef() {
     *   Foo x = ....;
     *   WeakReference<Foo> weakRef = new WeakReference<>(x);
     *   // ... use x ...
     *   x = null;  // Hint to the JIT that x is stack-unreachable
     *   return weakRef;
     * }
     * public void testFooLeak() {
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Thu Feb 22 17:40:56 UTC 2024
    - 11.6K bytes
    - Viewed (0)
  6. android/guava/src/com/google/common/collect/MapMaker.java

    import java.lang.ref.WeakReference;
    import java.util.ConcurrentModificationException;
    import java.util.Map;
    import java.util.concurrent.ConcurrentHashMap;
    import java.util.concurrent.ConcurrentMap;
    import javax.annotation.CheckForNull;
    
    /**
     * A builder of {@link ConcurrentMap} instances that can have keys or values automatically wrapped
     * in {@linkplain WeakReference weak} references.
     *
     * <p>Usage example:
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Mon Mar 13 14:30:51 UTC 2023
    - 12.8K bytes
    - Viewed (0)
  7. platforms/core-configuration/model-core/src/main/java/org/gradle/model/internal/inspect/ModelRuleSourceDetector.java

    import org.gradle.internal.service.scopes.ServiceScope;
    import org.gradle.model.RuleSource;
    
    import javax.annotation.concurrent.ThreadSafe;
    import java.lang.ref.Reference;
    import java.lang.ref.WeakReference;
    import java.util.Arrays;
    import java.util.Collection;
    import java.util.Collections;
    import java.util.Comparator;
    import java.util.concurrent.ExecutionException;
    
    @ThreadSafe
    @ServiceScope(Scope.Global.class)
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Wed Apr 17 00:47:05 UTC 2024
    - 4.7K bytes
    - Viewed (0)
  8. guava-tests/test/com/google/common/base/EnumsTest.java

      public void testGetIfPresent_doesNotPreventClassUnloading() throws Exception {
        WeakReference<?> shadowLoaderReference = doTestClassUnloading();
        GcFinalization.awaitClear(shadowLoaderReference);
      }
    
      // Create a second ClassLoader and use it to get a second version of the TestEnum class.
      // Run Enums.getIfPresent on that other TestEnum and then return a WeakReference containing the
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Wed May 29 16:29:37 UTC 2024
    - 8.7K bytes
    - Viewed (0)
  9. guava/src/com/google/common/util/concurrent/FuturesGetChecked.java

           * UnsignedBytesBenchmark. TODO(cpovirk): benchmark this
           */
          /*
           * A CopyOnWriteArraySet<WeakReference> is faster than a newSetFromMap of a MapMaker map with
           * weakKeys() and concurrencyLevel(1), even up to at least 12 cached exception types.
           */
          private static final Set<WeakReference<Class<? extends Exception>>> validClasses =
              new CopyOnWriteArraySet<>();
    
          @Override
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Thu Feb 22 17:40:56 UTC 2024
    - 11.9K bytes
    - Viewed (0)
  10. guava-tests/test/com/google/common/base/AbstractIteratorTest.java

        Iterator<Object> itr =
            new AbstractIterator<Object>() {
              @Override
              public Object computeNext() {
                return new Object();
              }
            };
        WeakReference<Object> ref = new WeakReference<>(itr.next());
        GcFinalization.awaitClear(ref);
      }
    
      public void testReentrantHasNext() {
        Iterator<Integer> iter =
            new AbstractIterator<Integer>() {
              @Override
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Thu May 04 09:41:29 UTC 2023
    - 6.1K bytes
    - Viewed (0)
Back to top