Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xmlMapper.readValue( xmlString , Bean.class ) for Single Boolean Value does not get the value defaults with false #641

Open
sandeepGenz opened this issue Feb 27, 2024 · 1 comment

Comments

@sandeepGenz
Copy link

sandeepGenz commented Feb 27, 2024

Let say there is a class Bean.java

public class Bean{
    boolean isAlive();
}

and there is a xmlString which has the above isAlive field with the value , now i need to parse this xml and store it into a java object,

but when i do xmlMapper.readValue( xmlString , Bean.class); if the isAlive() field in xmlString is true , but after deserializing through this above code , the value taken from the xml defaults to false. hence noticed that for boolean values it always defaults to false.

@cowtowncoder
Copy link
Member

Unfortunately description is not enough to know what is going on: we'd need more information: specifically XML input used; and also actual Bean definition -- there seems to be no setter or field to set alive to.
And finally, configuration of XmlMapper probably matters too so should be included.

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

No branches or pull requests

2 participants