openrewrite / rewrite-migrate-java

OpenRewrite recipes for migrating to newer versions of Java.
Apache License 2.0
111 stars 75 forks source link

Remove wrong namespace-change of package javax.transaction.xa #554

Closed Xaeras closed 2 months ago

Xaeras commented 2 months ago

This change removes a wrongly made namespace-change of a package in jakarta-ee-9.yml.

Previously, the package javax.transaction.xa (from Java SE 8) was wrongly changed to jakarta.transaction.xa, which does not exist because it did not change. This was probably done because the namespace change did affect all sub-packages for other packages of javax.* namespace. With javax.transaction however, there is only this single package in Jakarta EE which has change to jakarta.transaction. The namespace of the package javax.transaction.xa (from Java SE 8) did not change though, which is why my solution would be to just turn the recursive attribute to 'false'.

What's changed?

Changed the value of the recursive attribute in the recipe org.openrewrite.java.migrate.jakarta.JavaxTransactionMigrationToJakartaTransaction from true to false and added a testclass.

What's your motivation?

Months ago I was mentioning this bug in slack here and I forgot to make the MR until now.

Anything in particular you'd like reviewers to focus on?

There is only this single package that has been renamed from javax.transaction to jakarta.transaction as shown here, so i don't think we need the recursive change, especially if it causes unwanted side-effects.

Anyone you would like to review specifically?

I was talking with @timtebeek on slack, so he would probably be the best here.

Have you considered any alternatives or workarounds?

As @timtebeek suggested, I could have excluded the javax.transaction.xa namespace, but I think my solution is more simple. I am open to discussion though :)

Checklist