Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 10 for ofFailable (0.25 sec)

  1. platforms/core-runtime/functional/src/test/groovy/org/gradle/internal/TryTest.groovy

            def runtimeFailure = new RuntimeException("Runtime exception")
    
            expect:
            Try.ofFailable { throw failure } == Try.failure(failure)
            Try.ofFailable { throw runtimeFailure } == Try.failure(runtimeFailure)
        }
    
        def "captures result"() {
            expect:
            Try.ofFailable { result } == Try.successful(result)
    
            where:
            result << [['a', 'b', 'c'], "Some string", 5]
        }
    
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Thu Apr 18 08:10:49 UTC 2024
    - 5.8K bytes
    - Viewed (0)
  2. platforms/core-runtime/functional/src/main/java/org/gradle/internal/serialization/Cached.java

            }
    
            @Override
            public T get() {
                return result().get();
            }
    
            private Try<T> result() {
                if (result == null) {
                    result = Try.ofFailable(computation);
                    computation = null;
                }
                return result;
            }
    
            private Object writeReplace() {
                return new Fixed<>(result());
            }
        }
    
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Fri Sep 22 08:22:02 UTC 2023
    - 2K bytes
    - Viewed (0)
  3. platforms/core-runtime/functional/src/main/java/org/gradle/internal/Try.java

         * If the callable returns null, then the returned Try instance will hold null as its value.
         */
        public static <U> Try<U> ofFailable(Callable<U> failable) {
            try {
                return Try.successful(failable.call());
            } catch (Exception e) {
                return Try.failure(e);
            }
        }
    
        /**
         * Construct a {@code Try} representing a successful execution.
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Thu Apr 18 08:10:49 UTC 2024
    - 10.3K bytes
    - Viewed (0)
  4. subprojects/core/src/main/java/org/gradle/internal/model/CalculatedValueContainer.java

                        return;
                    }
                    done = true;
    
                    // Attach result and discard calculation state
                    owner.result = Try.ofFailable(() -> {
                        NodeExecutionContext effectiveContext = context;
                        if (effectiveContext == null) {
                            effectiveContext = new GlobalContext(defaultContext);
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Thu Apr 18 08:26:19 UTC 2024
    - 10.3K bytes
    - Viewed (0)
  5. subprojects/diagnostics/src/main/java/org/gradle/api/tasks/diagnostics/TaskReportTask.java

        private List<Try<ProjectReportModel>> computeProjectModels() {
            List<Try<ProjectReportModel>> result = new ArrayList<>();
            for (Project project : new TreeSet<>(getProjects())) {
                result.add(Try.ofFailable(() -> projectReportModelFor(project)));
            }
            return result;
        }
    
        private static class TaskReportModel {
            final List<Try<ProjectReportModel>> projects;
    
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Mon Oct 24 23:13:41 UTC 2022
    - 9.7K bytes
    - Viewed (0)
  6. platforms/core-execution/execution/src/main/java/org/gradle/internal/execution/steps/BuildCacheStep.java

            CacheableWork cacheableWork = new CacheableWork(context.getIdentity().getUniqueId(), context.getWorkspace(), work);
            return Try.ofFailable(() -> work.isAllowedToLoadFromCache()
                    ? tryLoadingFromCache(cacheKey, cacheableWork)
                    : Optional.<BuildCacheLoadResult>empty()
                )
                .map(successfulLoad -> successfulLoad
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Mon Feb 05 13:41:13 UTC 2024
    - 10.6K bytes
    - Viewed (0)
  7. platforms/software/publish/src/main/java/org/gradle/api/publish/tasks/GenerateModuleMetadata.java

                ? new InputState.ComponentMissing(publicationName())
                : new InputState.Ready(moduleMetadataSpec());
        }
    
        private Try<ModuleMetadataSpec> moduleMetadataSpec() {
            return Try.ofFailable(this::computeModuleMetadataSpec);
        }
    
        private ModuleMetadataSpec computeModuleMetadataSpec() {
            PublicationInternal<?> publication = publication();
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Thu Dec 21 07:21:42 UTC 2023
    - 12.1K bytes
    - Viewed (0)
  8. subprojects/core/src/test/groovy/org/gradle/api/services/internal/DefaultBuildServicesRegistryTest.groovy

            given:
            def provider = registerService("failed", BrokenServiceImpl)
            Consumer<Object> action = Mock()
            provider.beforeStopping(action)
    
            Try.ofFailable { provider.get() }
    
            when:
            buildFinished()
    
            then:
            1 * action.accept(provider)
        }
    
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Thu Jun 06 19:15:46 UTC 2024
    - 16.4K bytes
    - Viewed (0)
  9. platforms/core-configuration/kotlin-dsl-provider-plugins/src/main/kotlin/org/gradle/kotlin/dsl/provider/plugins/precompiled/tasks/GeneratePrecompiledScriptPluginAccessors.kt

            return createNestedBuildTree("$path:${projectDir.name}", startParameter, services).run { controller ->
                controller.withEmptyBuild { settings ->
                    Try.ofFailable {
                        val gradle = settings.gradle
                        val baseScope = classLoaderScopeRegistry.coreAndPluginsScope.createChild("accessors-classpath", null).apply {
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Thu Apr 18 08:10:49 UTC 2024
    - 24.8K bytes
    - Viewed (0)
  10. tensorflow/compiler/mlir/lite/quantization/ir/ConvertSimQuant.cc

      LogicalResult matchAndRewrite(FakeQuantOp op,
                                    PatternRewriter &rewriter) const override {
        // TODO: If this pattern comes up more frequently, consider adding core
        // support for failable rewrites.
        if (failableRewrite(op, rewriter)) {
          *hadFailure = true;
          return failure();
        }
        return success();
      }
    
     private:
      bool *hadFailure;
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Wed May 08 02:10:16 UTC 2024
    - 6K bytes
    - Viewed (0)
Back to top