Map<NamedMethod, RemoveMethod> declaredRemoveMethods = new HashMap<NamedMethod, RemoveMethod>();
for (RemoveMethod removeMethod : session.getRemoveMethod()) {
declaredRemoveMethods.put(removeMethod.getBeanMethod(), removeMethod);
}
for (Annotated<Method> method : removeMethods) {
Remove remove = method.getAnnotation(Remove.class);
RemoveMethod removeMethod = new RemoveMethod(method.get(), remove.retainIfException());
RemoveMethod declaredRemoveMethod = declaredRemoveMethods.get(removeMethod.getBeanMethod());
if (declaredRemoveMethod == null) {
session.getRemoveMethod().add(removeMethod);
} else if (!declaredRemoveMethod.isExplicitlySet()) {
declaredRemoveMethod.setRetainIfException(remove.retainIfException());
}
}
}
}