Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 14 for Finalize (0.16 sec)

  1. android/guava-testlib/src/com/google/common/testing/GcFinalization.java

     * RuntimeException}.
     *
     * <p>Here's an example that tests a {@code finalize} method:
     *
     * <pre>{@code
     * final CountDownLatch latch = new CountDownLatch(1);
     * Object x = new MyClass() {
     *   ...
     *   protected void finalize() { latch.countDown(); ... }
     * };
     * x = null;  // Hint to the JIT that x is stack-unreachable
     * GcFinalization.await(latch);
     * }</pre>
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Thu Feb 22 17:40:56 GMT 2024
    - 11.6K bytes
    - Viewed (0)
  2. guava-testlib/src/com/google/common/testing/GcFinalization.java

     * RuntimeException}.
     *
     * <p>Here's an example that tests a {@code finalize} method:
     *
     * <pre>{@code
     * final CountDownLatch latch = new CountDownLatch(1);
     * Object x = new MyClass() {
     *   ...
     *   protected void finalize() { latch.countDown(); ... }
     * };
     * x = null;  // Hint to the JIT that x is stack-unreachable
     * GcFinalization.await(latch);
     * }</pre>
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Thu Feb 22 17:40:56 GMT 2024
    - 11.6K bytes
    - Viewed (0)
  3. android/guava-tests/test/com/google/common/io/FileBackedOutputStreamAndroidIncompatibleTest.java

        write(out, data, 0, 100, true);
        final File file = out.getFile();
        assertEquals(100, file.length());
        assertTrue(file.exists());
        out.close();
    
        // Make sure that finalize deletes the file
        out = null;
    
        // times out and throws RuntimeException on failure
        GcFinalization.awaitDone(
            new GcFinalization.FinalizationPredicate() {
              @Override
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Thu Jun 08 21:20:23 GMT 2023
    - 1.7K bytes
    - Viewed (0)
  4. guava-tests/test/com/google/common/io/FileBackedOutputStreamAndroidIncompatibleTest.java

        write(out, data, 0, 100, true);
        final File file = out.getFile();
        assertEquals(100, file.length());
        assertTrue(file.exists());
        out.close();
    
        // Make sure that finalize deletes the file
        out = null;
    
        // times out and throws RuntimeException on failure
        GcFinalization.awaitDone(
            new GcFinalization.FinalizationPredicate() {
              @Override
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Thu Jun 08 21:20:23 GMT 2023
    - 1.7K bytes
    - Viewed (0)
  5. guava-testlib/test/com/google/common/testing/GcFinalizationTest.java

      public void testAwait_CountDownLatch() {
        final CountDownLatch latch = new CountDownLatch(1);
        Object x =
            new Object() {
              @Override
              protected void finalize() {
                latch.countDown();
              }
            };
        x = null; // Hint to the JIT that x is unreachable
        GcFinalization.await(latch);
        assertEquals(0, latch.getCount());
      }
    
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 7.4K bytes
    - Viewed (0)
  6. android/guava-testlib/test/com/google/common/testing/GcFinalizationTest.java

      public void testAwait_CountDownLatch() {
        final CountDownLatch latch = new CountDownLatch(1);
        Object x =
            new Object() {
              @Override
              protected void finalize() {
                latch.countDown();
              }
            };
        x = null; // Hint to the JIT that x is unreachable
        GcFinalization.await(latch);
        assertEquals(0, latch.getCount());
      }
    
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 7.4K bytes
    - Viewed (0)
  7. android/guava/src/com/google/common/io/FileBackedOutputStream.java

       * the {@link ByteSource} returned by {@link #asByteSource} is finalized.
       *
       * @param fileThreshold the number of bytes before the stream should switch to buffering to a file
       * @param resetOnFinalize if true, the {@link #reset} method will be called when the {@link
       *     ByteSource} returned by {@link #asByteSource} is finalized.
       * @throws IllegalArgumentException if {@code fileThreshold} is negative
       */
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Thu Feb 22 17:40:56 GMT 2024
    - 8.2K bytes
    - Viewed (0)
  8. android/guava/src/com/google/common/base/internal/Finalizer.java

         * point, Finalizer can stop running
         */
        if (!finalizableReferenceClass.getName().equals(FINALIZABLE_REFERENCE)) {
          throw new IllegalArgumentException("Expected " + FINALIZABLE_REFERENCE + ".");
        }
    
        Finalizer finalizer = new Finalizer(finalizableReferenceClass, queue, frqReference);
        String threadName = Finalizer.class.getName();
        Thread thread = null;
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed Aug 23 12:54:09 GMT 2023
    - 9.4K bytes
    - Viewed (0)
  9. guava-tests/test/com/google/common/collect/ImmutableMapTest.java

        oos.writeObject(map);
        oos.flush();
    
        int mapSize = bytes.size();
        oos.writeObject(keySet);
        oos.writeObject(values);
        oos.close();
    
        int finalSize = bytes.size();
    
        assertThat(finalSize - mapSize).isLessThan(100);
      }
    
      // TODO: Re-enable this test after moving to new serialization format in ImmutableMap.
      @J2ktIncompatible
      @GwtIncompatible // SerializableTester
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Tue Feb 27 13:27:08 GMT 2024
    - 41.3K bytes
    - Viewed (0)
  10. guava-tests/test/com/google/common/base/FinalizableReferenceQueueTest.java

        assertNotNull(getClass().getResource("internal/Finalizer.class"));
      }
    
      public void testFinalizeClassHasNoNestedClasses() throws Exception {
        // Ensure that the Finalizer class has no nested classes.
        // See https://code.google.com/p/guava-libraries/issues/detail?id=1505
        assertEquals(Collections.emptyList(), Arrays.asList(Finalizer.class.getDeclaredClasses()));
      }
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Tue Oct 10 08:40:05 GMT 2023
    - 4.8K bytes
    - Viewed (0)
Back to top