Program: 148536
Project: 148536
Buggy source:
public void doImport(TreeObject[] objs,IProgressMonitor monitor){
  monitor.beginTask("String_Node_Str",IProgressMonitor.UNKNOWN);
  Reader reader=null;
  Arrays.sort(objs,new Comparator<Object>(){
    public int compare(    Object o1,    Object o2){
      return ((TreeObject)o1).getType() - ((TreeObject)o2).getType();
    }
  }
);
  LocalTreeObjectRepository.getInstance().mergeImportCategory(objs,serverRoot);
  boolean isOverrideAll=false;
  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 InputStreamReader(new FileInputStream(importFolder + "String_Node_Str" + subItem),"String_Node_Str");
      WSDataCluster model=new WSDataCluster();
      model=(WSDataCluster)Unmarshaller.unmarshal(WSDataCluster.class,reader);
      if (port.existsDataCluster(new WSExistsDataCluster(new WSDataClusterPK(model.getName()))).is_true()) {
        if (!isOverrideAll) {
          int result=isOveride(model.getName(),TreeObject.DATACONTAINER);
          if (result == IDialogConstants.CANCEL_ID) {
            return;
          }
          if (result == IDialogConstants.YES_TO_ALL_ID) {
            isOverrideAll=true;
          }
          if (result == IDialogConstants.NO_ID) {
            break;
          }
        }
      }
      port.putDataCluster(new WSPutDataCluster(model));
    }
 catch (    Exception e1) {
      e1.printStackTrace();
    }
 finally {
      try {
        if (reader != null)         reader.close();
      }
 catch (      Exception e) {
      }
    }
    importClusterContents(item,port);
  }
monitor.worked(1);
break;
case TreeObject.DATA_MODEL:
monitor.subTask("String_Node_Str");
subItems=item.getItems();
for (String subItem : subItems) {
try {
reader=new InputStreamReader(new FileInputStream(importFolder + "String_Node_Str" + subItem),"String_Node_Str");
WSDataModel model=new WSDataModel();
model=(WSDataModel)Unmarshaller.unmarshal(WSDataModel.class,reader);
if (port.existsDataModel(new WSExistsDataModel(new WSDataModelPK(model.getName()))).is_true()) {
if (!isOverrideAll) {
int result=isOveride(model.getName(),TreeObject.DATAMODEL_);
if (result == IDialogConstants.CANCEL_ID) {
  return;
}
if (result == IDialogConstants.YES_TO_ALL_ID) {
  isOverrideAll=true;
}
if (result == IDialogConstants.NO_ID) {
  break;
}
}
}
port.putDataModel(new WSPutDataModel(model));
}
 catch (Exception e2) {
e2.printStackTrace();
}
 finally {
try {
if (reader != null) reader.close();
}
 catch (Exception e) {
}
}
}
monitor.worked(1);
break;
case TreeObject.MENU:
monitor.subTask("String_Node_Str");
subItems=item.getItems();
for (String subItem : subItems) {
try {
reader=new InputStreamReader(new FileInputStream(importFolder + "String_Node_Str" + subItem),"String_Node_Str");
WSMenu memu=new WSMenu();
memu=(WSMenu)Unmarshaller.unmarshal(WSMenu.class,reader);
if (port.existsMenu(new WSExistsMenu(new WSMenuPK(memu.getName()))).is_true()) {
if (!isOverrideAll) {
int result=isOveride(memu.getName(),TreeObject.MENU_);
if (result == IDialogConstants.CANCEL_ID) {
return;
}
if (result == IDialogConstants.YES_TO_ALL_ID) {
isOverrideAll=true;
}
if (result == IDialogConstants.NO_ID) {
break;
}
}
}
port.putMenu(new WSPutMenu(memu));
}
 catch (Exception e2) {
e2.printStackTrace();
}
 finally {
try {
if (reader != null) reader.close();
}
 catch (Exception e) {
}
}
}
monitor.worked(1);
break;
case TreeObject.ROLE:
if (Util.IsEnterPrise()) {
monitor.subTask("String_Node_Str");
subItems=item.getItems();
for (String subItem : subItems) {
try {
reader=new InputStreamReader(new FileInputStream(importFolder + "String_Node_Str" + subItem),"String_Node_Str");
WSRole role=new WSRole();
role=(WSRole)Unmarshaller.unmarshal(WSRole.class,reader);
if (port.existsRole(new WSExistsRole(new WSRolePK(role.getName()))).is_true()) {
if (!isOverrideAll) {
int result=isOveride(role.getName(),TreeObject.ROLE_);
if (result == IDialogConstants.CANCEL_ID) {
return;
}
if (result == IDialogConstants.YES_TO_ALL_ID) {
isOverrideAll=true;
}
if (result == IDialogConstants.NO_ID) {
break;
}
}
}
port.putRole(new WSPutRole(role));
}
 catch (Exception e2) {
e2.printStackTrace();
}
 finally {
try {
if (reader != null) reader.close();
}
 catch (Exception e) {
}
}
}
monitor.worked(1);
}
break;
case TreeObject.ROUTING_RULE:
monitor.subTask("String_Node_Str");
subItems=item.getItems();
for (String subItem : subItems) {
try {
reader=new InputStreamReader(new FileInputStream(importFolder + "String_Node_Str" + subItem),"String_Node_Str");
WSRoutingRule routingRule=new 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);
}
}
if (port.existsRoutingRule(new WSExistsRoutingRule(new WSRoutingRulePK(routingRule.getName()))).is_true()) {
if (!isOverrideAll) {
int result=isOveride(routingRule.getName(),TreeObject.ROUTINGRULE_);
if (result == IDialogConstants.CANCEL_ID) {
return;
}
if (result == IDialogConstants.YES_TO_ALL_ID) {
isOverrideAll=true;
}
if (result == IDialogConstants.NO_ID) {
break;
}
}
}
port.putRoutingRule(new WSPutRoutingRule(routingRule));
}
 catch (Exception e2) {
e2.printStackTrace();
}
 finally {
try {
if (reader != null) reader.close();
}
 catch (Exception e) {
}
}
}
monitor.worked(1);
break;
case TreeObject.STORED_PROCEDURE:
monitor.subTask("String_Node_Str");
subItems=item.getItems();
for (String subItem : subItems) {
try {
reader=new InputStreamReader(new FileInputStream(importFolder + "String_Node_Str" + subItem),"String_Node_Str");
WSStoredProcedure model=new WSStoredProcedure();
model=(WSStoredProcedure)Unmarshaller.unmarshal(WSStoredProcedure.class,reader);
if (model.getRefreshCache() == null) model.setRefreshCache(false);
if (port.existsStoredProcedure(new WSExistsStoredProcedure(new WSStoredProcedurePK(model.getName()))).is_true()) {
if (!isOverrideAll) {
int result=isOveride(model.getName(),TreeObject.STOREDPROCEDURE_);
if (result == IDialogConstants.CANCEL_ID) {
return;
}
if (result == IDialogConstants.YES_TO_ALL_ID) {
isOverrideAll=true;
}
if (result == IDialogConstants.NO_ID) {
break;
}
}
}
port.putStoredProcedure(new WSPutStoredProcedure(model));
}
 catch (Exception e2) {
e2.printStackTrace();
}
 finally {
try {
if (reader != null) reader.close();
}
 catch (Exception e) {
}
}
}
monitor.worked(1);
break;
case TreeObject.SYNCHRONIZATIONPLAN:
if (Util.IsEnterPrise()) {
monitor.subTask("String_Node_Str");
subItems=item.getItems();
for (String subItem : subItems) {
try {
reader=new InputStreamReader(new FileInputStream(importFolder + "String_Node_Str" + subItem),"String_Node_Str");
WSSynchronizationPlan model=new WSSynchronizationPlan();
model=(WSSynchronizationPlan)Unmarshaller.unmarshal(WSSynchronizationPlan.class,reader);
if (port.existsSynchronizationPlan(new WSExistsSynchronizationPlan(new WSSynchronizationPlanPK(model.getName()))).is_true()) {
if (!isOverrideAll) {
int result=isOveride(model.getName(),TreeObject.SYNCHRONIZATIONPLAN_);
if (result == IDialogConstants.CANCEL_ID) {
return;
}
if (result == IDialogConstants.YES_TO_ALL_ID) {
isOverrideAll=true;
}
if (result == IDialogConstants.NO_ID) {
break;
}
}
}
port.putSynchronizationPlan(new WSPutSynchronizationPlan(model));
}
 catch (Exception e2) {
e2.printStackTrace();
}
 finally {
try {
if (reader != null) reader.close();
}
 catch (Exception e) {
}
}
}
monitor.worked(1);
}
break;
case TreeObject.PICTURES_RESOURCE:
subItems=item.getItems();
for (String subItem : subItems) {
try {
Util.uploadImageFile(serverRoot.getEndpointIpAddress() + "String_Node_Str",importFolder + "String_Node_Str" + subItem,serverRoot.getUsername(),serverRoot.getPassword());
}
 catch (Exception e2) {
e2.printStackTrace();
}
}
break;
case TreeObject.WORKFLOW_PROCESS:
monitor.subTask("String_Node_Str");
java.util.List<IAvailableModel> availablemodels=AvailableModelUtil.getAvailableModels();
for (IAvailableModel model : availablemodels) {
if (model.toString().indexOf("String_Node_Str") != -1) {
model.doImport(item,importFolder);
}
}
monitor.worked(1);
break;
case TreeObject.TRANSFORMER:
monitor.subTask("String_Node_Str");
subItems=item.getItems();
for (String subItem : subItems) {
try {
reader=new InputStreamReader(new FileInputStream(importFolder + "String_Node_Str" + subItem),"String_Node_Str");
WSTransformer model=new WSTransformer();
model=(WSTransformer)Unmarshaller.unmarshal(WSTransformer.class,reader);
if (port.existsTransformer(new WSExistsTransformer(new WSTransformerPK(model.getName()))).is_true()) {
if (!isOverrideAll) {
int result=isOveride(model.getName(),TreeObject.TRANSFORMER_);
if (result == IDialogConstants.CANCEL_ID) {
return;
}
if (result == IDialogConstants.YES_TO_ALL_ID) {
isOverrideAll=true;
}
if (result == IDialogConstants.NO_ID) {
break;
}
}
}
port.putTransformer(new WSPutTransformer(model));
}
 catch (Exception e2) {
e2.printStackTrace();
}
 finally {
try {
if (reader != null) reader.close();
}
 catch (Exception e) {
}
}
}
monitor.worked(1);
break;
case TreeObject.UNIVERSE:
if (Util.IsEnterPrise()) {
monitor.subTask("String_Node_Str");
subItems=item.getItems();
for (String subItem : subItems) {
try {
reader=new InputStreamReader(new FileInputStream(importFolder + "String_Node_Str" + subItem),"String_Node_Str");
WSUniverse model=new WSUniverse();
model=(WSUniverse)Unmarshaller.unmarshal(WSUniverse.class,reader);
if (port.existsUniverse(new WSExistsUniverse(new WSUniversePK(model.getName()))).is_true()) {
if (!isOverrideAll) {
int result=isOveride(model.getName(),TreeObject.UNIVERSE_);
if (result == IDialogConstants.CANCEL_ID) {
return;
}
if (result == IDialogConstants.YES_TO_ALL_ID) {
isOverrideAll=true;
}
if (result == IDialogConstants.NO_ID) {
break;
}
}
}
port.putUniverse(new WSPutUniverse(model));
}
 catch (Exception e2) {
e2.printStackTrace();
}
 finally {
try {
if (reader != null) reader.close();
}
 catch (Exception e) {
}
}
}
monitor.worked(1);
}
break;
case TreeObject.VIEW:
monitor.subTask("String_Node_Str");
subItems=item.getItems();
for (String subItem : subItems) {
try {
reader=new InputStreamReader(new FileInputStream(importFolder + "String_Node_Str" + subItem),"String_Node_Str");
WSView model=new WSView();
model=(WSView)Unmarshaller.unmarshal(WSView.class,reader);
if (model.getIsTransformerActive() == null) model.setIsTransformerActive(new WSBoolean(false));
if (model.getTransformerPK() == null) model.setTransformerPK("String_Node_Str");
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);
}
}
}
if (port.existsView(new WSExistsView(new WSViewPK(model.getName()))).is_true()) {
if (!isOverrideAll) {
int result=isOveride(model.getName(),TreeObject.VIEW_);
if (result == IDialogConstants.CANCEL_ID) {
return;
}
if (result == IDialogConstants.YES_TO_ALL_ID) {
isOverrideAll=true;
}
if (result == IDialogConstants.NO_ID) {
break;
}
}
}
port.putView(new WSPutView(model));
}
 catch (Exception e2) {
e2.printStackTrace();
}
 finally {
try {
if (reader != null) reader.close();
}
 catch (Exception e) {
}
}
}
monitor.worked(1);
break;
}
}
monitor.done();
}

Fixed version (ground truth):
public void doImport(TreeObject[] objs,IProgressMonitor monitor){
  monitor.beginTask("String_Node_Str",IProgressMonitor.UNKNOWN);
  Reader reader=null;
  Arrays.sort(objs,new Comparator<Object>(){
    public int compare(    Object o1,    Object o2){
      return ((TreeObject)o1).getType() - ((TreeObject)o2).getType();
    }
  }
);
  LocalTreeObjectRepository.getInstance().mergeImportCategory(objs,serverRoot);
  boolean isOverrideAll=false;
  HashMap<String,String> picturePathMap=new HashMap<String,String>();
  String[] subItems;
  for (  TreeObject item : objs) {
    if (item.getType() == TreeObject.PICTURES_RESOURCE) {
      subItems=item.getItems();
      for (      String subItem : subItems) {
        try {
          Util.uploadImageFile(serverRoot.getEndpointIpAddress() + "String_Node_Str",importFolder + "String_Node_Str" + subItem,serverRoot.getUsername(),serverRoot.getPassword(),picturePathMap);
        }
 catch (        Exception e2) {
          e2.printStackTrace();
        }
      }
    }
  }
  for (  TreeObject item : objs) {
switch (item.getType()) {
case TreeObject.DATA_CLUSTER:
      monitor.subTask("String_Node_Str");
    subItems=item.getItems();
  for (  String subItem : subItems) {
    try {
      reader=new InputStreamReader(new FileInputStream(importFolder + "String_Node_Str" + subItem),"String_Node_Str");
      WSDataCluster model=new WSDataCluster();
      model=(WSDataCluster)Unmarshaller.unmarshal(WSDataCluster.class,reader);
      if (port.existsDataCluster(new WSExistsDataCluster(new WSDataClusterPK(model.getName()))).is_true()) {
        if (!isOverrideAll) {
          int result=isOveride(model.getName(),TreeObject.DATACONTAINER);
          if (result == IDialogConstants.CANCEL_ID) {
            return;
          }
          if (result == IDialogConstants.YES_TO_ALL_ID) {
            isOverrideAll=true;
          }
          if (result == IDialogConstants.NO_ID) {
            break;
          }
        }
      }
      port.putDataCluster(new WSPutDataCluster(model));
    }
 catch (    Exception e1) {
      e1.printStackTrace();
    }
 finally {
      try {
        if (reader != null)         reader.close();
      }
 catch (      Exception e) {
      }
    }
    importClusterContents(item,port,picturePathMap);
  }
monitor.worked(1);
break;
case TreeObject.DATA_MODEL:
monitor.subTask("String_Node_Str");
subItems=item.getItems();
for (String subItem : subItems) {
try {
reader=new InputStreamReader(new FileInputStream(importFolder + "String_Node_Str" + subItem),"String_Node_Str");
WSDataModel model=new WSDataModel();
model=(WSDataModel)Unmarshaller.unmarshal(WSDataModel.class,reader);
if (port.existsDataModel(new WSExistsDataModel(new WSDataModelPK(model.getName()))).is_true()) {
if (!isOverrideAll) {
int result=isOveride(model.getName(),TreeObject.DATAMODEL_);
if (result == IDialogConstants.CANCEL_ID) {
  return;
}
if (result == IDialogConstants.YES_TO_ALL_ID) {
  isOverrideAll=true;
}
if (result == IDialogConstants.NO_ID) {
  break;
}
}
}
port.putDataModel(new WSPutDataModel(model));
}
 catch (Exception e2) {
e2.printStackTrace();
}
 finally {
try {
if (reader != null) reader.close();
}
 catch (Exception e) {
}
}
}
monitor.worked(1);
break;
case TreeObject.MENU:
monitor.subTask("String_Node_Str");
subItems=item.getItems();
for (String subItem : subItems) {
try {
reader=new InputStreamReader(new FileInputStream(importFolder + "String_Node_Str" + subItem),"String_Node_Str");
WSMenu memu=new WSMenu();
memu=(WSMenu)Unmarshaller.unmarshal(WSMenu.class,reader);
if (port.existsMenu(new WSExistsMenu(new WSMenuPK(memu.getName()))).is_true()) {
if (!isOverrideAll) {
int result=isOveride(memu.getName(),TreeObject.MENU_);
if (result == IDialogConstants.CANCEL_ID) {
return;
}
if (result == IDialogConstants.YES_TO_ALL_ID) {
isOverrideAll=true;
}
if (result == IDialogConstants.NO_ID) {
break;
}
}
}
port.putMenu(new WSPutMenu(memu));
}
 catch (Exception e2) {
e2.printStackTrace();
}
 finally {
try {
if (reader != null) reader.close();
}
 catch (Exception e) {
}
}
}
monitor.worked(1);
break;
case TreeObject.ROLE:
if (Util.IsEnterPrise()) {
monitor.subTask("String_Node_Str");
subItems=item.getItems();
for (String subItem : subItems) {
try {
reader=new InputStreamReader(new FileInputStream(importFolder + "String_Node_Str" + subItem),"String_Node_Str");
WSRole role=new WSRole();
role=(WSRole)Unmarshaller.unmarshal(WSRole.class,reader);
if (port.existsRole(new WSExistsRole(new WSRolePK(role.getName()))).is_true()) {
if (!isOverrideAll) {
int result=isOveride(role.getName(),TreeObject.ROLE_);
if (result == IDialogConstants.CANCEL_ID) {
return;
}
if (result == IDialogConstants.YES_TO_ALL_ID) {
isOverrideAll=true;
}
if (result == IDialogConstants.NO_ID) {
break;
}
}
}
port.putRole(new WSPutRole(role));
}
 catch (Exception e2) {
e2.printStackTrace();
}
 finally {
try {
if (reader != null) reader.close();
}
 catch (Exception e) {
}
}
}
monitor.worked(1);
}
break;
case TreeObject.ROUTING_RULE:
monitor.subTask("String_Node_Str");
subItems=item.getItems();
for (String subItem : subItems) {
try {
reader=new InputStreamReader(new FileInputStream(importFolder + "String_Node_Str" + subItem),"String_Node_Str");
WSRoutingRule routingRule=new 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);
}
}
if (port.existsRoutingRule(new WSExistsRoutingRule(new WSRoutingRulePK(routingRule.getName()))).is_true()) {
if (!isOverrideAll) {
int result=isOveride(routingRule.getName(),TreeObject.ROUTINGRULE_);
if (result == IDialogConstants.CANCEL_ID) {
return;
}
if (result == IDialogConstants.YES_TO_ALL_ID) {
isOverrideAll=true;
}
if (result == IDialogConstants.NO_ID) {
break;
}
}
}
port.putRoutingRule(new WSPutRoutingRule(routingRule));
}
 catch (Exception e2) {
e2.printStackTrace();
}
 finally {
try {
if (reader != null) reader.close();
}
 catch (Exception e) {
}
}
}
monitor.worked(1);
break;
case TreeObject.STORED_PROCEDURE:
monitor.subTask("String_Node_Str");
subItems=item.getItems();
for (String subItem : subItems) {
try {
reader=new InputStreamReader(new FileInputStream(importFolder + "String_Node_Str" + subItem),"String_Node_Str");
WSStoredProcedure model=new WSStoredProcedure();
model=(WSStoredProcedure)Unmarshaller.unmarshal(WSStoredProcedure.class,reader);
if (model.getRefreshCache() == null) model.setRefreshCache(false);
if (port.existsStoredProcedure(new WSExistsStoredProcedure(new WSStoredProcedurePK(model.getName()))).is_true()) {
if (!isOverrideAll) {
int result=isOveride(model.getName(),TreeObject.STOREDPROCEDURE_);
if (result == IDialogConstants.CANCEL_ID) {
return;
}
if (result == IDialogConstants.YES_TO_ALL_ID) {
isOverrideAll=true;
}
if (result == IDialogConstants.NO_ID) {
break;
}
}
}
port.putStoredProcedure(new WSPutStoredProcedure(model));
}
 catch (Exception e2) {
e2.printStackTrace();
}
 finally {
try {
if (reader != null) reader.close();
}
 catch (Exception e) {
}
}
}
monitor.worked(1);
break;
case TreeObject.SYNCHRONIZATIONPLAN:
if (Util.IsEnterPrise()) {
monitor.subTask("String_Node_Str");
subItems=item.getItems();
for (String subItem : subItems) {
try {
reader=new InputStreamReader(new FileInputStream(importFolder + "String_Node_Str" + subItem),"String_Node_Str");
WSSynchronizationPlan model=new WSSynchronizationPlan();
model=(WSSynchronizationPlan)Unmarshaller.unmarshal(WSSynchronizationPlan.class,reader);
if (port.existsSynchronizationPlan(new WSExistsSynchronizationPlan(new WSSynchronizationPlanPK(model.getName()))).is_true()) {
if (!isOverrideAll) {
int result=isOveride(model.getName(),TreeObject.SYNCHRONIZATIONPLAN_);
if (result == IDialogConstants.CANCEL_ID) {
return;
}
if (result == IDialogConstants.YES_TO_ALL_ID) {
isOverrideAll=true;
}
if (result == IDialogConstants.NO_ID) {
break;
}
}
}
port.putSynchronizationPlan(new WSPutSynchronizationPlan(model));
}
 catch (Exception e2) {
e2.printStackTrace();
}
 finally {
try {
if (reader != null) reader.close();
}
 catch (Exception e) {
}
}
}
monitor.worked(1);
}
break;
case TreeObject.WORKFLOW_PROCESS:
monitor.subTask("String_Node_Str");
java.util.List<IAvailableModel> availablemodels=AvailableModelUtil.getAvailableModels();
for (IAvailableModel model : availablemodels) {
if (model.toString().indexOf("String_Node_Str") != -1) {
model.doImport(item,importFolder);
}
}
monitor.worked(1);
break;
case TreeObject.TRANSFORMER:
monitor.subTask("String_Node_Str");
subItems=item.getItems();
for (String subItem : subItems) {
try {
reader=new InputStreamReader(new FileInputStream(importFolder + "String_Node_Str" + subItem),"String_Node_Str");
WSTransformer model=new WSTransformer();
model=(WSTransformer)Unmarshaller.unmarshal(WSTransformer.class,reader);
if (port.existsTransformer(new WSExistsTransformer(new WSTransformerPK(model.getName()))).is_true()) {
if (!isOverrideAll) {
int result=isOveride(model.getName(),TreeObject.TRANSFORMER_);
if (result == IDialogConstants.CANCEL_ID) {
return;
}
if (result == IDialogConstants.YES_TO_ALL_ID) {
isOverrideAll=true;
}
if (result == IDialogConstants.NO_ID) {
break;
}
}
}
port.putTransformer(new WSPutTransformer(model));
}
 catch (Exception e2) {
e2.printStackTrace();
}
 finally {
try {
if (reader != null) reader.close();
}
 catch (Exception e) {
}
}
}
monitor.worked(1);
break;
case TreeObject.UNIVERSE:
if (Util.IsEnterPrise()) {
monitor.subTask("String_Node_Str");
subItems=item.getItems();
for (String subItem : subItems) {
try {
reader=new InputStreamReader(new FileInputStream(importFolder + "String_Node_Str" + subItem),"String_Node_Str");
WSUniverse model=new WSUniverse();
model=(WSUniverse)Unmarshaller.unmarshal(WSUniverse.class,reader);
if (port.existsUniverse(new WSExistsUniverse(new WSUniversePK(model.getName()))).is_true()) {
if (!isOverrideAll) {
int result=isOveride(model.getName(),TreeObject.UNIVERSE_);
if (result == IDialogConstants.CANCEL_ID) {
return;
}
if (result == IDialogConstants.YES_TO_ALL_ID) {
isOverrideAll=true;
}
if (result == IDialogConstants.NO_ID) {
break;
}
}
}
port.putUniverse(new WSPutUniverse(model));
}
 catch (Exception e2) {
e2.printStackTrace();
}
 finally {
try {
if (reader != null) reader.close();
}
 catch (Exception e) {
}
}
}
monitor.worked(1);
}
break;
case TreeObject.VIEW:
monitor.subTask("String_Node_Str");
subItems=item.getItems();
for (String subItem : subItems) {
try {
reader=new InputStreamReader(new FileInputStream(importFolder + "String_Node_Str" + subItem),"String_Node_Str");
WSView model=new WSView();
model=(WSView)Unmarshaller.unmarshal(WSView.class,reader);
if (model.getIsTransformerActive() == null) model.setIsTransformerActive(new WSBoolean(false));
if (model.getTransformerPK() == null) model.setTransformerPK("String_Node_Str");
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);
}
}
}
if (port.existsView(new WSExistsView(new WSViewPK(model.getName()))).is_true()) {
if (!isOverrideAll) {
int result=isOveride(model.getName(),TreeObject.VIEW_);
if (result == IDialogConstants.CANCEL_ID) {
return;
}
if (result == IDialogConstants.YES_TO_ALL_ID) {
isOverrideAll=true;
}
if (result == IDialogConstants.NO_ID) {
break;
}
}
}
port.putView(new WSPutView(model));
}
 catch (Exception e2) {
e2.printStackTrace();
}
 finally {
try {
if (reader != null) reader.close();
}
 catch (Exception e) {
}
}
}
monitor.worked(1);
break;
}
}
monitor.done();
}