/** * Method description * * @param user */ @Override protected void preUpate(User user) { if (DUMMY_PASSWORT.equals(user.getPassword())) { User o = manager.get(user.getName()); AssertUtil.assertIsNotNull(o); user.setPassword(o.getPassword()); } else { encryptPassword(user); } }
/** * Method description * * @param user */ private void encryptPassword(User user) { String password = user.getPassword(); if (Util.isNotEmpty(password)) { user.setPassword(encryptionHandler.encrypt(password)); } }