Skip to content

GROOVY-12043: Provide curryWith helpers#2569

Open
paulk-asert wants to merge 1 commit into
apache:masterfrom
paulk-asert:groovy12043
Open

GROOVY-12043: Provide curryWith helpers#2569
paulk-asert wants to merge 1 commit into
apache:masterfrom
paulk-asert:groovy12043

Conversation

@paulk-asert
Copy link
Copy Markdown
Contributor

No description provided.

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 29, 2026

Codecov Report

❌ Patch coverage is 77.77778% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 68.1590%. Comparing base (6466667) to head (31b6dfc).
⚠️ Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
src/main/java/org/apache/groovy/util/Closures.java 76.1905% 8 Missing and 2 partials ⚠️
Additional details and impacted files

Impacted file tree graph

@@                Coverage Diff                 @@
##               master      #2569        +/-   ##
==================================================
- Coverage     68.1611%   68.1590%   -0.0021%     
- Complexity      33112      33120         +8     
==================================================
  Files            1508       1510         +2     
  Lines          126154     126199        +45     
  Branches        22890      22890                
==================================================
+ Hits            85988      86016        +28     
- Misses          32540      32554        +14     
- Partials         7626       7629         +3     
Files with missing lines Coverage Δ
src/main/java/org/apache/groovy/util/Lambdas.java 100.0000% <100.0000%> (ø)
src/main/java/org/apache/groovy/util/Closures.java 76.1905% <76.1905%> (ø)

... and 7 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds curryWith helpers for java.util.function BiPredicate/BiFunction/BiConsumer types (which lack Closure.rcurry), plus from lifters that produce hybrid SAM+Closure values usable with both SAM-accepting JDK/DGM APIs and Closure-accepting DGM APIs.

Changes:

  • New org.apache.groovy.util.Lambdas with curryWith overloads returning bare Predicate/Function/Consumer.
  • New org.apache.groovy.util.Closures with from(...) lifters, curryWith(...) composing on Lambdas.curryWith, and three nested hybrid classes (PredicateClosure, FunctionClosure, ConsumerClosure) extending Closure and implementing the matching SAM.
  • New tests (LambdasTest, ClosuresTest) and a new "Currying functional interfaces" section in core-closures.adoc.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/main/java/org/apache/groovy/util/Lambdas.java New utility with curryWith returning bare SAMs.
src/main/java/org/apache/groovy/util/Closures.java New utility with from and curryWith returning hybrid SAM+Closure values.
src/spec/doc/core-closures.adoc Adds user docs for the new currying helpers.
src/test/groovy/org/apache/groovy/util/LambdasTest.groovy Coverage for bare-SAM curryWith overloads including @CompileStatic.
src/test/groovy/org/apache/groovy/util/ClosuresTest.groovy Coverage for from, hybrid curryWith, DGM/Stream integration, and @CompileStatic.

Comment thread src/main/java/org/apache/groovy/util/Lambdas.java
Comment thread src/main/java/org/apache/groovy/util/Closures.java
Comment thread src/main/java/org/apache/groovy/util/Closures.java
@testlens-app
Copy link
Copy Markdown

testlens-app Bot commented May 29, 2026

✅ All tests passed ✅

🏷️ Commit: 31b6dfc
▶️ Tests: 96840 executed
⚪️ Checks: 30/30 completed


Learn more about TestLens at testlens.app.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants