JRTemplateReference[] includedTemplates = template.getIncludedTemplates();
if (includedTemplates != null)
{
for (int i = 0; i < includedTemplates.length; i++)
{
JRTemplateReference reference = includedTemplates[i];
String location = reference.getLocation();
if (!templateParentLocations.add(location))
{
throw new JRRuntimeException("Circular dependency found for template at location "
+ location);