JavaxPersistenceXmlToJakartaPersistenceXml finds persistence descriptors by namespace instead of file name - #1269
Merged
jkschneider merged 1 commit intoOct 4, 2026
Conversation
jkschneider
force-pushed
the
jakarta/persistence-descriptor-namespace
branch
from
October 3, 2026 22:26
80d4f01 to
575baa1
Compare
jkschneider
added this pull request to stack #1284
October 4, 2026 09:43
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
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.
The recipe only looked at files named
persistence.xml, so descriptors kept under other names, such as Arquillian'stest-persistence.xml, stayed on the Java EE namespace and version 2.0. Its precondition now matches any XML document whose root ispersistencein thehttp://java.sun.com/xml/ns/persistenceorhttp://xmlns.jcp.org/xml/ns/persistencenamespace, whatever the file is called. Unrelated XML with apersistenceroot is left alone, and so is apersistence.xmlalready on the Jakarta namespace, which the file name check used to set back to version 3.0 even when it was 3.2.Found by a team of coding agents reviewing a Moderne run of
org.openrewrite.java.migrate.jakarta.JavaxMigrationToJakartaover the 31 Arquillian repositories (run 20261003120559-YQoma). The issue iscustom-persistence-descriptor-skippedin the run'sio.moderne.RecipeIssuesdata table (10 rows), and the fix was discussed and reviewed on the run's message board. A row from the table, as a generalized example:Persistence descriptors packaged under a different filename are left in the Java EE namespace. (
arquillian/arquillian-extension-persistence,int-tests/src/test/resources-wildfly-8.1.0/test-persistence.xml, recipeorg.openrewrite.java.migrate.jakarta.JavaxMigrationToJakarta)Before:
What the recipe produced:
Expected:
Stacked on #1268 (6 of 19); merge that one first.