// Set the the type
// Work out the type of the policy.
final TypeContainer typeContainer = policy.getTypeContainer();
String typeName = typeContainer.getName();
Type type = typeContainer.getType();
if (typeName != null && type == null) {
// this is a reference to a declared type.
TypeDeclaration declaration = definitions.getType(typeName);
if (declaration == null) {
throw new RepositoryException(EXCEPTION_LOCALIZER.format(