Skip to content

refactor(spring-security): idiomatic Groovy cleanup of the J2G output - #16684

Open
borinquenkid wants to merge 49 commits into
refactor/java-to-groovy-spring-securityfrom
groovyism/spring-security
Open

borinquenkid wants to merge 49 commits into
refactor/java-to-groovy-spring-securityfrom
groovyism/spring-security

Conversation

@borinquenkid

Copy link
Copy Markdown
Member

Stacks on #16610 (java-to-groovy conversion for spring-security).

Idiom pass over that conversion's output: the conversion PR keeps the original Java semicolons and double-quoted strings, under a @SuppressWarnings('UnnecessarySemicolon') header and a TODO(groovyism-cleanup) comment, so git still recognizes each .java -> .groovy pair as a rename (see matrei's review on #16576). This PR removes that scaffolding and applies the Groovy idioms CodeNarc expects.

Verification

  • compile and CodeNarc of the module's own projects pass on this branch (the tip carries the 10.0.x merge of the conversion PR)
  • no tests were run locally for this stacked cleanup (compile and CodeNarc only); CI on stacked PRs is disabled, see below

CI note: this stacked branch inherits the temporary CHANGEME FOR ACCEPTANCE workflow-trigger commit from its base, so no CI runs on it. That commit must be reverted, and CI green, before this PR merges (blocker).

🤖 Generated with Claude Code

…/refactor/java-to-groovy-grails-gsp-core

# Conflicts:
#	grails-gsp/core/src/main/groovy/org/grails/gsp/compiler/GroovyPageParser.groovy
borinquenkid and others added 16 commits October 15, 2026 21:46
…groovy-web-controllers

# Conflicts:
#	grails-controllers/src/main/groovy/org/grails/plugins/web/controllers/GrailsSecurityHeadersFilter.groovy
…sition

Idiomatic Groovy pass over the Java-to-Groovy conversion output for the
acl/plugin, oauth2/plugin, and plugin modules (7 files reviewed).

- SecurityFilterPosition: `this.order` in the no-arg constructor and in
  getOrder() had no shadowing local/parameter, so `this.` was dropped
  (unambiguous `this.x`, per the groovyisms mapping table). The
  parameterized constructor keeps `this.order = order`, where the
  parameter does shadow the field. getOrder()'s signature is unchanged
  (verified with javap); no API or behaviour change.
- AclVoter / AclVoters: annotation types (`@interface`) with no method
  bodies; nothing to idiomize.
- OAuth2Exception: two constructors that only call `super(...)`;
  already idiomatic, no change.
- AclVoterAnnotationsSpec, OAuth2ExceptionSpec, SecurityFilterPositionSpec:
  already written in idiomatic Groovy (single quotes, `==`, `.is()`,
  `*.order`, `sort(false)`, `findAll`/`every`); no Java leftover shapes
  to fix, left untouched.

Verification: compileGroovy/compileTestGroovy clean for
grails-spring-security, grails-spring-security-acl,
grails-spring-security-oauth2; codeStyle (checkstyle + CodeNarc) clean
for all three; full test task green (224/0 spring-security, 5/0 acl,
1/0 oauth2); javap dynamic-dispatch audit on SecurityFilterPosition.class
clean (only harmless castToType/despreadList/selectConstructorAndTransformArguments/initMetaClass,
no GroovyObject property/invoke fallbacks); downstream consumers
(cas, ldap, rest/core, rest/gorm, rest/grailscache, rest/memcached,
rest/redis, ui) compileGroovy clean.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…/spring-security

# Conflicts:
#	grails-controllers/src/main/groovy/org/grails/plugins/web/controllers/GrailsSecurityHeadersFilter.groovy
@borinquenkid
borinquenkid marked this pull request as ready for review October 20, 2026 02:09
Copilot AI balanced review requested due to automatic review settings October 20, 2026 02:09

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.

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

None yet

Development

Successfully merging this pull request may close these issues.

3 participants