Program: 148999
Project: 148999
Buggy source:
public void doImport(TreeObject[] objs,IProgressMonitor monitor){
  try {
    monitor.beginTask("String_Node_Str",IProgressMonitor.UNKNOWN);
    XtentisPort port=Util.getPort((TreeObject)sel.getFirstElement());
    Reader reader;
    for (    TreeObject item : objs) {
      String[] subItems;
switch (item.getType()) {
case TreeObject.DATA_CLUSTER:
        monitor.subTask("String_Node_Str");
      subItems=item.getItems();
    for (    String subItem : subItems) {
      reader=new FileReader(importFolder + "String_Node_Str" + subItem);
      WSDataCluster model=(WSDataCluster)Unmarshaller.unmarshal(WSDataCluster.class,reader);
      port.putDataCluster(new WSPutDataCluster(model));
    }
  break;
case TreeObject.DATA_CLUSTER_CONTENTS:
subItems=item.getItems();
for (String subItem : subItems) {
reader=new FileReader(importFolder + "String_Node_Str" + subItem);
WSItem wsItem=(WSItem)Unmarshaller.unmarshal(WSItem.class,reader);
if (wsItem.getDataModelName() == null) {
}
 else {
  try {
    port.putItem(new WSPutItem(wsItem.getWsDataClusterPK(),wsItem.getContent(),new WSDataModelPK(wsItem.getDataModelName()),true));
  }
 catch (  Exception e) {
  }
}
}
break;
case TreeObject.DATA_MODEL:
monitor.subTask("String_Node_Str");
subItems=item.getItems();
for (String subItem : subItems) {
reader=new FileReader(importFolder + "String_Node_Str" + subItem);
WSDataModel model=(WSDataModel)Unmarshaller.unmarshal(WSDataModel.class,reader);
port.putDataModel(new WSPutDataModel(model));
}
monitor.worked(1);
break;
case TreeObject.MENU:
monitor.subTask("String_Node_Str");
subItems=item.getItems();
for (String subItem : subItems) {
reader=new FileReader(importFolder + "String_Node_Str" + subItem);
WSMenu memu=(WSMenu)Unmarshaller.unmarshal(WSMenu.class,reader);
port.putMenu(new WSPutMenu(memu));
}
monitor.worked(1);
break;
case TreeObject.ROLE:
monitor.subTask("String_Node_Str");
subItems=item.getItems();
for (String subItem : subItems) {
reader=new FileReader(importFolder + "String_Node_Str" + subItem);
WSRole role=(WSRole)Unmarshaller.unmarshal(WSRole.class,reader);
port.putRole(new WSPutRole(role));
}
monitor.worked(1);
break;
case TreeObject.ROUTING_RULE:
monitor.subTask("String_Node_Str");
subItems=item.getItems();
for (String subItem : subItems) {
reader=new FileReader(importFolder + "String_Node_Str" + subItem);
WSRoutingRule routingRule=(WSRoutingRule)Unmarshaller.unmarshal(WSRoutingRule.class,reader);
if (routingRule.getWsRoutingRuleExpressions() != null) for (WSRoutingRuleExpression rule : routingRule.getWsRoutingRuleExpressions()) {
if (rule.getWsOperator() == null) rule.setWsOperator(WSRoutingRuleOperator.CONTAINS);
}
port.putRoutingRule(new WSPutRoutingRule(routingRule));
}
monitor.worked(1);
break;
case TreeObject.STORED_PROCEDURE:
monitor.subTask("String_Node_Str");
subItems=item.getItems();
for (String subItem : subItems) {
reader=new FileReader(importFolder + "String_Node_Str" + subItem);
WSStoredProcedure model=(WSStoredProcedure)Unmarshaller.unmarshal(WSStoredProcedure.class,reader);
port.putStoredProcedure(new WSPutStoredProcedure(model));
}
monitor.worked(1);
break;
case TreeObject.SYNCHRONIZATIONPLAN:
monitor.subTask("String_Node_Str");
subItems=item.getItems();
for (String subItem : subItems) {
reader=new FileReader(importFolder + "String_Node_Str" + subItem);
WSSynchronizationPlan model=(WSSynchronizationPlan)Unmarshaller.unmarshal(WSSynchronizationPlan.class,reader);
port.putSynchronizationPlan(new WSPutSynchronizationPlan(model));
}
monitor.worked(1);
break;
case TreeObject.TRANSFORMER:
monitor.subTask("String_Node_Str");
subItems=item.getItems();
for (String subItem : subItems) {
reader=new FileReader(importFolder + "String_Node_Str" + subItem);
WSTransformer model=(WSTransformer)Unmarshaller.unmarshal(WSTransformer.class,reader);
port.putTransformer(new WSPutTransformer(model));
}
monitor.worked(1);
break;
case TreeObject.UNIVERSE:
monitor.subTask("String_Node_Str");
subItems=item.getItems();
for (String subItem : subItems) {
reader=new FileReader(importFolder + "String_Node_Str" + subItem);
WSUniverse model=(WSUniverse)Unmarshaller.unmarshal(WSUniverse.class,reader);
port.putUniverse(new WSPutUniverse(model));
}
monitor.worked(1);
break;
case TreeObject.VIEW:
monitor.subTask("String_Node_Str");
subItems=item.getItems();
for (String subItem : subItems) {
reader=new FileReader(importFolder + "String_Node_Str" + subItem);
WSView model=(WSView)Unmarshaller.unmarshal(WSView.class,reader);
port.putView(new WSPutView(model));
}
monitor.worked(1);
break;
}
}
monitor.done();
}
 catch (Exception e) {
e.printStackTrace();
}
}

Fixed version (ground truth):
public void doImport(TreeObject[] objs,IProgressMonitor monitor){
  try {
    monitor.beginTask("String_Node_Str",IProgressMonitor.UNKNOWN);
    XtentisPort port=Util.getPort((TreeObject)sel.getFirstElement());
    Reader reader;
    for (    TreeObject item : objs) {
      String[] subItems;
switch (item.getType()) {
case TreeObject.DATA_CLUSTER:
        monitor.subTask("String_Node_Str");
      subItems=item.getItems();
    for (    String subItem : subItems) {
      reader=new FileReader(importFolder + "String_Node_Str" + subItem);
      WSDataCluster model=(WSDataCluster)Unmarshaller.unmarshal(WSDataCluster.class,reader);
      port.putDataCluster(new WSPutDataCluster(model));
      importClusterContents(item,port);
    }
  break;
case TreeObject.DATA_CLUSTER_CONTENTS:
subItems=item.getItems();
for (String subItem : subItems) {
reader=new FileReader(importFolder + "String_Node_Str" + subItem);
WSItem wsItem=(WSItem)Unmarshaller.unmarshal(WSItem.class,reader);
if (wsItem.getDataModelName() == null) {
}
 else {
  try {
    port.putItem(new WSPutItem(wsItem.getWsDataClusterPK(),wsItem.getContent(),new WSDataModelPK(wsItem.getDataModelName()),true));
  }
 catch (  Exception e) {
  }
}
}
break;
case TreeObject.DATA_MODEL:
monitor.subTask("String_Node_Str");
subItems=item.getItems();
for (String subItem : subItems) {
reader=new FileReader(importFolder + "String_Node_Str" + subItem);
WSDataModel model=(WSDataModel)Unmarshaller.unmarshal(WSDataModel.class,reader);
port.putDataModel(new WSPutDataModel(model));
}
monitor.worked(1);
break;
case TreeObject.MENU:
monitor.subTask("String_Node_Str");
subItems=item.getItems();
for (String subItem : subItems) {
reader=new FileReader(importFolder + "String_Node_Str" + subItem);
WSMenu memu=(WSMenu)Unmarshaller.unmarshal(WSMenu.class,reader);
port.putMenu(new WSPutMenu(memu));
}
monitor.worked(1);
break;
case TreeObject.ROLE:
monitor.subTask("String_Node_Str");
subItems=item.getItems();
for (String subItem : subItems) {
reader=new FileReader(importFolder + "String_Node_Str" + subItem);
WSRole role=(WSRole)Unmarshaller.unmarshal(WSRole.class,reader);
port.putRole(new WSPutRole(role));
}
monitor.worked(1);
break;
case TreeObject.ROUTING_RULE:
monitor.subTask("String_Node_Str");
subItems=item.getItems();
for (String subItem : subItems) {
reader=new FileReader(importFolder + "String_Node_Str" + subItem);
WSRoutingRule routingRule=(WSRoutingRule)Unmarshaller.unmarshal(WSRoutingRule.class,reader);
if (routingRule.getWsRoutingRuleExpressions() != null) for (WSRoutingRuleExpression rule : routingRule.getWsRoutingRuleExpressions()) {
if (rule.getWsOperator() == null) rule.setWsOperator(WSRoutingRuleOperator.CONTAINS);
}
port.putRoutingRule(new WSPutRoutingRule(routingRule));
}
monitor.worked(1);
break;
case TreeObject.STORED_PROCEDURE:
monitor.subTask("String_Node_Str");
subItems=item.getItems();
for (String subItem : subItems) {
reader=new FileReader(importFolder + "String_Node_Str" + subItem);
WSStoredProcedure model=(WSStoredProcedure)Unmarshaller.unmarshal(WSStoredProcedure.class,reader);
port.putStoredProcedure(new WSPutStoredProcedure(model));
}
monitor.worked(1);
break;
case TreeObject.SYNCHRONIZATIONPLAN:
monitor.subTask("String_Node_Str");
subItems=item.getItems();
for (String subItem : subItems) {
reader=new FileReader(importFolder + "String_Node_Str" + subItem);
WSSynchronizationPlan model=(WSSynchronizationPlan)Unmarshaller.unmarshal(WSSynchronizationPlan.class,reader);
port.putSynchronizationPlan(new WSPutSynchronizationPlan(model));
}
monitor.worked(1);
break;
case TreeObject.TRANSFORMER:
monitor.subTask("String_Node_Str");
subItems=item.getItems();
for (String subItem : subItems) {
reader=new FileReader(importFolder + "String_Node_Str" + subItem);
WSTransformer model=(WSTransformer)Unmarshaller.unmarshal(WSTransformer.class,reader);
port.putTransformer(new WSPutTransformer(model));
}
monitor.worked(1);
break;
case TreeObject.UNIVERSE:
monitor.subTask("String_Node_Str");
subItems=item.getItems();
for (String subItem : subItems) {
reader=new FileReader(importFolder + "String_Node_Str" + subItem);
WSUniverse model=(WSUniverse)Unmarshaller.unmarshal(WSUniverse.class,reader);
port.putUniverse(new WSPutUniverse(model));
}
monitor.worked(1);
break;
case TreeObject.VIEW:
monitor.subTask("String_Node_Str");
subItems=item.getItems();
for (String subItem : subItems) {
reader=new FileReader(importFolder + "String_Node_Str" + subItem);
WSView model=(WSView)Unmarshaller.unmarshal(WSView.class,reader);
port.putView(new WSPutView(model));
}
monitor.worked(1);
break;
}
}
monitor.done();
}
 catch (Exception e) {
e.printStackTrace();
}
}