Closure<?> reownered = configuration.rehydrate(null, owner, thisObject);
modelRegistry.mutate(new ClosureBackedModelMutator(reownered, references, modelPath, sourceLocation));
}
private static RuleMetadata getRuleMetadata(Closure<?> closure) {
RuleMetadata ruleMetadata = closure.getClass().getAnnotation(RuleMetadata.class);
if (ruleMetadata == null) {
throw new IllegalStateException(String.format("Expected %s annotation to be used on the argument closure.", RuleMetadata.class.getName()));
}
return ruleMetadata;
}