GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Add @RequiredArgsConstructor and @AllArgsConstructor recipes by jkschneider · Pull Request #996 · openrewrite/rewrite-migrate-java

Conversation

@jkschneider

@jkschneider jkschneider commented Mar 1, 2026

Copy link
Copy Markdown
Member

Summary

  • Add UseRequiredArgsConstructor recipe that replaces explicit constructors assigning only final fields with @RequiredArgsConstructor, handling access levels and onConstructor_ for annotations like @Autowired
  • Add UseAllArgsConstructor recipe that replaces constructors assigning all non-static fields with @AllArgsConstructor
  • Add shared utility methods to LombokUtils for field collection and constructor body validation
  • Register both recipes in LombokBestPractices composite recipe

Test plan

  • 16 tests for UseRequiredArgsConstructor (single/multiple final fields, access levels, static/initialized field exclusion, negative cases)
  • 9 tests for UseAllArgsConstructor (non-static fields, access levels, skip when @RequiredArgsConstructor present, negative cases)
  • All existing Lombok tests pass (18 test suites, 0 failures)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@jkschneider
Add UseRequiredArgsConstructor and UseAllArgsConstructor recipes
f65d6af
Replace explicit constructors that only assign final fields with
@requiredargsconstructor, and constructors that assign all non-static
fields with @AllArgsConstructor. Both handle access levels and
onConstructor_ for transferred annotations like @Autowired.
@moderne-meeseeks moderne-meeseeks Bot added this to OpenRewrite Mar 1, 2026
@moderne-meeseeks moderne-meeseeks Bot assigned jkschneider Mar 1, 2026
@github-project-automation github-project-automation Bot moved this to In Progress in OpenRewrite Mar 1, 2026
@jkschneider
Regenerate recipes.csv
6481584
@jkschneider
jkschneider merged commit c0f7b7d into main Mar 1, 2026
1 check passed

Uh oh!

There was an error while loading. Please reload this page.

@jkschneider
jkschneider deleted the jkschneider/lombok-recipes branch March 1, 2026 10:54
@github-project-automation github-project-automation Bot moved this from In Progress to Done in OpenRewrite Mar 1, 2026
mergify Bot added a commit to robfrank/linklift that referenced this pull request Mar 10, 2026
@mergify
chore(deps): bump org.openrewrite.recipe:rewrite-migrate-java from 3.…
85364fe
…28.0 to 3.29.0 [skip ci]

Bumps [org.openrewrite.recipe:rewrite-migrate-java](https://github.com/openrewrite/rewrite-migrate-java) from 3.28.0 to 3.29.0.
Release notes

*Sourced from [org.openrewrite.recipe:rewrite-migrate-java's releases](https://github.com/openrewrite/rewrite-migrate-java/releases).*

> 3.29.0
> ------
>
> What's Changed
> --------------
>
> * Add entries to `.gitignore` by [`@​zieka`](https://github.com/zieka) in [openrewrite/rewrite-migrate-java#995](https://redirect.github.com/openrewrite/rewrite-migrate-java/pull/995)
> * Add [`@​RequiredArgsConstructor`](https://github.com/RequiredArgsConstructor) and [`@​AllArgsConstructor`](https://github.com/AllArgsConstructor) recipes by [`@​jkschneider`](https://github.com/jkschneider) in [openrewrite/rewrite-migrate-java#996](https://redirect.github.com/openrewrite/rewrite-migrate-java/pull/996)
> * Use classpathFromResources for lombok in Java templates by [`@​jkschneider`](https://github.com/jkschneider) in [openrewrite/rewrite-migrate-java#997](https://redirect.github.com/openrewrite/rewrite-migrate-java/pull/997)
> * Fix `IfElseIfConstructToSwitch` type attribution for non-JDK types by [`@​timtebeek`](https://github.com/timtebeek) in [openrewrite/rewrite-migrate-java#994](https://redirect.github.com/openrewrite/rewrite-migrate-java/pull/994)
>
> **Full Changelog**: <openrewrite/rewrite-migrate-java@v3.28.0...v3.29.0>


Commits

* [`42fd45a`](openrewrite/rewrite-migrate-java@42fd45a) [Auto] SDKMAN! Java candidates as of 2026-03-02T1038
* [`53b3725`](openrewrite/rewrite-migrate-java@53b3725) Fix `IfElseIfConstructToSwitch` type attribution for non-JDK types ([#994](https://redirect.github.com/openrewrite/rewrite-migrate-java/issues/994))
* [`eec22b2`](openrewrite/rewrite-migrate-java@eec22b2) Use classpathFromResources for lombok in Java templates ([#997](https://redirect.github.com/openrewrite/rewrite-migrate-java/issues/997))
* [`c0f7b7d`](openrewrite/rewrite-migrate-java@c0f7b7d) Add [`@​RequiredArgsConstructor`](https://github.com/RequiredArgsConstructor) and [`@​AllArgsConstructor`](https://github.com/AllArgsConstructor) recipes ([#996](https://redirect.github.com/openrewrite/rewrite-migrate-java/issues/996))
* [`aa49b8f`](openrewrite/rewrite-migrate-java@aa49b8f) Add entries to `.gitignore` ([#995](https://redirect.github.com/openrewrite/rewrite-migrate-java/issues/995))
* See full diff in [compare view](openrewrite/rewrite-migrate-java@v3.28.0...v3.29.0)
  
[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility\_score?dependency-name=org.openrewrite.recipe:rewrite-migrate-java&package-manager=maven&previous-version=3.28.0&new-version=3.29.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.
[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)
---
Dependabot commands and options
  
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot show  ignore conditions` will show all of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@jkschneider jkschneider

Labels

None yet

Projects

OpenRewrite
Archived in project

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@jkschneider
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.