Program: 148968
Project: 148968
Buggy source:
public void doImport(TreeObject[] objs,IProgressMonitor monitor){
  monitor.beginTask("String_Node_Str",IProgressMonitor.UNKNOWN);
  XtentisPort port=null;
  try {
    port=Util.getPort((TreeObject)sel.getFirstElement());
  }
 catch (  XtentisException e3) {
    e3.printStackTrace();
  }
  Reader reader=null;
  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) {
    try {
      reader=new FileReader(importFolder + "String_Node_Str" + subItem);
    }
 catch (    FileNotFoundException e1) {
      e1.printStackTrace();
    }
    WSDataCluster model=new WSDataCluster();
    try {
      model=(WSDataCluster)Unmarshaller.unmarshal(WSDataCluster.class,reader);
    }
 catch (    MarshalException e1) {
      e1.printStackTrace();
    }
catch (    ValidationException e1) {
      e1.printStackTrace();
    }
    try {
      port.putDataCluster(new WSPutDataCluster(model));
    }
 catch (    RemoteException e) {
      e.printStackTrace();
    }
    importClusterContents(item,port);
  }
break;
case TreeObject.DATA_CLUSTER_CONTENTS:
subItems=item.getItems();
for (String subItem : subItems) {
try {
reader=new FileReader(importFolder + "String_Node_Str" + subItem);
}
 catch (FileNotFoundException e2) {
e2.printStackTrace();
}
WSItem wsItem=new WSItem();
try {
wsItem=(WSItem)Unmarshaller.unmarshal(WSItem.class,reader);
}
 catch (MarshalException e1) {
e1.printStackTrace();
}
catch (ValidationException e1) {
e1.printStackTrace();
}
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) {
try {
reader=new FileReader(importFolder + "String_Node_Str" + subItem);
}
 catch (FileNotFoundException e2) {
e2.printStackTrace();
}
WSDataModel model=new WSDataModel();
try {
model=(WSDataModel)Unmarshaller.unmarshal(WSDataModel.class,reader);
}
 catch (MarshalException e1) {
e1.printStackTrace();
}
catch (ValidationException e1) {
e1.printStackTrace();
}
try {
port.putDataModel(new WSPutDataModel(model));
}
 catch (RemoteException e) {
e.printStackTrace();
}
}
monitor.worked(1);
break;
case TreeObject.MENU:
monitor.subTask("String_Node_Str");
subItems=item.getItems();
for (String subItem : subItems) {
try {
reader=new FileReader(importFolder + "String_Node_Str" + subItem);
}
 catch (FileNotFoundException e2) {
e2.printStackTrace();
}
WSMenu memu=new WSMenu();
try {
memu=(WSMenu)Unmarshaller.unmarshal(WSMenu.class,reader);
}
 catch (MarshalException e1) {
e1.printStackTrace();
}
catch (ValidationException e1) {
e1.printStackTrace();
}
try {
port.putMenu(new WSPutMenu(memu));
}
 catch (RemoteException e) {
e.printStackTrace();
}
}
monitor.worked(1);
break;
case TreeObject.ROLE:
monitor.subTask("String_Node_Str");
subItems=item.getItems();
for (String subItem : subItems) {
try {
reader=new FileReader(importFolder + "String_Node_Str" + subItem);
}
 catch (FileNotFoundException e2) {
e2.printStackTrace();
}
WSRole role=new WSRole();
try {
role=(WSRole)Unmarshaller.unmarshal(WSRole.class,reader);
}
 catch (MarshalException e1) {
e1.printStackTrace();
}
catch (ValidationException e1) {
e1.printStackTrace();
}
try {
port.putRole(new WSPutRole(role));
}
 catch (RemoteException e) {
e.printStackTrace();
}
}
monitor.worked(1);
break;
case TreeObject.ROUTING_RULE:
monitor.subTask("String_Node_Str");
subItems=item.getItems();
for (String subItem : subItems) {
try {
reader=new FileReader(importFolder + "String_Node_Str" + subItem);
}
 catch (FileNotFoundException e2) {
e2.printStackTrace();
}
WSRoutingRule routingRule=new WSRoutingRule();
try {
routingRule=(WSRoutingRule)Unmarshaller.unmarshal(WSRoutingRule.class,reader);
}
 catch (MarshalException e1) {
e1.printStackTrace();
}
catch (ValidationException e1) {
e1.printStackTrace();
}
if (routingRule.getWsRoutingRuleExpressions() != null) for (WSRoutingRuleExpression rule : routingRule.getWsRoutingRuleExpressions()) {
if (rule.getWsOperator() == null) rule.setWsOperator(WSRoutingRuleOperator.CONTAINS);
}
try {
port.putRoutingRule(new WSPutRoutingRule(routingRule));
}
 catch (RemoteException e) {
e.printStackTrace();
}
}
monitor.worked(1);
break;
case TreeObject.STORED_PROCEDURE:
monitor.subTask("String_Node_Str");
subItems=item.getItems();
for (String subItem : subItems) {
try {
reader=new FileReader(importFolder + "String_Node_Str" + subItem);
}
 catch (FileNotFoundException e2) {
e2.printStackTrace();
}
WSStoredProcedure model=new WSStoredProcedure();
try {
model=(WSStoredProcedure)Unmarshaller.unmarshal(WSStoredProcedure.class,reader);
}
 catch (MarshalException e1) {
e1.printStackTrace();
}
catch (ValidationException e1) {
e1.printStackTrace();
}
try {
port.putStoredProcedure(new WSPutStoredProcedure(model));
}
 catch (RemoteException e) {
e.printStackTrace();
}
}
monitor.worked(1);
break;
case TreeObject.SYNCHRONIZATIONPLAN:
monitor.subTask("String_Node_Str");
subItems=item.getItems();
for (String subItem : subItems) {
try {
reader=new FileReader(importFolder + "String_Node_Str" + subItem);
}
 catch (FileNotFoundException e2) {
e2.printStackTrace();
}
WSSynchronizationPlan model=new WSSynchronizationPlan();
try {
model=(WSSynchronizationPlan)Unmarshaller.unmarshal(WSSynchronizationPlan.class,reader);
}
 catch (MarshalException e1) {
e1.printStackTrace();
}
catch (ValidationException e1) {
e1.printStackTrace();
}
try {
port.putSynchronizationPlan(new WSPutSynchronizationPlan(model));
}
 catch (RemoteException e) {
e.printStackTrace();
}
}
monitor.worked(1);
break;
case TreeObject.TRANSFORMER:
monitor.subTask("String_Node_Str");
subItems=item.getItems();
for (String subItem : subItems) {
try {
reader=new FileReader(importFolder + "String_Node_Str" + subItem);
}
 catch (FileNotFoundException e2) {
e2.printStackTrace();
}
WSTransformer model=new WSTransformer();
try {
model=(WSTransformer)Unmarshaller.unmarshal(WSTransformer.class,reader);
}
 catch (MarshalException e1) {
e1.printStackTrace();
}
catch (ValidationException e1) {
e1.printStackTrace();
}
try {
port.putTransformer(new WSPutTransformer(model));
}
 catch (RemoteException e) {
e.printStackTrace();
}
}
monitor.worked(1);
break;
case TreeObject.UNIVERSE:
monitor.subTask("String_Node_Str");
subItems=item.getItems();
for (String subItem : subItems) {
try {
reader=new FileReader(importFolder + "String_Node_Str" + subItem);
}
 catch (FileNotFoundException e2) {
e2.printStackTrace();
}
WSUniverse model=new WSUniverse();
try {
model=(WSUniverse)Unmarshaller.unmarshal(WSUniverse.class,reader);
}
 catch (MarshalException e1) {
e1.printStackTrace();
}
catch (ValidationException e1) {
e1.printStackTrace();
}
try {
port.putUniverse(new WSPutUniverse(model));
}
 catch (RemoteException e) {
e.printStackTrace();
}
}
monitor.worked(1);
break;
case TreeObject.VIEW:
monitor.subTask("String_Node_Str");
subItems=item.getItems();
for (String subItem : subItems) {
try {
reader=new FileReader(importFolder + "String_Node_Str" + subItem);
}
 catch (FileNotFoundException e2) {
e2.printStackTrace();
}
WSView model=new WSView();
try {
model=(WSView)Unmarshaller.unmarshal(WSView.class,reader);
}
 catch (MarshalException e1) {
e1.printStackTrace();
}
catch (ValidationException e1) {
e1.printStackTrace();
}
for (WSWhereCondition ws : model.getWhereConditions()) {
if (ws.getOperator() == null) ws.setOperator(WSWhereOperator.CONTAINS);
if (ws.getStringPredicate() == null) ws.setStringPredicate(WSStringPredicate.NONE);
}
try {
port.putView(new WSPutView(model));
}
 catch (RemoteException e) {
e.printStackTrace();
}
}
monitor.worked(1);
break;
}
}
monitor.done();
}

Fixed version (ground truth):
public void doImport(TreeObject[] objs,IProgressMonitor monitor){
  monitor.beginTask("String_Node_Str",IProgressMonitor.UNKNOWN);
  XtentisPort port=null;
  try {
    port=Util.getPort((TreeObject)sel.getFirstElement());
  }
 catch (  XtentisException e3) {
    e3.printStackTrace();
  }
  Reader reader=null;
  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) {
    try {
      reader=new FileReader(importFolder + "String_Node_Str" + subItem);
    }
 catch (    FileNotFoundException e1) {
      e1.printStackTrace();
    }
    WSDataCluster model=new WSDataCluster();
    try {
      model=(WSDataCluster)Unmarshaller.unmarshal(WSDataCluster.class,reader);
    }
 catch (    MarshalException e1) {
      e1.printStackTrace();
    }
catch (    ValidationException e1) {
      e1.printStackTrace();
    }
    try {
      port.putDataCluster(new WSPutDataCluster(model));
    }
 catch (    RemoteException e) {
      e.printStackTrace();
    }
    importClusterContents(item,port);
  }
break;
case TreeObject.DATA_CLUSTER_CONTENTS:
subItems=item.getItems();
for (String subItem : subItems) {
try {
reader=new FileReader(importFolder + "String_Node_Str" + subItem);
}
 catch (FileNotFoundException e2) {
e2.printStackTrace();
}
WSItem wsItem=new WSItem();
try {
wsItem=(WSItem)Unmarshaller.unmarshal(WSItem.class,reader);
}
 catch (MarshalException e1) {
e1.printStackTrace();
}
catch (ValidationException e1) {
e1.printStackTrace();
}
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) {
try {
reader=new FileReader(importFolder + "String_Node_Str" + subItem);
}
 catch (FileNotFoundException e2) {
e2.printStackTrace();
}
WSDataModel model=new WSDataModel();
try {
model=(WSDataModel)Unmarshaller.unmarshal(WSDataModel.class,reader);
}
 catch (MarshalException e1) {
e1.printStackTrace();
}
catch (ValidationException e1) {
e1.printStackTrace();
}
try {
port.putDataModel(new WSPutDataModel(model));
}
 catch (RemoteException e) {
e.printStackTrace();
}
}
monitor.worked(1);
break;
case TreeObject.MENU:
monitor.subTask("String_Node_Str");
subItems=item.getItems();
for (String subItem : subItems) {
try {
reader=new FileReader(importFolder + "String_Node_Str" + subItem);
}
 catch (FileNotFoundException e2) {
e2.printStackTrace();
}
WSMenu memu=new WSMenu();
try {
memu=(WSMenu)Unmarshaller.unmarshal(WSMenu.class,reader);
}
 catch (MarshalException e1) {
e1.printStackTrace();
}
catch (ValidationException e1) {
e1.printStackTrace();
}
try {
port.putMenu(new WSPutMenu(memu));
}
 catch (RemoteException e) {
e.printStackTrace();
}
}
monitor.worked(1);
break;
case TreeObject.ROLE:
monitor.subTask("String_Node_Str");
subItems=item.getItems();
for (String subItem : subItems) {
try {
reader=new FileReader(importFolder + "String_Node_Str" + subItem);
}
 catch (FileNotFoundException e2) {
e2.printStackTrace();
}
WSRole role=new WSRole();
try {
role=(WSRole)Unmarshaller.unmarshal(WSRole.class,reader);
}
 catch (MarshalException e1) {
e1.printStackTrace();
}
catch (ValidationException e1) {
e1.printStackTrace();
}
try {
port.putRole(new WSPutRole(role));
}
 catch (RemoteException e) {
e.printStackTrace();
}
}
monitor.worked(1);
break;
case TreeObject.ROUTING_RULE:
monitor.subTask("String_Node_Str");
subItems=item.getItems();
for (String subItem : subItems) {
try {
reader=new FileReader(importFolder + "String_Node_Str" + subItem);
}
 catch (FileNotFoundException e2) {
e2.printStackTrace();
}
WSRoutingRule routingRule=new WSRoutingRule();
try {
routingRule=(WSRoutingRule)Unmarshaller.unmarshal(WSRoutingRule.class,reader);
}
 catch (MarshalException e1) {
e1.printStackTrace();
}
catch (ValidationException e1) {
e1.printStackTrace();
}
if (routingRule.getWsRoutingRuleExpressions() != null) for (WSRoutingRuleExpression rule : routingRule.getWsRoutingRuleExpressions()) {
if (rule.getWsOperator() == null) rule.setWsOperator(WSRoutingRuleOperator.CONTAINS);
}
try {
port.putRoutingRule(new WSPutRoutingRule(routingRule));
}
 catch (RemoteException e) {
e.printStackTrace();
}
}
monitor.worked(1);
break;
case TreeObject.STORED_PROCEDURE:
monitor.subTask("String_Node_Str");
subItems=item.getItems();
for (String subItem : subItems) {
try {
reader=new FileReader(importFolder + "String_Node_Str" + subItem);
}
 catch (FileNotFoundException e2) {
e2.printStackTrace();
}
WSStoredProcedure model=new WSStoredProcedure();
try {
model=(WSStoredProcedure)Unmarshaller.unmarshal(WSStoredProcedure.class,reader);
}
 catch (MarshalException e1) {
e1.printStackTrace();
}
catch (ValidationException e1) {
e1.printStackTrace();
}
try {
port.putStoredProcedure(new WSPutStoredProcedure(model));
}
 catch (RemoteException e) {
e.printStackTrace();
}
}
monitor.worked(1);
break;
case TreeObject.SYNCHRONIZATIONPLAN:
monitor.subTask("String_Node_Str");
subItems=item.getItems();
for (String subItem : subItems) {
try {
reader=new FileReader(importFolder + "String_Node_Str" + subItem);
}
 catch (FileNotFoundException e2) {
e2.printStackTrace();
}
WSSynchronizationPlan model=new WSSynchronizationPlan();
try {
model=(WSSynchronizationPlan)Unmarshaller.unmarshal(WSSynchronizationPlan.class,reader);
}
 catch (MarshalException e1) {
e1.printStackTrace();
}
catch (ValidationException e1) {
e1.printStackTrace();
}
try {
port.putSynchronizationPlan(new WSPutSynchronizationPlan(model));
}
 catch (RemoteException e) {
e.printStackTrace();
}
}
monitor.worked(1);
break;
case TreeObject.TRANSFORMER:
monitor.subTask("String_Node_Str");
subItems=item.getItems();
for (String subItem : subItems) {
try {
reader=new FileReader(importFolder + "String_Node_Str" + subItem);
}
 catch (FileNotFoundException e2) {
e2.printStackTrace();
}
WSTransformer model=new WSTransformer();
try {
model=(WSTransformer)Unmarshaller.unmarshal(WSTransformer.class,reader);
}
 catch (MarshalException e1) {
e1.printStackTrace();
}
catch (ValidationException e1) {
e1.printStackTrace();
}
try {
port.putTransformer(new WSPutTransformer(model));
}
 catch (RemoteException e) {
e.printStackTrace();
}
}
monitor.worked(1);
break;
case TreeObject.UNIVERSE:
monitor.subTask("String_Node_Str");
subItems=item.getItems();
for (String subItem : subItems) {
try {
reader=new FileReader(importFolder + "String_Node_Str" + subItem);
}
 catch (FileNotFoundException e2) {
e2.printStackTrace();
}
WSUniverse model=new WSUniverse();
try {
model=(WSUniverse)Unmarshaller.unmarshal(WSUniverse.class,reader);
}
 catch (MarshalException e1) {
e1.printStackTrace();
}
catch (ValidationException e1) {
e1.printStackTrace();
}
try {
port.putUniverse(new WSPutUniverse(model));
}
 catch (RemoteException e) {
e.printStackTrace();
}
}
monitor.worked(1);
break;
case TreeObject.VIEW:
monitor.subTask("String_Node_Str");
subItems=item.getItems();
for (String subItem : subItems) {
try {
reader=new FileReader(importFolder + "String_Node_Str" + subItem);
}
 catch (FileNotFoundException e2) {
e2.printStackTrace();
}
WSView model=new WSView();
try {
model=(WSView)Unmarshaller.unmarshal(WSView.class,reader);
}
 catch (MarshalException e1) {
e1.printStackTrace();
}
catch (ValidationException e1) {
e1.printStackTrace();
}
if (model.getWhereConditions() != null) {
for (WSWhereCondition ws : model.getWhereConditions()) {
if (ws.getOperator() == null) ws.setOperator(WSWhereOperator.CONTAINS);
if (ws.getStringPredicate() == null) ws.setStringPredicate(WSStringPredicate.NONE);
}
}
try {
port.putView(new WSPutView(model));
}
 catch (RemoteException e) {
e.printStackTrace();
}
}
monitor.worked(1);
break;
}
}
monitor.done();
}