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

javax.xml.bind.DatatypeConverter.parseBoolean("10") returns true instead of false or an Exception #240

Closed
Tomas-Kraus opened this issue May 16, 2012 · 6 comments · Fixed by #279
Assignees
Labels
bug Something isn't working Major Priority

Comments

@Tomas-Kraus
Copy link
Contributor

javax.xml.bind.DatatypeConverter.parseBoolean("10") returns true instead of false or an Exception.

The method will return true for any String that starts with "1" like "11" or "1A".

I would expect the result to be false or throw an IllegalArgumentException as the Javadoc seems to indicate.

Environment

java version "1.6.0_31"
Java(TM) SE Runtime Environment (build 1.6.0_31-b05)
Java HotSpot(TM) 64-Bit Server VM (build 20.6-b01, mixed mode)

Windows 7 64-bit

Affected Versions

[2.2.5]

@Tomas-Kraus
Copy link
Contributor Author

@glassfishrobot Commented
Reported by garydgregory

@Tomas-Kraus
Copy link
Contributor Author

@glassfishrobot Commented
Issue-Links:
is duplicated by
JAXB-902

@Tomas-Kraus
Copy link
Contributor Author

@glassfishrobot Commented
Was assigned to snajper

@Tomas-Kraus
Copy link
Contributor Author

@glassfishrobot Commented
snajper said:
This belongs to spec category, and most likely we'll update javadoc with next MR, since we don't want to change behaviour (as we managed to with eclipse-ee4j/jaxb-ri#902) which is defined since 2.1.0.

As a workaround, one can of course supply own version of DTC.

@Tomas-Kraus
Copy link
Contributor Author

@glassfishrobot Commented
This issue was imported from java.net JIRA JAXB-901

@Tomas-Kraus
Copy link
Contributor Author

@lukasj lukasj transferred this issue from eclipse-ee4j/jaxb-ri May 19, 2022
@lukasj lukasj added bug Something isn't working and removed ERR: Assignee labels May 19, 2022
laurentschoelens added a commit to laurentschoelens/jaxb-api that referenced this issue Sep 7, 2023
laurentschoelens added a commit to laurentschoelens/jaxb-ri that referenced this issue Sep 17, 2023
…ue boolean

impl now has same results as api but returning null
instead of exception according to jakartaee/jaxb-api#240
laurentschoelens added a commit to laurentschoelens/jaxb-ri that referenced this issue Sep 17, 2023
…ue boolean

impl now has same results as api but returning null
instead of exception according to jakartaee/jaxb-api#240
lukasj pushed a commit to eclipse-ee4j/jaxb-ri that referenced this issue Oct 6, 2023
impl now has same results as api but returning null
instead of exception according to jakartaee/jaxb-api#240
lukasj pushed a commit to lukasj/jaxb-ri that referenced this issue Oct 9, 2023
…ue boolean

impl now has same results as api but returning null
instead of exception according to jakartaee/jaxb-api#240

(cherry picked from commit 36eb718)
lukasj pushed a commit to eclipse-ee4j/jaxb-ri that referenced this issue Oct 13, 2023
impl now has same results as api but returning null
instead of exception according to jakartaee/jaxb-api#240

(cherry picked from commit 36eb718)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Major Priority
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants