Skip to content

Drop the JSON views workaround for GROOVY-12426 - #17233

Open
matrei wants to merge 1 commit into
deps/groovy-6.0.1from
chore/remove-fixed-groovy-workarounds-9.0.x
Open

matrei wants to merge 1 commit into
deps/groovy-6.0.1from
chore/remove-fixed-groovy-workarounds-9.0.x

Conversation

@matrei

@matrei matrei commented Nov 30, 2026

Copy link
Copy Markdown
Contributor

Description

Follow-up to #17231 (Groovy 6.0.1). Groovy 6.0.1 fixes GROOVY-12426, so this PR removes the JSON views workaround for it. The defect was that Groovy 6.0.0 generated no @Delegate methods returning a nested class of a Java source in the same joint compilation. The render methods of GrailsJsonViewHelper return JsonOutput.JsonWritable, a nested class of the Java JsonOutput. So the workaround declared them as default methods that throw UnsupportedOperationException, and TemplateRenderer forwarded them itself.

Both files are back to their 8.0.x form: the render methods are abstract again, and @Delegate forwards them. A new TemplateRendererSpec feature calls each of the five render methods through the renderer and checks that it reaches the helper and returns its result.

This PR is stacked on #17231. Its base is the branch of #17231, so the diff shows only this change. Once #17231 is merged, retarget it to 9.0.x.

The other workarounds whose Groovy defects 6.0.1 fixes, for GROOVY-12427 and GROOVY-12434, also exist on 8.0.x. Their removal is in #17232 and reaches 9.0.x through the merge-up.

Verification

On this branch, with Groovy 6.0.1:

  • :grails-views-gson:check passes: 285 tests, no failures, and no Checkstyle or CodeNarc violations.
  • ./gradlew cleanViolationReports aggregateViolations --continue finds no Checkstyle, CodeNarc, PMD, RAT or repository-convention violations.

With the commit of #17232 cherry-picked on top:

  • ./gradlew build -PskipTests passes. That build compiles the JSON views of every test application.
  • The integration tests of views-functional-tests (60) and issue-views-182 (1) pass.
  • These suites pass with no failures: grails-validation (93), grails-test-suite-uber (643), grails-test-suite-web (3,442) and grails-views-gson (285).

Groovy 6.0.0 generated no @DeleGate methods returning a nested class
of a Java source in the same joint compilation (GROOVY-12426). The
render methods of GrailsJsonViewHelper return JsonOutput.JsonWritable,
so the interface declared them as default methods and TemplateRenderer
forwarded them itself.

Groovy 6.0.1 fixes it, so both files are back to their 8.0.x form: the
render methods are abstract again and @DeleGate forwards them. A new
TemplateRendererSpec feature calls each of them through the renderer.

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

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

1 participant