Issue #2906 fixed not checking for empty set in Mapper
(cherry picked from commit fdcd896f8cdc53c4324a60202b51780b0c054adc [formerly6d7e47bfc5
] [formerly5e128cb754
[formerlycf1d6c834c
] [formerly054eab2b3c
] [formerly6d7e47bfc5
[formerly054eab2b3c
[formerly 676712396db11fcfdc574e8951b7f1f82e0e77e5]]]]) Former-commit-id:eeeb3abe08
[formerly7dbd9922b5
] [formerly5045ecbd90
] [formerly96dfa3447d
[formerly5045ecbd90
[formerly 880a6fa582ca5d2a3d3c874f0df99ac7fe498aa5]]] Former-commit-id:96dfa3447d
Former-commit-id: 2e5644f460240d8868822d8b4f207e6a728bd288 [formerly63f972d854
] Former-commit-id:46034d331e
This commit is contained in:
parent
14767f29b5
commit
ab260f9c6e
1 changed files with 4 additions and 3 deletions
|
@ -54,6 +54,7 @@ import javax.xml.bind.Unmarshaller;
|
|||
* ------------ ---------- ----------- --------------------------
|
||||
* Mar 22, 2012 bsteffen Initial creation
|
||||
* Apr 02, 2014 2906 bclement changed to return empty set instead of null for lookup methods
|
||||
* Apr 02, 2014 2906 bclement fixed not checking for empty set in lookupAliases()
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -112,7 +113,7 @@ public abstract class Mapper {
|
|||
if (list != null) {
|
||||
baseNames = list.lookupBaseNames(alias);
|
||||
}
|
||||
if (baseNames == null) {
|
||||
if (baseNames == null || baseNames.isEmpty()) {
|
||||
if (defaultUseAlias) {
|
||||
baseNames = new HashSet<String>(Arrays.asList(alias));
|
||||
} else {
|
||||
|
@ -255,7 +256,7 @@ public abstract class Mapper {
|
|||
throws MultipleMappingException {
|
||||
Set<String> baseNames = lookupBaseNames(alias, namespace);
|
||||
if (baseNames == null || baseNames.isEmpty()) {
|
||||
return null;
|
||||
return alias;
|
||||
} else if (baseNames.size() == 1) {
|
||||
return baseNames.iterator().next();
|
||||
} else {
|
||||
|
@ -277,7 +278,7 @@ public abstract class Mapper {
|
|||
throws MultipleMappingException {
|
||||
Set<String> aliases = lookupAliases(base, namespace);
|
||||
if (aliases == null || aliases.isEmpty()) {
|
||||
return null;
|
||||
return base;
|
||||
} else if (aliases.size() == 1) {
|
||||
return aliases.iterator().next();
|
||||
} else {
|
||||
|
|
Loading…
Add table
Reference in a new issue