Skip to content

GROOVY-12013: New optional type checking extension: CombinerChecker t…#2536

Merged
paulk-asert merged 1 commit into
apache:masterfrom
paulk-asert:groovy12013
May 18, 2026
Merged

GROOVY-12013: New optional type checking extension: CombinerChecker t…#2536
paulk-asert merged 1 commit into
apache:masterfrom
paulk-asert:groovy12013

Conversation

@paulk-asert
Copy link
Copy Markdown
Contributor

@paulk-asert paulk-asert commented May 16, 2026

…o verify associative combiners in injectParallel/sumParallel/Stream.reduce

https://issues.apache.org/jira/browse/GROOVY-12013

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 a new incubating type-checking extension to help catch incorrect combiners used with parallel reductions (Groovy’s sumParallel/injectParallel and JDK Stream#reduce), plus supporting annotations and documentation so users can declare/verify associativity and identity-element contracts.

Changes:

  • Introduces groovy.typecheckers.CombinerChecker with lenient/strict modes and Monoid/Semigroup carrier recognition.
  • Adds new @Associative and @Reducer annotations in groovy.transform to declare combiner contracts (including optional identity via zero).
  • Adds spike-style tests and expands the typecheckers guide with a new section describing the checker and usage.

Reviewed changes

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

Show a summary per file
File Description
subprojects/groovy-typecheckers/src/main/groovy/groovy/typecheckers/CombinerChecker.groovy New type-checking extension that analyzes combiners for parallel reductions and stream reductions.
subprojects/groovy-typecheckers/src/test/groovy/groovy/typecheckers/CombinerCheckerTest.groovy New tests covering lenient/strict behavior, carrier recognition, and stream reduce handling.
subprojects/groovy-typecheckers/src/spec/doc/typecheckers.adoc Documentation entry + full section describing CombinerChecker behavior and configuration.
src/main/java/groovy/transform/Associative.java New annotation to declare associativity contract for combiners.
src/main/java/groovy/transform/Reducer.java New annotation to declare associativity + identity contract (optional zero).

Comment thread subprojects/groovy-typecheckers/src/spec/doc/typecheckers.adoc Outdated
Comment thread subprojects/groovy-typecheckers/src/spec/doc/typecheckers.adoc Outdated
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 16, 2026

Codecov Report

❌ Patch coverage is 68.33333% with 38 lines in your changes missing coverage. Please review.
✅ Project coverage is 68.1668%. Comparing base (293ebc5) to head (fcc8913).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
.../groovy/groovy/typecheckers/CombinerChecker.groovy 68.3333% 4 Missing and 34 partials ⚠️
Additional details and impacted files

Impacted file tree graph

@@                Coverage Diff                 @@
##               master      #2536        +/-   ##
==================================================
+ Coverage     68.1641%   68.1668%   +0.0028%     
- Complexity      32862      32901        +39     
==================================================
  Files            1499       1500         +1     
  Lines          125396     125520       +124     
  Branches        22666      22717        +51     
==================================================
+ Hits            85475      85563        +88     
- Misses          32408      32412         +4     
- Partials         7513       7545        +32     
Files with missing lines Coverage Δ
.../groovy/groovy/typecheckers/CombinerChecker.groovy 68.3333% <68.3333%> (ø)

... and 6 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.

@paulk-asert paulk-asert force-pushed the groovy12013 branch 2 times, most recently from 75fd0a9 to e38a705 Compare May 16, 2026 11:36
@sonarqubecloud
Copy link
Copy Markdown

…o verify associative combiners in injectParallel/sumParallel/Stream.reduce
@testlens-app
Copy link
Copy Markdown

testlens-app Bot commented May 18, 2026

✅ All tests passed ✅

🏷️ Commit: fcc8913
▶️ Tests: 99254 executed
⚪️ Checks: 28/28 completed


Learn more about TestLens at testlens.app.

@paulk-asert paulk-asert merged commit dcf1b0f into apache:master May 18, 2026
29 checks passed
@paulk-asert paulk-asert deleted the groovy12013 branch May 18, 2026 20:25
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