Skip to content

refactor: convert grails-web-common to Groovy - #16596

Open
borinquenkid wants to merge 8 commits into
refactor/java-to-groovy-grails-gsp-corefrom
refactor/java-to-groovy-grails-web-common
Open

borinquenkid wants to merge 8 commits into
refactor/java-to-groovy-grails-gsp-corefrom
refactor/java-to-groovy-grails-web-common

Conversation

@borinquenkid

Copy link
Copy Markdown
Member

What

Converts the remaining Java sources of grails-web-common to Groovy: 56 .java files removed, 59 .groovy files added (72 files changed, 4791 insertions(+), 4556 deletions(-)).

Why

The maintainers asked on #16351 for the Java-to-Groovy migration to land one Gradle project at a time as a stack of PRs, bottom-up in dependency order. #16572 did grails-data-hibernate7; this PR is 18 of 30 in the next stack (base: refactor/java-to-groovy-grails-gsp-core). The end state of every file is taken from the 9.0.x-java-to-groovy branch, which already carries the regression fixes found by CI.

Commits:

  • d45af4d fix: keep the Java-facing API of the converted grails-web-common classes
  • b1c6039 refactor: convert grails-web-common to Groovy

Changed outside the converted sources

  • M gradle/rat-root-config.gradle

Java-facing API sweep

Every deleted .java was compared with its Groovy twin via javap -v -protected (class declaration, public/protected fields, constructors, methods incl. modifiers/throws/generics, interface default methods, nested class modifiers, and the annotations callers see). Result:

  • grails-web-common: 56 deleted .java, 0 differences requiring action

See also the notes below. Remaining informational entries (widened visibility, e.g. Groovy property accessors): 36.

Verification

  • classes and testClasses (plus ast/cli/testFixtures source sets where present) of the converted project(s) and of their direct dependents compile: ['grails-async', 'grails-converters', 'grails-gsp', 'grails-gsp-core', 'grails-layout', 'grails-mail', 'grails-openapi', 'grails-sitemesh3', 'grails-spring-security', 'grails-views-gson', 'grails-web-boot', 'grails-web-core', 'grails-web-databinding', 'grails-web-gsp', 'grails-web-jsp', 'grails-web-mvc', 'grails-web-taglib', 'grails-web-url-mappings']
  • No test suites were run locally (the umbrella branch was verified; CI runs them). codeStyle, rat and a whole-repo build -PskipTests are run once on the tip of the stack.

Notes

  • Informational sweep entries that are not regressions: Groovy enums gain MIN_VALUE/MAX_VALUE/next()/previous(), property accessors appear for formerly package-private members, nested static classes with implicit constructors become public (they were protected), and generic type parameters that Groovy erases in constructors/methods (descriptors identical).
  • Groovy gotchas that applied (see build: migrate remaining Java sources to Groovy #16351): static final without public creates a property; == calls equals(); Closure/SAM coercions; @CompileStatic with nested classes. All CI regression fixes found on the umbrella branch are included in the end state.

🤖 Generated with Claude Code

borinquenkid and others added 2 commits October 10, 2026 14:27
Converts the Java sources of grails-web-common to Groovy.
Part of the per-project split requested by the maintainers on #16351; end state taken from the
9.0.x-java-to-groovy branch (origin/9.0.x..e55fd9e).

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
The converted HiddenHttpMethod declared its String constants without 'public', which makes them Groovy properties with a private field; the Java sources of grails-controllers still read them directly. Declare them public static final as in the Java original.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@borinquenkid
borinquenkid requested review from jamesfredley and jdaugherty and a balanced review from Copilot October 11, 2026 01:28

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@codecov

codecov Bot commented Oct 11, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 40.14118% with 1272 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (refactor/java-to-groovy-grails-gsp-core@89a0300). Learn more about missing BASE report.

Files with missing lines Patch % Lines
.../main/groovy/org/grails/web/json/JSONObject.groovy 22.8000% 187 Missing and 6 partials ⚠️
...c/main/groovy/org/grails/web/json/JSONArray.groovy 10.1911% 139 Missing and 2 partials ⚠️
...ils/web/json/PathCapturingJSONWriterWrapper.groovy 0.0000% 120 Missing ⚠️
...main/groovy/org/grails/web/json/JSONTokener.groovy 25.9542% 90 Missing and 7 partials ⚠️
.../web/util/BoundedCharsAsEncodedBytesCounter.groovy 2.5316% 77 Missing ⚠️
...rc/main/groovy/org/grails/web/util/WebUtils.groovy 48.5507% 67 Missing and 4 partials ⚠️
...ovy/org/grails/web/servlet/GrailsFlashScope.groovy 29.6703% 53 Missing and 11 partials ⚠️
...y/org/grails/web/json/PrettyPrintJSONWriter.groovy 0.0000% 56 Missing ⚠️
.../org/grails/web/util/IncludeResponseWrapper.groovy 9.8361% 53 Missing and 2 partials ⚠️
...ls/web/errors/GrailsWrappedRuntimeException.groovy 51.1905% 39 Missing and 2 partials ⚠️
... and 23 more
Additional details and impacted files

Impacted file tree graph

@@                             Coverage Diff                              @@
##             refactor/java-to-groovy-grails-gsp-core     #16596   +/-   ##
============================================================================
  Coverage                                           ?   63.3485%           
  Complexity                                         ?      31520           
============================================================================
  Files                                              ?       2238           
  Lines                                              ?     109158           
  Branches                                           ?      20497           
============================================================================
  Hits                                               ?      69150           
  Misses                                             ?      30397           
  Partials                                           ?       9611           
Files with missing lines Coverage Δ
...ovy/grails/web/context/ServletContextHolder.groovy 100.0000% <100.0000%> (ø)
...ngsource/DataBindingSourceCreationException.groovy 100.0000% <100.0000%> (ø)
...rg/grails/web/config/http/GrailsFilterOrder.groovy 0.0000% <ø> (ø)
...vy/org/grails/web/config/http/GrailsFilters.groovy 100.0000% <100.0000%> (ø)
...in/groovy/org/grails/web/json/JSONException.groovy 100.0000% <100.0000%> (ø)
...n/groovy/org/grails/web/json/JsonDateFormat.groovy 95.8333% <100.0000%> (ø)
...rg/grails/web/servlet/WrappedResponseHolder.groovy 100.0000% <100.0000%> (ø)
...groovy/org/grails/web/util/HiddenHttpMethod.groovy 90.9091% <100.0000%> (ø)
.../grails/web/context/WebRequestServletHolder.groovy 75.0000% <66.6667%> (ø)
...grails/web/util/GrailsApplicationAttributes.groovy 0.0000% <0.0000%> (ø)
... and 31 more
🚀 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.

@jdaugherty
jdaugherty added this pull request to stack #16598 October 11, 2026 07:55
@borinquenkid borinquenkid added this to the grails:9.0.0-M1 milestone Oct 11, 2026
@testlens-app

testlens-app Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

🚨 TestLens detected 1 failed test 🚨

Test Summary

Tip

Inspect all details with the TestLens CLI: testlens pr 16596

CI / Build Grails-Core (Windows JDK 25 shard 2) > :grails-startup-progress:test

Test Runs Flakiness
StartupProgressSpec > tells a watching page why the start failed while #stage, then releases the port > tells a watching page why the start failed while running a hook, then releases the port ❌ 0% 🟢

🏷️ Commit: e7a3217
▶️ Tests: 51582 executed
⚪️ Checks: 84/84 completed

Test Failures

StartupProgressSpec > tells a watching page why the start failed while #stage, then releases the port > tells a watching page why the start failed while running a hook, then releases the port (:grails-startup-progress:test in CI / Build Grails-Core (Windows JDK 25 shard 2))
java.lang.AssertionError: No FAILED status within 30 seconds; answers by change: [5ms: INITIALIZING, 2338ms: no answer]; runner alive: false; run failure: java.lang.IllegalStateException: database is down <b>
	at org.apache.grails.startup.StartupProgressSpec.awaitStatus(StartupProgressSpec.groovy:1045)
	at org.apache.grails.startup.StartupProgressSpec.tells a watching page why the start failed while #stage, then releases the port(StartupProgressSpec.groovy:320)

Rerun Controls

Select tests to mute in this pull request:

  • StartupProgressSpec > tells a watching page why the start failed while #stage, then releases the port

Reuse successful test results:

  • ♻️ Only rerun the tests that failed or were muted before

Click the checkbox to trigger a rerun:

  • Rerun jobs

Learn more about TestLens at testlens.app/docs.

This branch has not been deployed

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

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants