Program: 128076
Project: 128076
Buggy source:
private void initExtensionRepositoryNodes(final IRepositoryNode curParentNode){
  Map<ERepositoryObjectType,RepositoryNode> repositoryNodeExtensionMap=new HashMap<ERepositoryObjectType,RepositoryNode>();
  IExtensionRegistry registry=Platform.getExtensionRegistry();
  IConfigurationElement[] configurationElements=registry.getConfigurationElementsFor("String_Node_Str");
  Map<ERepositoryObjectType,ERepositoryObjectType> parentNodeMapping=new HashMap<ERepositoryObjectType,ERepositoryObjectType>();
  try {
    for (    IConfigurationElement element : configurationElements) {
      Object extensionNode=element.createExecutableExtension("String_Node_Str");
      String type=element.getAttribute("String_Node_Str");
      String isResouce=element.getAttribute("String_Node_Str");
      boolean isResource=false;
      if (isResouce != null) {
        isResource=Boolean.parseBoolean(isResouce);
      }
      String parentNodeType=element.getAttribute("String_Node_Str");
      if (isResource && extensionNode instanceof IExtendRepositoryNode) {
        IExtendRepositoryNode diyNode=(IExtendRepositoryNode)extensionNode;
        IImage icon=diyNode.getNodeImage();
        RepositoryNode dynamicNode=new RepositoryNode(null,this,ENodeType.SYSTEM_FOLDER);
        RepositoryNode[] children=(RepositoryNode[])diyNode.getChildren();
        if (children != null && (children.length > 0)) {
          for (          RepositoryNode nodeToAdd : children) {
            dynamicNode.getChildren().add(nodeToAdd);
            nodeToAdd.setParent(dynamicNode);
            nodeToAdd.setRoot(this);
          }
        }
        ERepositoryObjectType repositoryNodeType=ERepositoryObjectType.valueOf(ERepositoryObjectType.class,type);
        if (repositoryNodeType != null) {
          dynamicNode.setProperties(EProperties.LABEL,repositoryNodeType);
          dynamicNode.setProperties(EProperties.CONTENT_TYPE,repositoryNodeType);
        }
        dynamicNode.setIcon(icon);
        repositoryNodeExtensionMap.put(repositoryNodeType,dynamicNode);
        boolean withParent=false;
        if (parentNodeType != null) {
          ERepositoryObjectType parentType=ERepositoryObjectType.valueOf(ERepositoryObjectType.class,parentNodeType);
          if (parentType != null) {
            parentNodeMapping.put(repositoryNodeType,parentType);
            withParent=true;
          }
        }
        if (!withParent) {
          curParentNode.getChildren().add(dynamicNode);
        }
      }
    }
  }
 catch (  CoreException e) {
    ExceptionHandler.process(e);
  }
  collectRepositoryNodes(curParentNode);
  for (  ERepositoryObjectType childType : parentNodeMapping.keySet()) {
    RepositoryNode childNode=repositoryNodeExtensionMap.get(childType);
    ERepositoryObjectType parentType=parentNodeMapping.get(childType);
    if (parentType != null && childNode != null) {
      RepositoryNode parentNode=getRootRepositoryNode(parentType);
      if (parentNode == null) {
        parentNode=repositoryNodeExtensionMap.get(parentType);
      }
      if (parentNode != null) {
        parentNode.getChildren().add(childNode);
      }
 else {
        curParentNode.getChildren().add(childNode);
      }
    }
  }
}

Fixed version (ground truth):
private void initExtensionRepositoryNodes(final IRepositoryNode curParentNode){
  Map<ERepositoryObjectType,RepositoryNode> repositoryNodeExtensionMap=new HashMap<ERepositoryObjectType,RepositoryNode>();
  IExtensionRegistry registry=Platform.getExtensionRegistry();
  IConfigurationElement[] configurationElements=registry.getConfigurationElementsFor("String_Node_Str");
  Map<ERepositoryObjectType,ERepositoryObjectType> parentNodeMapping=new HashMap<ERepositoryObjectType,ERepositoryObjectType>();
  try {
    for (    IConfigurationElement element : configurationElements) {
      Object extensionNode=element.createExecutableExtension("String_Node_Str");
      String type=element.getAttribute("String_Node_Str");
      String parentNodeType=element.getAttribute("String_Node_Str");
      if (extensionNode instanceof IExtendRepositoryNode) {
        IExtendRepositoryNode diyNode=(IExtendRepositoryNode)extensionNode;
        IImage icon=diyNode.getNodeImage();
        RepositoryNode dynamicNode=new RepositoryNode(null,this,ENodeType.SYSTEM_FOLDER);
        RepositoryNode[] children=(RepositoryNode[])diyNode.getChildren();
        if (children != null && (children.length > 0)) {
          for (          RepositoryNode nodeToAdd : children) {
            dynamicNode.getChildren().add(nodeToAdd);
            nodeToAdd.setParent(dynamicNode);
            nodeToAdd.setRoot(this);
          }
        }
        ERepositoryObjectType repositoryNodeType=ERepositoryObjectType.valueOf(ERepositoryObjectType.class,type);
        if (repositoryNodeType != null) {
          dynamicNode.setProperties(EProperties.LABEL,repositoryNodeType);
          dynamicNode.setProperties(EProperties.CONTENT_TYPE,repositoryNodeType);
        }
        dynamicNode.setIcon(icon);
        repositoryNodeExtensionMap.put(repositoryNodeType,dynamicNode);
        boolean withParent=false;
        if (parentNodeType != null) {
          ERepositoryObjectType parentType=ERepositoryObjectType.valueOf(ERepositoryObjectType.class,parentNodeType);
          if (parentType != null) {
            parentNodeMapping.put(repositoryNodeType,parentType);
            withParent=true;
          }
        }
        if (!withParent) {
          curParentNode.getChildren().add(dynamicNode);
        }
      }
    }
  }
 catch (  CoreException e) {
    ExceptionHandler.process(e);
  }
  collectRepositoryNodes(curParentNode);
  for (  ERepositoryObjectType childType : parentNodeMapping.keySet()) {
    RepositoryNode childNode=repositoryNodeExtensionMap.get(childType);
    ERepositoryObjectType parentType=parentNodeMapping.get(childType);
    if (parentType != null && childNode != null) {
      RepositoryNode parentNode=getRootRepositoryNode(parentType);
      if (parentNode == null) {
        parentNode=repositoryNodeExtensionMap.get(parentType);
      }
      if (parentNode != null) {
        parentNode.getChildren().add(childNode);
      }
 else {
        curParentNode.getChildren().add(childNode);
      }
    }
  }
}