eclipse-ee4j / eclipse-ee4j/jaxb-ri

prefix-mapping is not predictable

Open
#1,069 5 comments 0 reactions 1 assignee Claimed by @glassfishrobot View on GitHub
Component: runtime Priority: Minor Type: Bug
Dominant language
Java
Stars
222
Forks
131
Avg merge
2d 17h
Merged PRs (30d)
9

Description

If you generate XML which includes other XML's, you might have a different default namespace in two different javax.xml.bind.annotation.XmlNs in package-info.

In the current implementation of com.sun.xml.bind.v2.runtime.JAXBContextImpl it is not predictable which of the two will win. Actually in java 7 I get other ones that in java 8.

I propose to change

```
xmlNsSet = new HashSet();
```

in

```
xmlNsSet = new LinkedHashSet();
```

(at line 327)

I think this will fix it. The set will be at insertion order, and we will not end up with 'ns3' for our current default namespace...
#### Affected Versions
[2.2.11]

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.