- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 18 for WeakReference (0.39 sec)
-
android/guava-testlib/test/com/google/common/testing/GcFinalizationTest.java
GcFinalization.awaitDone(future); assertTrue(future.isDone()); assertTrue(future.isCancelled()); } public void testAwaitClear() { WeakReference<Object> ref = new WeakReference<>(new Object()); GcFinalization.awaitClear(ref); assertThat(ref.get()).isNull(); } public void testAwaitDone_finalizationPredicate() {
Registered: Fri Dec 26 12:43:10 UTC 2025 - Last Modified: Mon Dec 08 17:02:07 UTC 2025 - 7.9K bytes - Viewed (0) -
android/guava/src/com/google/common/base/Enums.java
} private static final Map<Class<? extends Enum<?>>, Map<String, WeakReference<? extends Enum<?>>>> enumConstantCache = new WeakHashMap<>(); private static <T extends Enum<T>> Map<String, WeakReference<? extends Enum<?>>> populateCache( Class<T> enumClass) { Map<String, WeakReference<? extends Enum<?>>> result = new HashMap<>(); for (T enumInstance : EnumSet.allOf(enumClass)) {
Registered: Fri Dec 26 12:43:10 UTC 2025 - Last Modified: Tue Jul 01 13:41:58 UTC 2025 - 4.8K bytes - Viewed (0) -
guava-testlib/test/com/google/common/testing/GcFinalizationTest.java
GcFinalization.awaitDone(future); assertTrue(future.isDone()); assertTrue(future.isCancelled()); } public void testAwaitClear() { WeakReference<Object> ref = new WeakReference<>(new Object()); GcFinalization.awaitClear(ref); assertThat(ref.get()).isNull(); } public void testAwaitDone_finalizationPredicate() {
Registered: Fri Dec 26 12:43:10 UTC 2025 - Last Modified: Mon Dec 08 17:02:07 UTC 2025 - 7.9K bytes - Viewed (0) -
guava-tests/test/com/google/common/collect/InternersTest.java
MyInt canonical = new MyInt(5); MyInt not = new MyInt(5); Interner<MyInt> pool = Interners.newWeakInterner(); assertSame(canonical, pool.intern(canonical)); WeakReference<MyInt> signal = new WeakReference<>(canonical); canonical = null; // Hint to the JIT that canonical is unreachable GcFinalization.awaitClear(signal); assertSame(not, pool.intern(not)); }
Registered: Fri Dec 26 12:43:10 UTC 2025 - Last Modified: Mon Dec 08 17:02:07 UTC 2025 - 4.3K bytes - Viewed (0) -
android/guava-tests/test/com/google/common/util/concurrent/StripedTest.java
public void testStrongImplementations() { for (Striped<?> striped : strongImplementations()) { WeakReference<Object> weakRef = new WeakReference<>(striped.get(new Object())); WeakReference<Object> garbage = new WeakReference<>(new Object()); GcFinalization.awaitClear(garbage); assertThat(weakRef.get()).isNotNull(); } } public void testMaximalWeakStripedLock() {
Registered: Fri Dec 26 12:43:10 UTC 2025 - Last Modified: Tue Oct 28 18:19:59 UTC 2025 - 8.5K bytes - Viewed (0) -
guava-tests/test/com/google/common/util/concurrent/StripedTest.java
public void testStrongImplementations() { for (Striped<?> striped : strongImplementations()) { WeakReference<Object> weakRef = new WeakReference<>(striped.get(new Object())); WeakReference<Object> garbage = new WeakReference<>(new Object()); GcFinalization.awaitClear(garbage); assertThat(weakRef.get()).isNotNull(); } } public void testMaximalWeakStripedLock() {
Registered: Fri Dec 26 12:43:10 UTC 2025 - Last Modified: Tue Oct 28 18:19:59 UTC 2025 - 8.5K bytes - Viewed (0) -
android/guava-tests/test/com/google/common/collect/InternersTest.java
MyInt canonical = new MyInt(5); MyInt not = new MyInt(5); Interner<MyInt> pool = Interners.newWeakInterner(); assertSame(canonical, pool.intern(canonical)); WeakReference<MyInt> signal = new WeakReference<>(canonical); canonical = null; // Hint to the JIT that canonical is unreachable GcFinalization.awaitClear(signal); assertSame(not, pool.intern(not)); }
Registered: Fri Dec 26 12:43:10 UTC 2025 - Last Modified: Mon Dec 08 17:02:07 UTC 2025 - 4.3K bytes - Viewed (0) -
android/guava-tests/test/com/google/common/cache/CacheReferencesTest.java
import com.google.common.base.Function; import com.google.common.cache.LocalCache.Strength; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Iterables; import java.lang.ref.WeakReference; import junit.framework.TestCase; import org.jspecify.annotations.NullUnmarked; /** * Tests of basic {@link LoadingCache} operations with all possible combinations of key & value * strengths. *Registered: Fri Dec 26 12:43:10 UTC 2025 - Last Modified: Tue Sep 30 22:03:28 UTC 2025 - 5.3K bytes - Viewed (0) -
guava-tests/test/com/google/common/base/FinalizableReferenceQueueClassLoaderUnloadingTest.java
AtomicReference<Object> sepStopwatchA = new AtomicReference<Object>(sepStopwatchC.getMethod("createUnstarted").invoke(null)); AtomicReference<WeakReference<?>> sepStopwatchRef = new AtomicReference<WeakReference<?>>( (WeakReference<?>) sepFwrCons.newInstance(sepStopwatchA.get(), sepFrqA.get())); assertThat(sepStopwatchA.get()).isNotNull();
Registered: Fri Dec 26 12:43:10 UTC 2025 - Last Modified: Tue May 13 18:46:00 UTC 2025 - 7.6K bytes - Viewed (0) -
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: Fri Dec 26 12:43:10 UTC 2025 - Last Modified: Thu Dec 11 20:07:52 UTC 2025 - 8.3K bytes - Viewed (0)