* @return
*/
private TemporaryKey loadCleanTemporaryKey(String serMailMap) {
TemporaryKey tk = rm.loadTemporaryKeyByEmail(serMailMap);
if (tk == null) {
XStream xml = new XStream();
HashMap<String, String> mails = (HashMap<String, String>) xml.fromXML(serMailMap);
String currentEMail = mails.get("currentEMail");
List<TemporaryKey> tks = rm.loadTemporaryKeyByAction(RegistrationManager.EMAIL_CHANGE);
if (tks != null) {
synchronized (tks) {
tks = rm.loadTemporaryKeyByAction(RegistrationManager.EMAIL_CHANGE);
int countCurrentEMail = 0;
for (TemporaryKey temporaryKey : tks) {
HashMap<String, String> tkMails = (HashMap<String, String>) xml.fromXML(temporaryKey.getEmailAddress());
if (tkMails.get("currentEMail").equals(currentEMail)) {
if (countCurrentEMail > 0) {
// clean
rm.deleteTemporaryKeyWithId(temporaryKey.getRegistrationKey());
} else {