}
List<Policy> implToAdd = new LinkedList<Policy>();
List<Policy> interactToAdd = new LinkedList<Policy>();
for (int i=0; i<interaction.size(); i++) {
Policy required = interaction.get(i).getPolicyDependency();
if (required != null) {
if (required.supports(PolicyType.INTERACTION) && !interaction.contains(required) && !interactToAdd.contains(required)) {
BaseDeployLogger.ROOT_LOGGER.enforcingInteractionPolicyDependency(required.toString(), interaction.get(i).toString());
interactToAdd.add(required);
} else if (required.supports(PolicyType.IMPLEMENTATION) && !implementation.contains(required) && !implToAdd.contains(required)) {
BaseDeployLogger.ROOT_LOGGER.enforcingImplementationPolicyDependency(required.toString(), interaction.get(i).toString());
implToAdd.add(required);
}
}
}
for (int i=0; i<implementation.size(); i++) {
Policy required = implementation.get(i).getPolicyDependency();
if (required != null) {
if (required.supports(PolicyType.IMPLEMENTATION) && !implementation.contains(required) && !implToAdd.contains(required)) {
BaseDeployLogger.ROOT_LOGGER.enforcingImplementationPolicyDependency(required.toString(), implementation.get(i).toString());
implToAdd.add(required);
} else if (required.supports(PolicyType.INTERACTION) && !interaction.contains(required) && !interactToAdd.contains(required)) {
BaseDeployLogger.ROOT_LOGGER.enforcingInteractionPolicyDependency(required.toString(), implementation.get(i).toString());
interactToAdd.add(required);
}
}
}