highsource / highsource/jaxb2-basics
simpleEquals does not work for JAXBElement in Lists
- Dominant language
- Java
- Stars
- 119
- Forks
- 49
- PR merge metrics
- No merged PRs in 30d
Description
Hi,
I have a situation where a JAXBElement is in a List, and the simpleEquals plugins generated code contains something like this:
```
List leftAny;
leftAny = (((this.any!= null)&&(!this.any.isEmpty()))?this.getAny():null);
List rightAny;
rightAny = (((that.any!= null)&&(!that.any.isEmpty()))?that.getAny():null);
if (leftAny!= null) {
if (rightAny!= null) {
if (!leftAny.equals(rightAny)) {
return false;
}
} else {
return false;
}
} else {
if (rightAny!= null) {
return false;
}
}
```
So when equals is called on the ArrayList, of course JAXBElement are not compared by content as they should… Apparently the problem does not happen with the runtime-library-based equals plugin.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.