Program: 148535
Project: 148535
Buggy source:
private void importClusterContents(TreeObject item,XtentisPort port){
  if (dataClusterContent.containsKey(item.getDisplayName())) {
    Reader reader=null;
    String[] paths=dataClusterContent.get(item.getDisplayName());
    Map<String,List<String>> conceptMap=new HashMap<String,List<String>>();
    for (int i=0; i < paths.length; i++) {
      try {
        String path=paths[i];
        reader=new InputStreamReader(new FileInputStream(importFolder + "String_Node_Str" + path),"String_Node_Str");
        WSItem wsItem=(WSItem)Unmarshaller.unmarshal(WSItem.class,reader);
        String key=wsItem.getWsDataClusterPK().getPk() + "String_Node_Str" + wsItem.getConceptName()+ "String_Node_Str"+ wsItem.getDataModelName();
        List<String> list=new ArrayList<String>();
        if (!conceptMap.containsKey(key)) {
          conceptMap.put(key,list);
        }
 else {
          list=conceptMap.get(key);
        }
        list.add(wsItem.getContent());
      }
 catch (      Exception e1) {
        e1.printStackTrace();
      }
 finally {
        try {
          if (reader != null)           reader.close();
        }
 catch (        Exception e) {
        }
      }
    }
    String url=item.getEndpointIpAddress() + "String_Node_Str";
    for (    Entry<String,List<String>> entry : conceptMap.entrySet()) {
      String[] keys=entry.getKey().split("String_Node_Str");
      String cluster=keys[0];
      String concept=keys[1];
      String datamodel=keys[2];
      BulkloadClient bulkloadClient=new BulkloadClient(url,item.getUsername(),item.getPassword(),null,cluster,concept,datamodel);
      bulkloadClient.setOptions(new BulkloadOptions(false,false,500));
      try {
        bulkloadClient.load(entry.getValue());
      }
 catch (      Exception e) {
        e.printStackTrace();
      }
    }
  }
}

Fixed version (ground truth):
private void importClusterContents(TreeObject item,XtentisPort port,HashMap<String,String> picturePathMap){
  if (dataClusterContent.containsKey(item.getDisplayName())) {
    Reader reader=null;
    String[] paths=dataClusterContent.get(item.getDisplayName());
    Map<String,List<String>> conceptMap=new HashMap<String,List<String>>();
    for (int i=0; i < paths.length; i++) {
      try {
        String path=paths[i];
        reader=new InputStreamReader(new FileInputStream(importFolder + "String_Node_Str" + path),"String_Node_Str");
        WSItem wsItem=(WSItem)Unmarshaller.unmarshal(WSItem.class,reader);
        String key=wsItem.getWsDataClusterPK().getPk() + "String_Node_Str" + wsItem.getConceptName()+ "String_Node_Str"+ wsItem.getDataModelName();
        List<String> list=new ArrayList<String>();
        if (!conceptMap.containsKey(key)) {
          conceptMap.put(key,list);
        }
 else {
          list=conceptMap.get(key);
          String content=wsItem.getContent();
          boolean isUpdate=false;
          for (          String picturekey : picturePathMap.keySet()) {
            String fileName=picturekey.substring(picturekey.indexOf("String_Node_Str") + 1);
            if (content.contains(fileName)) {
              String targetPicturePath=picturePathMap.get(picturekey);
              content=updatePicturePath(content,picturekey,targetPicturePath);
              isUpdate=true;
              list.add(content);
              conceptMap.put(key,list);
            }
          }
          if (!isUpdate) {
            list.add(content);
            conceptMap.put(key,list);
          }
        }
      }
 catch (      Exception e1) {
        e1.printStackTrace();
      }
 finally {
        try {
          if (reader != null)           reader.close();
        }
 catch (        Exception e) {
        }
      }
    }
    String url=item.getEndpointIpAddress() + "String_Node_Str";
    for (    Entry<String,List<String>> entry : conceptMap.entrySet()) {
      String[] keys=entry.getKey().split("String_Node_Str");
      String cluster=keys[0];
      String concept=keys[1];
      String datamodel=keys[2];
      BulkloadClient bulkloadClient=new BulkloadClient(url,item.getUsername(),item.getPassword(),null,cluster,concept,datamodel);
      bulkloadClient.setOptions(new BulkloadOptions(false,false,500));
      try {
        bulkloadClient.load(entry.getValue());
      }
 catch (      Exception e) {
        e.printStackTrace();
      }
    }
  }
}