} catch (DotDataException e) {
// TODO Auto-generated catch block
throw new SystemException("Cannot find System User");
}
if(systemUser.getUserId().equals(userId)){
throw new NoSuchUserException(userId.toString());
}
UserHBM userHBM = (UserHBM)session.load(UserHBM.class, userId);
com.liferay.portal.model.User user = UserHBMUtil.model(userHBM);
session.delete(userHBM);
session.flush();
UserPool.remove(userId);
return user;
}
catch (HibernateException he) {
if (he instanceof ObjectNotFoundException) {
throw new NoSuchUserException(userId.toString());
}
else {
throw new SystemException(he);
}
}