Skip to content

GROOVY-12032: Provide a DGM clamp method#2552

Merged
paulk-asert merged 1 commit into
apache:masterfrom
paulk-asert:groovy12032
May 25, 2026
Merged

GROOVY-12032: Provide a DGM clamp method#2552
paulk-asert merged 1 commit into
apache:masterfrom
paulk-asert:groovy12032

Conversation

@paulk-asert
Copy link
Copy Markdown
Contributor

No description provided.

@codecov-commenter
Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 50.00000% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 68.1880%. Comparing base (5318145) to head (9f333d9).

Files with missing lines Patch % Lines
.../codehaus/groovy/runtime/DefaultGroovyMethods.java 50.0000% 1 Missing and 3 partials ⚠️
Additional details and impacted files

Impacted file tree graph

@@                Coverage Diff                 @@
##               master      #2552        +/-   ##
==================================================
+ Coverage     68.1844%   68.1880%   +0.0036%     
- Complexity      33086      33093         +7     
==================================================
  Files            1508       1508                
  Lines          126130     126138         +8     
  Branches        22878      22881         +3     
==================================================
+ Hits            86001      86011        +10     
+ Misses          32490      32486         -4     
- Partials         7639       7641         +2     
Files with missing lines Coverage Δ
.../codehaus/groovy/runtime/DefaultGroovyMethods.java 75.0350% <50.0000%> (-0.0562%) ⬇️

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

@testlens-app
Copy link
Copy Markdown

testlens-app Bot commented May 22, 2026

✅ All tests passed ✅

🏷️ Commit: 9f333d9
▶️ Tests: 99461 executed
⚪️ Checks: 28/28 completed


Learn more about TestLens at testlens.app.

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 Groovy GDK/DGM clamp extension method to constrain Comparable values within bounds, addressing GROOVY-12032.

Changes:

  • Introduces clamp(self, lower, upper) for Comparable values with inclusive bounds and argument validation.
  • Introduces clamp(self, Range) overload delegating to the bounds-based clamp method.
  • Adds GroovyDoc examples (groovyTestCase) demonstrating usage.

Comment thread src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java
Comment thread src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java
@paulk-asert paulk-asert merged commit 1dd9387 into apache:master May 25, 2026
29 checks passed
@paulk-asert paulk-asert deleted the groovy12032 branch May 25, 2026 04:46
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