if (listNodeName.equals(listNode.getName())) {
InputNode item = listNode.getNext();
InputNode item1 = listNode1.getNext(); //HACK to handle Address inside user
InputNode item2 = listNode2.getNext(); //HACK to handle old om_time_zone
while (item != null) {
User u = ser.read(User.class, item, false);
boolean needToSkip1 = true;
//HACK to handle Address inside user
if (u.getAdresses() == null) {
Address a = ser.read(Address.class, item1, false);
u.setAdresses(a);
needToSkip1 = false;
}
if (needToSkip1) {
do {
item1 = listNode1.getNext(); //HACK to handle Address inside user
} while (item1 != null && !"user".equals(item1.getName()));
}
do {
if (u.getTimeZoneId() == null && "omTimeZone".equals(item2.getName())) {
String jName = item2.getValue();
u.setTimeZoneId(jName == null ? null : tzUtil.getTimezoneByInternalJName(jName).getID());
}
item2 = listNode2.getNext(); //HACK to handle old om_time_zone
} while (item2 != null && !"user".equals(item2.getName()));
// check that email is unique
if (u.getAdresses() != null && u.getAdresses().getEmail() != null) {
if (userEmailMap.containsKey(u.getAdresses().getEmail())) {
log.warn("Email is dublicated for user " + u.toString());
String updateEmail = "modified_by_import_<" + list.size() + ">" + u.getAdresses().getEmail();
u.getAdresses().setEmail(updateEmail);
}
userEmailMap.put(u.getAdresses().getEmail(), userEmailMap.size());
}
list.add(u);
item = listNode.getNext();
}
}