names update

This commit is contained in:
Victor Shcherb 2020-12-23 12:02:42 +01:00
parent d8ed8388cf
commit 75e93d6ec7

View file

@ -91,21 +91,20 @@ public abstract class MapObject implements Comparable<MapObject> {
}
public Map<String, String> getNamesMap(boolean includeEn) {
if (!includeEn || Algorithms.isEmpty(enName)) {
if (names == null) {
if ((!includeEn || Algorithms.isEmpty(enName)) && names == null) {
return Collections.emptyMap();
}
return names;
}
Map<String, String> mp = new HashMap<String, String>();
if (names != null) {
Iterator<Entry<String, String>> it = mp.entrySet().iterator();
while(it.hasNext()) {
Iterator<Entry<String, String>> it = names.entrySet().iterator();
while (it.hasNext()) {
Entry<String, String> e = it.next();
mp.put(e.getKey(), unzipContent(e.getValue()));
}
}
if (includeEn && !Algorithms.isEmpty(enName)) {
mp.put("en", unzipContent(enName));
}
return mp;
}
@ -115,7 +114,7 @@ public abstract class MapObject implements Comparable<MapObject> {
l.add(unzipContent(enName));
}
if (names != null) {
for(String nm : names.values()) {
for (String nm : names.values()) {
l.add(unzipContent(nm));
}
}