-
Notifications
You must be signed in to change notification settings - Fork 110
Normalize version numbers in FindJavaVersion
#969
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Replace raw version strings with normalized major versions in the `JavaVersionTable` data table. This addresses issue #968 where users expect normalized values like "8" instead of "1.8". - Use `getMajorVersion()` and `getMajorReleaseVersion()` instead of raw `getSourceCompatibility()` and `getTargetCompatibility()` fields - Update column descriptions to clarify they contain major versions Closes #968 Co-Authored-By: Claude Opus 4.5 <[email protected]>
Member
Author
|
We already have two recipes that report in more detail
Figured good enough then to have this singular recipe only use major versions;
|
mergify bot
added a commit
to robfrank/linklift
that referenced
this pull request
Jan 25, 2026
…25.0 to 3.26.0 [skip ci] Bumps [org.openrewrite.recipe:rewrite-migrate-java](https://github.com/openrewrite/rewrite-migrate-java) from 3.25.0 to 3.26.0. Release notes *Sourced from [org.openrewrite.recipe:rewrite-migrate-java's releases](https://github.com/openrewrite/rewrite-migrate-java/releases).* > 3.26.0 > ------ > > What's Changed > -------------- > > * Also change managed dependency classifier to ehcache to avoid breaking multi module projects by [`@dsgrieve`](https://github.com/dsgrieve) in [openrewrite/rewrite-migrate-java#963](https://redirect.github.com/openrewrite/rewrite-migrate-java/pull/963) > * fix `IndexOutOfBoundsException` that occurs in `UseNoArgsConstructor` when visiting record compact constructor method by [`@zakaria-shahen`](https://github.com/zakaria-shahen) in [openrewrite/rewrite-migrate-java#964](https://redirect.github.com/openrewrite/rewrite-migrate-java/pull/964) > * Replace `getDisplayName()` and `getDescription()` methods with fields by [`@timtebeek`](https://github.com/timtebeek) in [openrewrite/rewrite-migrate-java#966](https://redirect.github.com/openrewrite/rewrite-migrate-java/pull/966) > * Use `var` for variables initialized with type casts by [`@timtebeek`](https://github.com/timtebeek) in [openrewrite/rewrite-migrate-java#965](https://redirect.github.com/openrewrite/rewrite-migrate-java/pull/965) > * Add recipe to find locale-sensitive date/time formatting affected by JDK 20+ CLDR changes by [`@timtebeek`](https://github.com/timtebeek) in [openrewrite/rewrite-migrate-java#967](https://redirect.github.com/openrewrite/rewrite-migrate-java/pull/967) > * Normalize version numbers in `FindJavaVersion` by [`@timtebeek`](https://github.com/timtebeek) in [openrewrite/rewrite-migrate-java#969](https://redirect.github.com/openrewrite/rewrite-migrate-java/pull/969) > * Fix JavaxWebXmlToJakartaWebXml regex to match multiline schemaLocation by [`@timtebeek`](https://github.com/timtebeek) in [openrewrite/rewrite-migrate-java#971](https://redirect.github.com/openrewrite/rewrite-migrate-java/pull/971) > > New Contributors > ---------------- > > * [`@dsgrieve`](https://github.com/dsgrieve) made their first contribution in [openrewrite/rewrite-migrate-java#963](https://redirect.github.com/openrewrite/rewrite-migrate-java/pull/963) > > **Full Changelog**: <openrewrite/rewrite-migrate-java@v3.25.0...v3.26.0> Commits * [`424b525`](openrewrite/rewrite-migrate-java@424b525) Fix JavaxWebXmlToJakartaWebXml regex to match multiline schemaLocation ([#971](https://redirect.github.com/openrewrite/rewrite-migrate-java/issues/971)) * [`4beeb8a`](openrewrite/rewrite-migrate-java@4beeb8a) Normalize version numbers in `FindJavaVersion` ([#969](https://redirect.github.com/openrewrite/rewrite-migrate-java/issues/969)) * [`1180190`](openrewrite/rewrite-migrate-java@1180190) [Auto] SDKMAN! Java candidates as of 2026-01-19T1023 * [`288ea96`](openrewrite/rewrite-migrate-java@288ea96) OpenRewrite recipe best practices * [`c7f8d21`](openrewrite/rewrite-migrate-java@c7f8d21) Replace `getEstimatedEffortPerOccurrence()` method with field * [`b22610d`](openrewrite/rewrite-migrate-java@b22610d) Replace `getTags()` method with field * [`90b4e63`](openrewrite/rewrite-migrate-java@90b4e63) Add recipe to find locale-sensitive date/time formatting affected by JDK 20+ ... * [`bb9adab`](openrewrite/rewrite-migrate-java@bb9adab) Update Gradle wrapper to 9.3.0 * [`da7c2e1`](openrewrite/rewrite-migrate-java@da7c2e1) Replace `Arrays.asList` with `List.of` in tests * [`7a52f88`](openrewrite/rewrite-migrate-java@7a52f88) OpenRewrite recipe best practices * Additional commits viewable in [compare view](openrewrite/rewrite-migrate-java@v3.25.0...v3.26.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 merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@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
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.
Summary
Replace raw version strings (e.g., "1.8", "11.0.15+10") with normalized major versions ("8", "11") in
FindJavaVersion's data tableUse
getMajorVersion()andgetMajorReleaseVersion()from theJavaVersionmarker instead of raw fieldsUpdate column descriptions in
JavaVersionTableto clarify they contain major versionsCloses FindJavaVersion (et al) -- normalize version numbers #968
Test plan
FindJavaVersionTestpasses🤖 Generated with Claude Code