code: protected void init3() {
          if (disabledSubProjects == null) {
              disabledSubProjects = new PersistedList<>(this);
          }
  
          // Owner doesn't seem to be set when loading from XML
          disabledSubProjects.setOwner(this);
  
          try {
              XmlFile templateXmlFile = Items.getConfigFile(getTemplateDir());
              if (templateXmlFile.getFile().isFile()) {
                  /*
                   * Do not use Items.load here, since it uses getRootDirFor(i) during onLoad,
                   * which returns the wrong location since template would still be unset.
                   * Instead, read the XML directly into template and then invoke onLoad.
                   */
                  //noinspection unchecked
                  template = (P) templateXmlFile.read();
                  template.onLoad(this, TEMPLATE);
              } else {
                  /*
                   * Don't use the factory here because newInstance calls setBranch, attempting
                   * to save the project before template is set.  That would invoke
                   * getRootDirFor(i) and get the wrong directory to save into.
                   */
                  template = newTemplate();
              }
  
              // Prevent tampering
              if (!(template.getScm() instanceof NullSCM)) {
                  template.setScm(new NullSCM());
              }
              template.disable();
          } catch (IOException e) {
              LOGGER.log(Level.WARNING, "Failed to load template project " + getTemplateDir(), e);
          }
      }
docs: Common initialization that is invoked when either a new project is created with the constructor
  {@link TemplateDrivenMultiBranchProject#TemplateDrivenMultiBranchProject(ItemGroup, String)} or when a project
  is loaded from disk with {@link #onLoad(ItemGroup, String)}.