jakartaee / jakartaee/jaxb-api

generateIsSetMethod generates dangerous boolean code

Open
#253 10 comments 0 reactions 1 assignee View on GitHub

@glassfishrobot is already working on this.

Since Sep 21, 2018.

bug Major
Dominant language
Java
Stars
79
Forks
48
Avg merge
7h 12m
Merged PRs (30d)
2

Description

xjc generates code that does not properly autobox when 'generateIsSetMethod' is
used. I reported this for integers as issue 667, but that could be worked around
with an isSet method. However, booleans do not get an isSet method!

Generated code:

@XmlAttribute(name = "includeChildren")
protected Boolean includeChildren;

With generateIsSetMethod:
public boolean isIncludeChildren()

{ return includeChildren; }

Without:
public Boolean isIncludeChildren() { return includeChildren; }
#### Environment
Operating System: All
Platform: All
#### Affected Versions
[2.1.12]

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.