* @throws InvalidVersionException if there was a concurrent modification of the policy. Getting
* this exception means that no policy has been updated and the repository hasn't
* been modified nor corrupted.
*/
public void updatePolicy(String version, PolicyType policy) {
PolicyType oldPolicy = policyDAO.getById(papId, policy.getPolicyId());
int numberOfRemovedRules = oldPolicy.getRules().size();
TypeStringUtils.releaseUnneededMemory(oldPolicy);
int numberOfAddedRules = policy.getRules().size();
policyDAO.update(papId, version, policy);