Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Use Java 17 language features#1749

Merged
krisstern merged 3 commits into
jenkinsci:masterfrom
MarkEWaite:use-java-17-language-features
Mar 2, 2025
Merged

Use Java 17 language features#1749
krisstern merged 3 commits into
jenkinsci:masterfrom
MarkEWaite:use-java-17-language-features

Conversation

@MarkEWaite

Copy link
Copy Markdown
Contributor

Use Java 17 language features

Use Java 17 pattern matching instanceof. Makes the code easier to read by avoding the cast that often follows an instanceof.

Use Java 17 string formatting. Slight simplification of the code through OpenRewrite.

Use Java 17 @serial annotation. Annotation that may allow future checks for serialization. No real benefit today as far as I can tell.

Special thanks to OpenRewrite for https://docs.openrewrite.org/recipes/java/migrate/upgradetojava17

Testing done

Confirmed that automated tests pass.

Submitter checklist

  • Make sure you are opening from a topic/feature/bugfix branch (right side) and not your main branch!
  • Ensure that the pull request title represents the desired changelog entry
  • Please describe what you did
  • Link to relevant issues in GitHub or Jira
  • Link to relevant pull requests, esp. upstream and downstream changes
  • Ensure you have provided tests - that demonstrates feature works or fixes the issue

Makes the code easier to read by avoding the cast that often follows
an instanceof.
Annotation that may allow future checks for serialization.  No real
benefit today as far as I can tell.
Slight simplification of the code through OpenRewrite
@MarkEWaite MarkEWaite requested a review from a team as a code owner March 1, 2025 23:56
@krisstern

Copy link
Copy Markdown
Member

Thanks @MarkEWaite for the PR!

@krisstern krisstern merged commit 5018cec into jenkinsci:master Mar 2, 2025
@MarkEWaite MarkEWaite deleted the use-java-17-language-features branch March 2, 2025 07:39
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.

2 participants