code: private synchronized void ensureTemplatesResolved() throws SpecNotFoundException, TemplateException{
      if (this.resolved) {
        return;
      }
      Map<URI, JobTemplate> loadedTemplates = Maps.newHashMap();
      loadedTemplates.put(getUri(), this);
      resolveTemplates(loadedTemplates);
    }
docs: Resolves a list of {@link URI}s to actual {@link JobTemplate}s. This pattern is necessary to detect loops in
  inheritance and prevent them from causing a stack overflow.