Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 1 - 10 of 66 for closures (0.06 seconds)

  1. src/test/java/org/codelibs/fess/script/groovy/GroovyEngineTest.java

            final String script = "def sum = 0; for (int i = 1; i <= n; i++) { sum += i }; return sum";
            assertEquals(15, groovyEngine.evaluate(script, params));
        }
    
        /**
         * Test that closures work
         */
        @Test
        public void test_evaluate_closures() {
            final Map<String, Object> params = new HashMap<>();
            final String script = "def multiply = { x, y -> x * y }; return multiply(6, 7)";
    Created: Tue Mar 31 13:07:34 GMT 2026
    - Last Modified: Sun Mar 15 06:03:38 GMT 2026
    - 29.1K bytes
    - Click Count (0)
  2. build-tools-internal/src/main/groovy/org/elasticsearch/gradle/internal/doc/SnippetsTask.groovy

        /**
         * Repeatedly match the pattern to the string, calling the closure with the
         * matchers each time there is a match. If there are characters that don't
         * match then blow up. If the closure takes two parameters then the second
         * one is "is this the last match?".
         */
        protected parse(String location, String s, String pattern, Closure c) {
            if (s == null) {
    Created: Wed Apr 08 16:19:15 GMT 2026
    - Last Modified: Mon Sep 20 10:08:26 GMT 2021
    - 17.8K bytes
    - Click Count (0)
  3. src/test/java/jcifs/smb/SmbTreeConnectionTest.java

            // Using a SmbComClose instance triggers early return without DFS/session work
            SmbComClose closeReq = mock(SmbComClose.class);
            SmbResourceLocator res = c.ensureDFSResolved(loc, closeReq);
            assertSame(loc, res);
            // No connect attempts expected
            verify(c, never()).connectWrapException(any());
        }
    
        @Test
    Created: Sun Apr 05 00:10:12 GMT 2026
    - Last Modified: Thu Aug 14 07:14:38 GMT 2025
    - 13K bytes
    - Click Count (0)
  4. android/guava/src/com/google/common/io/Closer.java

     * <p>An exception that is suppressed is added to the exception that <i>will</i> be thrown using
     * {@code Throwable.addSuppressed(Throwable)}.
     *
     * @author Colin Decker
     * @since 14.0
     */
    // Coffee's for {@link Closer closers} only.
    @J2ktIncompatible
    @GwtIncompatible
    public final class Closer implements Closeable {
      /** Creates a new {@link Closer}. */
      public static Closer create() {
        return new Closer(SUPPRESSING_SUPPRESSOR);
      }
    Created: Fri Apr 03 12:43:13 GMT 2026
    - Last Modified: Thu Jan 29 22:14:05 GMT 2026
    - 10.3K bytes
    - Click Count (0)
  5. build-tools-internal/src/main/groovy/org/elasticsearch/gradle/internal/test/AntFixture.groovy

         */
        protected boolean spawn = true
    
        /**
         * A closure to call before the fixture is considered ready. The closure is passed the fixture object,
         * as well as a groovy AntBuilder, to enable running ant condition checks. The default wait
         * condition is for http on the http port.
         */
        @Internal
        Closure waitCondition = { AntFixture fixture, AntBuilder ant ->
    Created: Wed Apr 08 16:19:15 GMT 2026
    - Last Modified: Tue Jun 01 09:19:30 GMT 2021
    - 10.1K bytes
    - Click Count (0)
  6. android/guava/src/com/google/common/graph/Graphs.java

        // edges, so this traversal would require reusing the undirected AB edge.
        return false;
      }
    
      /**
       * Returns the transitive closure of {@code graph}. The transitive closure of a graph {@code G} is
       * a graph {@code T} that is a supergraph of {@code G}, augmented by, for each pair of nodes A and
    Created: Fri Apr 03 12:43:13 GMT 2026
    - Last Modified: Wed Mar 11 01:10:31 GMT 2026
    - 24.4K bytes
    - Click Count (0)
  7. build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/precommit/TestingConventionsTasks.java

     * in compliance with, at your election, the Elastic License 2.0 or the Server
     * Side Public License, v 1.
     */
    package org.elasticsearch.gradle.internal.precommit;
    
    import groovy.lang.Closure;
    import org.elasticsearch.gradle.util.GradleUtils;
    import org.elasticsearch.gradle.internal.conventions.util.Util;
    import org.gradle.api.DefaultTask;
    import org.gradle.api.NamedDomainObjectContainer;
    Created: Wed Apr 08 16:19:15 GMT 2026
    - Last Modified: Tue Jun 01 09:19:30 GMT 2021
    - 17.6K bytes
    - Click Count (0)
  8. src/test/java/jcifs/EmptyIteratorTest.java

            }, "Multiple close operations should not cause issues");
    
            // Verify iterator still works after multiple closes
            assertFalse(emptyIterator.hasNext(), "Iterator should still work after multiple closes");
            assertNull(emptyIterator.next(), "Iterator should still return null after multiple closes");
        }
    
        @Test
        @DisplayName("EmptyIterator should handle remove operations multiple times")
    Created: Sun Apr 05 00:10:12 GMT 2026
    - Last Modified: Thu Aug 14 05:31:44 GMT 2025
    - 12K bytes
    - Click Count (0)
  9. internal/ioutil/ioutil.go

    // to the peer.
    type WriteOnCloser struct {
    	io.Writer
    	hasWritten bool
    }
    
    func (w *WriteOnCloser) Write(p []byte) (int, error) {
    	w.hasWritten = true
    	return w.Writer.Write(p)
    }
    
    // Close closes the WriteOnCloser. It behaves like io.Closer.
    func (w *WriteOnCloser) Close() error {
    	if !w.hasWritten {
    		_, err := w.Write(nil)
    		if err != nil {
    			return err
    		}
    	}
    Created: Sun Apr 05 19:28:12 GMT 2026
    - Last Modified: Tue Feb 18 16:25:55 GMT 2025
    - 11.1K bytes
    - Click Count (0)
  10. build-conventions/src/main/java/org/elasticsearch/gradle/internal/conventions/precommit/LicenseHeadersTask.java

        public LicenseHeadersTask() {
            setDescription("Checks sources for missing, incorrect, or unacceptable license headers");
        }
    
        /**
         * The list of java files to check. protected so the afterEvaluate closure in the
         * constructor can write to it.
         */
        @InputFiles
        @SkipWhenEmpty
        @PathSensitive(PathSensitivity.RELATIVE)
        public List<FileCollection> getJavaFiles() {
    Created: Wed Apr 08 16:19:15 GMT 2026
    - Last Modified: Thu Sep 09 18:53:35 GMT 2021
    - 10.6K bytes
    - Click Count (0)
Back to Top