Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 54 for finalize (0.72 sec)

  1. 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>
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Thu Feb 22 17:40:56 UTC 2024
    - 11.6K bytes
    - Viewed (0)
  2. 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());
      }
    
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Mon Jun 10 19:21:11 UTC 2024
    - 7.4K bytes
    - Viewed (0)
  3. 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>
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Thu Feb 22 17:40:56 UTC 2024
    - 11.6K bytes
    - Viewed (0)
  4. src/cmd/compile/internal/syntax/testdata/chans.go

    // been closed and no more values will be received.
    func (r *Receiver[T]) Next() (T, bool) {
    	v, ok := <-r.values
    	return v, ok
    }
    
    // finalize is a finalizer for the receiver.
    func (r *Receiver[T]) finalize() {
    	close(r.done)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Mar 30 18:02:18 UTC 2022
    - 1.8K bytes
    - Viewed (0)
  5. platforms/core-configuration/file-collections/src/integTest/groovy/org/gradle/api/file/FileCollectionLifecycleIntegrationTest.groovy

                        println("value = " + thing.prop.files)
                    }
                }
            """
    
            when:
            run("show")
    
            then:
            outputContains("finalize failed with: Cannot finalize the value of this file collection because configuration of root project 'broken' has not completed yet.")
            output.count("value = [${file('some-file')}]") == 2
        }
    
        @NotYetImplemented
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Mon Nov 27 10:55:07 UTC 2023
    - 11.4K bytes
    - Viewed (0)
  6. 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());
      }
    
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Wed Sep 06 17:04:31 UTC 2023
    - 7.4K bytes
    - Viewed (0)
  7. platforms/core-configuration/file-collections/src/test/groovy/org/gradle/api/internal/file/collections/DefaultConfigurableFileCollectionSpec.groovy

            0 * closure._
            1 * fileResolver.resolve('a') >> file1
            1 * fileResolver.resolve('b') >> file2
            0 * fileResolver._
        }
    
        def "can finalize when already finalized"() {
            given:
            def file = new File('one')
            collection.from('a')
    
            when:
            collection.finalizeValue()
    
            then:
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Mon Mar 18 17:09:50 UTC 2024
    - 53K bytes
    - Viewed (0)
  8. 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
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Thu Jun 08 21:20:23 UTC 2023
    - 1.7K bytes
    - Viewed (0)
  9. guava/src/com/google/common/base/FinalizablePhantomReference.java

        implements FinalizableReference {
      /**
       * Constructs a new finalizable phantom reference.
       *
       * @param referent to phantom reference
       * @param queue that should finalize the referent
       */
      protected FinalizablePhantomReference(@CheckForNull T referent, FinalizableReferenceQueue queue) {
        super(referent, queue.queue);
        queue.cleanUp();
      }
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Thu Feb 23 15:09:35 UTC 2023
    - 1.7K bytes
    - Viewed (0)
  10. maven-compat/src/test/java/org/apache/maven/artifact/testutils/TestFileManager.java

        }
    
        public String getFileContents(File file, String encoding) throws IOException {
            return FileUtils.fileRead(file, encoding);
        }
    
        protected void finalize() throws Throwable {
            maybeWarnAboutCleanUp();
    
            super.finalize();
        }
    
        public File createFile(String filename, String content, String encoding) throws IOException {
            File dir = createTempDir();
    Registered: Wed Jun 12 09:55:16 UTC 2024
    - Last Modified: Thu Apr 25 05:46:50 UTC 2024
    - 4.7K bytes
    - Viewed (0)
Back to top