rewrite-migrate-java icon indicating copy to clipboard operation
rewrite-migrate-java copied to clipboard

OpenRewrite recipes for migrating to newer versions of Java.

Results 96 rewrite-migrate-java issues
Sort by recently updated
recently updated
newest added

## What version of OpenRewrite are you using? I am using - Maven/Gradle plugin v5.26.0 - rewrite-migrate-java v2.11.0 ## How are you running OpenRewrite? I am using the Maven plugin,...

bug
good first issue

Mostly to flush out issues with the build, and to be able to add new `SequencedCollection` recipes for getFirst, getLast & addFirst.

bug
java 21+
parser-java

## How are you running OpenRewrite? mvn -U org.openrewrite.maven:rewrite-maven-plugin:5.26.0:run -Drewrite.recipeArtifactCoordinates=org.openrewrite.recipe:rewrite-migrate-java:2.11.0 -Drewrite.activeRecipes=org.openrewrite.java.migrate.jakarta.JakartaEE10 Maven version used: 3.9.2 ## What did you expect to see? References to javax.* typed resources in ejb-jar.xml are...

bug

## How are you running OpenRewrite? mvn -U org.openrewrite.maven:rewrite-maven-plugin:5.26.0:run -Drewrite.recipeArtifactCoordinates=org.openrewrite.recipe:rewrite-migrate-java:2.11.0 -Drewrite.activeRecipes=org.openrewrite.java.migrate.jakarta.JakartaEE10 Maven version used: 3.9.2 ## What did you expect to see? No changes to java.sql.DataSources references ## What did...

bug

## What's your motivation? Fixes https://github.com/openrewrite/rewrite-migrate-java/issues/390 ## Anything in particular you'd like reviewers to focus on? Added a new source set for that Java 9+ classes needed for these replacements;...

recipe

Similar to https://docs.openrewrite.org/recipes/staticanalysis/isemptycalloncollections: ```diff - if ((current.length() > 0) && !Character.isWhitespace(current.charAt(current.length() - 1)) + if ((!current.isEmpty()) && !Character.isWhitespace(current.charAt(current.length() - 1)) ``` Example: https://github.com/JabRef/jabref/pull/10489/files#diff-7a00bcdda16c9953e17ec2db403404b78ad1a750671c76bd7ec885fdf8ffa776

good first issue
recipe

Instead of Guava's [ByteStreams#toByteArray()](https://guava.dev/releases/19.0/api/docs/com/google/common/io/ByteStreams.html#toByteArray(java.io.InputStream)), [InputStream.html#readAllBytes](https://docs.oracle.com/javase%2F9%2Fdocs%2Fapi%2F%2F/java/io/InputStream.html#readAllBytes--) should be used. The latter is available since Java 9. ```diff - String inputStr = new String(ByteStreams. toByteArray(inputStream), Charsets.UJTF_8); + String inputStr = new String(inputStream.readAllBytes()),...

good first issue
recipe

Hi - there are two problems with the way text blocks are being created, illustrated in this image. 1. The comments in the original have been deleted. There is no...

bug

## What version of OpenRewrite are you using? I am using - OpenRewrite v8.9.4 - Maven/Gradle plugin RELEASE - rewrite-migrate-java v2.3.0 ## How are you running OpenRewrite? I'm applying rules...

bug
parser-java

I ran `org.openrewrite.java.migrate.UpgradeToJava21` in moderne.io (https://app.moderne.io/results/gIKdjKpB8) I scrolled through diff, I found a change inside `build.gradle`: ```diff - implementation 'jakarta.inject:jakarta.inject-api:2.0.1' + implementation 'jakarta.inject:jakarta.inject-api:1.0.3' ``` I think, this should not happen,...

bug