Skip to content

Fix for #615: Use ValueInstantiators to rename creator properties so they match property definitions#806

Open
mcvayc wants to merge 2 commits intoFasterXML:3.xfrom
mcvayc:fix/issue-615
Open

Fix for #615: Use ValueInstantiators to rename creator properties so they match property definitions#806
mcvayc wants to merge 2 commits intoFasterXML:3.xfrom
mcvayc:fix/issue-615

Conversation

@mcvayc
Copy link

@mcvayc mcvayc commented Mar 15, 2026

Hi,

This PR was intended to fix #615 but in the process tests for #149, #517, and #735 in the tofix package started passing as well. I've listed all the issues for which test are now passing in the commits, but still need to verify for those that the entire issue is fixed.

The initial solution was co-written by Claude Code and me. After collaboratively creating a fix, I subsequently read through the code and edited it for quality and consistency. I believe the solution is now in decent shape, at least for #615.

Please let me know what you think. I'm happy to make further edits.

// Second check: rename map from property definitions
String newName = renames.get(propName);
if (newName != null && !newName.equals(propName)) {
creatorProps[i] = prop.withSimpleName(newName);
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other than directly editing the array items, is there a better way to update the creator properties of the instantiator? I didn't see a setter.

// [dataformat-xml#423]
@JacksonTestFailureExpected
@Test
public void testXmlTextViaCtor423() throws Exception
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test started passing so I split it out so it could be removed from the tofix package.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test now resides in src/test/java/tools/jackson/dataformat/xml/deser/XmlTextViaCtor423Test.java

@mcvayc
Copy link
Author

mcvayc commented Mar 15, 2026

I see the build errors, let me take a look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Deserialization of Xml with @JacksonXmlText using @JsonCreator (into java.util.Map) fails

1 participant