Program: 148380
Project: 148380
Buggy source:
public void run(){
  TreeObject selected=(TreeObject)((IStructuredSelection)view.getViewer().getSelection()).getFirstElement();
  Map<TreeObject,Object> keyTrackMap=new HashMap<TreeObject,Object>();
  try {
    super.run();
    if (this.view == null) {
      MessageDialog.openError(view.getSite().getShell(),"String_Node_Str","String_Node_Str");
      return;
    }
    if (destPort == null) {
      destPort=Util.getPort(new URL(selected.getEndpointAddress()),selected.getUniverse(),selected.getUsername(),selected.getPassword());
    }
    ArrayList<TreeObject> list=WorkbenchClipboard.getWorkbenchClipboard().get();
    while (true) {
      for (Iterator<TreeObject> iter=list.iterator(); iter.hasNext(); ) {
        TreeObject xobject=iter.next();
        Object latestValue=keyTrackMap.get(xobject);
switch (xobject.getType()) {
case TreeObject.DATA_MODEL:
{
            WSDataModelPK key=(WSDataModelPK)xobject.getWsKey();
            WSDataModelPK newKey=latestValue != null ? (WSDataModelPK)latestValue : new WSDataModelPK(key.getPk());
            if (destPort.existsDataModel(new WSExistsDataModel(latestValue != null ? (WSDataModelPK)latestValue : (WSDataModelPK)xobject.getWsKey())).is_true()) {
              InputDialog id=new InputDialog(view.getSite().getShell(),"String_Node_Str" + key.getPk(),"String_Node_Str" + (latestValue != null ? newKey.getPk() : key.getPk()) + "String_Node_Str","String_Node_Str" + (selected.getEndpointAddress().equals(xobject.getEndpointAddress()) ? "String_Node_Str" : xobject.getEndpointAddress().split("String_Node_Str")[0] + "String_Node_Str") + key.getPk(),new IInputValidator(){
                public String isValid(                String newText){
                  if ((newText == null) || "String_Node_Str".equals(newText))                   return "String_Node_Str";
                  return null;
                }
              }
);
              id.setBlockOnOpen(true);
              if (id.open() == Window.CANCEL) {
                list.remove(xobject);
                iter=list.iterator();
                break;
              }
              newKey=new WSDataModelPK(id.getValue());
              keyTrackMap.put(xobject,newKey);
              break;
            }
            XtentisPort originalPort=Util.getPort(new URL(xobject.getEndpointAddress()),xobject.getUniverse(),xobject.getUsername(),xobject.getPassword());
            WSDataModel originalDataModel=originalPort.getDataModel(new WSGetDataModel(key));
            WSDataModel newDataModel=new WSDataModel(newKey.getPk(),originalDataModel.getDescription(),originalDataModel.getXsdSchema());
            destPort.putDataModel(new WSPutDataModel(newDataModel));
            TreeObject newObj=new TreeObject(newKey.getPk(),parent != null ? parent.getServerRoot() : selected.getServerRoot(),xobject.getType(),newKey,null);
            newTreeObject(newObj,selected);
            list.remove(xobject);
            iter=list.iterator();
          }
        break;
case TreeObject.VIEW:
{
        WSViewPK key=(WSViewPK)xobject.getWsKey();
        WSViewPK newKey=latestValue != null ? (WSViewPK)latestValue : new WSViewPK(key.getPk());
        if (destPort.existsView(new WSExistsView(latestValue != null ? (WSViewPK)latestValue : (WSViewPK)xobject.getWsKey())).is_true()) {
          InputDialog id=new InputDialog(view.getSite().getShell(),"String_Node_Str" + key.getPk(),"String_Node_Str" + (latestValue != null ? newKey.getPk() : key.getPk()) + "String_Node_Str","String_Node_Str" + (selected.getEndpointAddress().equals(xobject.getEndpointAddress()) ? "String_Node_Str" : xobject.getEndpointAddress().split("String_Node_Str")[0] + "String_Node_Str") + key.getPk(),new IInputValidator(){
            public String isValid(            String newText){
              if ((newText == null) || "String_Node_Str".equals(newText))               return "String_Node_Str";
              return null;
            }
          }
);
          id.setBlockOnOpen(true);
          if (id.open() == Window.CANCEL) {
            list.remove(xobject);
            iter=list.iterator();
            break;
          }
          newKey=new WSViewPK(id.getValue());
          keyTrackMap.put(xobject,newKey);
          break;
        }
        XtentisPort originalPort=Util.getPort(new URL(xobject.getEndpointAddress()),xobject.getUniverse(),xobject.getUsername(),xobject.getPassword());
        WSView originalView=originalPort.getView(new WSGetView(key));
        WSView newView=new WSView(newKey.getPk(),originalView.getDescription(),originalView.getViewableBusinessElements(),originalView.getWhereConditions(),originalView.getSearchableBusinessElements(),null,new WSBoolean(false));
        destPort.putView(new WSPutView(newView));
        TreeObject newObj=new TreeObject(newKey.getPk(),parent != null ? parent.getServerRoot() : xobject.getServerRoot(),xobject.getType(),newKey,null);
        newTreeObject(newObj,selected);
        list.remove(xobject);
        iter=list.iterator();
      }
    break;
case TreeObject.DATA_CLUSTER:
{
    WSDataClusterPK key=(WSDataClusterPK)xobject.getWsKey();
    WSDataClusterPK newKey=latestValue != null ? (WSDataClusterPK)latestValue : new WSDataClusterPK(key.getPk());
    if (destPort.existsDataCluster(new WSExistsDataCluster(latestValue != null ? (WSDataClusterPK)latestValue : (WSDataClusterPK)xobject.getWsKey())).is_true()) {
      InputDialog id=new InputDialog(view.getSite().getShell(),"String_Node_Str" + key.getPk(),"String_Node_Str" + (latestValue != null ? newKey.getPk() : key.getPk()) + "String_Node_Str","String_Node_Str" + (selected.getEndpointAddress().equals(xobject.getEndpointAddress()) ? "String_Node_Str" : xobject.getEndpointAddress().split("String_Node_Str")[0] + "String_Node_Str") + key.getPk(),new IInputValidator(){
        public String isValid(        String newText){
          if ((newText == null) || "String_Node_Str".equals(newText))           return "String_Node_Str";
          return null;
        }
      }
);
      id.setBlockOnOpen(true);
      if (id.open() == Window.CANCEL) {
        list.remove(xobject);
        iter=list.iterator();
        break;
      }
      newKey=new WSDataClusterPK(id.getValue());
      keyTrackMap.put(xobject,newKey);
      break;
    }
    XtentisPort originalPort=Util.getPort(new URL(xobject.getEndpointAddress()),xobject.getUniverse(),xobject.getUsername(),xobject.getPassword());
    WSDataCluster originalDataCluster=originalPort.getDataCluster(new WSGetDataCluster(key));
    WSDataCluster newDataCluster=new WSDataCluster(newKey.getPk(),originalDataCluster.getDescription(),originalDataCluster.getVocabulary());
    destPort.putDataCluster(new WSPutDataCluster(newDataCluster));
    TreeObject newObj=new TreeObject(newKey.getPk(),parent != null ? parent.getServerRoot() : xobject.getServerRoot(),xobject.getType(),newKey,null);
    newTreeObject(newObj,selected);
    copyXObjectContent(((WSDataClusterPK)xobject.getWsKey()).getPk(),newKey.getPk(),newObj.getUniverse(),TreeObject.DATA_CLUSTER);
    list.remove(xobject);
    iter=list.iterator();
  }
break;
case TreeObject.STORED_PROCEDURE:
{
WSStoredProcedurePK key=(WSStoredProcedurePK)xobject.getWsKey();
WSStoredProcedurePK newKey=latestValue != null ? (WSStoredProcedurePK)latestValue : new WSStoredProcedurePK(key.getPk());
if (destPort.existsStoredProcedure(new WSExistsStoredProcedure(latestValue != null ? (WSStoredProcedurePK)latestValue : (WSStoredProcedurePK)xobject.getWsKey())).is_true()) {
  InputDialog id=new InputDialog(view.getSite().getShell(),"String_Node_Str" + key.getPk(),"String_Node_Str" + (latestValue != null ? newKey.getPk() : key.getPk()) + "String_Node_Str","String_Node_Str" + (selected.getEndpointAddress().equals(xobject.getEndpointAddress()) ? "String_Node_Str" : xobject.getEndpointAddress().split("String_Node_Str")[0] + "String_Node_Str") + key.getPk(),new IInputValidator(){
    public String isValid(    String newText){
      if ((newText == null) || "String_Node_Str".equals(newText))       return "String_Node_Str";
      return null;
    }
  }
);
  id.setBlockOnOpen(true);
  if (id.open() == Window.CANCEL) {
    list.remove(xobject);
    iter=list.iterator();
    break;
  }
  newKey=new WSStoredProcedurePK(id.getValue());
  keyTrackMap.put(xobject,newKey);
  break;
}
XtentisPort originalPort=Util.getPort(new URL(xobject.getEndpointAddress()),xobject.getUniverse(),xobject.getUsername(),xobject.getPassword());
WSStoredProcedure originalStoredProcedure=originalPort.getStoredProcedure(new WSGetStoredProcedure(key));
WSStoredProcedure newStoredProcedure=new WSStoredProcedure(newKey.getPk(),originalStoredProcedure.getDescription(),originalStoredProcedure.getProcedure(),originalStoredProcedure.getRefreshCache());
destPort.putStoredProcedure(new WSPutStoredProcedure(newStoredProcedure));
TreeObject newObj=new TreeObject(newKey.getPk(),parent != null ? parent.getServerRoot() : xobject.getServerRoot(),xobject.getType(),newKey,null);
newTreeObject(newObj,selected);
list.remove(xobject);
iter=list.iterator();
}
break;
case TreeObject.ROLE:
{
WSRolePK key=(WSRolePK)xobject.getWsKey();
WSRolePK newKey=latestValue != null ? (WSRolePK)latestValue : new WSRolePK(key.getPk());
if (destPort.existsRole(new WSExistsRole(latestValue != null ? (WSRolePK)latestValue : (WSRolePK)xobject.getWsKey())).is_true()) {
InputDialog id=new InputDialog(view.getSite().getShell(),"String_Node_Str" + key.getPk(),"String_Node_Str" + (latestValue != null ? newKey.getPk() : key.getPk()) + "String_Node_Str","String_Node_Str" + (selected.getEndpointAddress().equals(xobject.getEndpointAddress()) ? "String_Node_Str" : xobject.getEndpointAddress().split("String_Node_Str")[0] + "String_Node_Str") + key.getPk(),new IInputValidator(){
public String isValid(String newText){
  if ((newText == null) || "String_Node_Str".equals(newText))   return "String_Node_Str";
  return null;
}
}
);
id.setBlockOnOpen(true);
if (id.open() == Window.CANCEL) {
list.remove(xobject);
iter=list.iterator();
break;
}
newKey=new WSRolePK(id.getValue());
keyTrackMap.put(xobject,newKey);
break;
}
XtentisPort originalPort=Util.getPort(new URL(xobject.getEndpointAddress()),xobject.getUniverse(),xobject.getUsername(),xobject.getPassword());
WSRole originalRole=originalPort.getRole(new WSGetRole(key));
WSRole newRole=new WSRole(newKey.getPk(),originalRole.getDescription(),originalRole.getSpecification());
destPort.putRole(new WSPutRole(newRole));
TreeObject newObj=new TreeObject(newKey.getPk(),parent != null ? parent.getServerRoot() : xobject.getServerRoot(),xobject.getType(),newKey,null);
newTreeObject(newObj,selected);
list.remove(xobject);
iter=list.iterator();
}
break;
case TreeObject.ROUTING_RULE:
{
WSRoutingRulePK key=(WSRoutingRulePK)xobject.getWsKey();
WSRoutingRulePK newKey=latestValue != null ? (WSRoutingRulePK)latestValue : new WSRoutingRulePK(key.getPk());
if (destPort.existsRoutingRule(new WSExistsRoutingRule(latestValue != null ? (WSRoutingRulePK)latestValue : (WSRoutingRulePK)xobject.getWsKey())).is_true()) {
InputDialog id=new InputDialog(view.getSite().getShell(),"String_Node_Str" + key.getPk(),"String_Node_Str" + (latestValue != null ? newKey.getPk() : key.getPk()) + "String_Node_Str","String_Node_Str" + (selected.getEndpointAddress().equals(xobject.getEndpointAddress()) ? "String_Node_Str" : xobject.getEndpointAddress().split("String_Node_Str")[0] + "String_Node_Str") + key.getPk(),new IInputValidator(){
public String isValid(String newText){
if ((newText == null) || "String_Node_Str".equals(newText)) return "String_Node_Str";
return null;
}
}
);
id.setBlockOnOpen(true);
if (id.open() == Window.CANCEL) {
list.remove(xobject);
iter=list.iterator();
break;
}
newKey=new WSRoutingRulePK(id.getValue());
keyTrackMap.put(xobject,newKey);
break;
}
XtentisPort originalPort=Util.getPort(new URL(xobject.getEndpointAddress()),xobject.getUniverse(),xobject.getUsername(),xobject.getPassword());
WSRoutingRule originalRoutingRule=originalPort.getRoutingRule(new WSGetRoutingRule(key));
WSRoutingRule newRoutingRule=new WSRoutingRule(newKey.getPk(),originalRoutingRule.getDescription(),originalRoutingRule.isSynchronous(),originalRoutingRule.getConcept(),originalRoutingRule.getServiceJNDI(),originalRoutingRule.getParameters(),originalRoutingRule.getWsRoutingRuleExpressions(),originalRoutingRule.getCondition(),originalRoutingRule.getDeactive());
destPort.putRoutingRule(new WSPutRoutingRule(newRoutingRule));
TreeObject newObj=new TreeObject(newKey.getPk(),parent != null ? parent.getServerRoot() : xobject.getServerRoot(),xobject.getType(),newKey,null);
newTreeObject(newObj,selected);
list.remove(xobject);
iter=list.iterator();
}
break;
case TreeObject.TRANSFORMER:
{
WSTransformerV2PK key=(WSTransformerV2PK)xobject.getWsKey();
WSTransformerV2PK newKey=latestValue != null ? (WSTransformerV2PK)latestValue : new WSTransformerV2PK(key.getPk());
if (destPort.existsTransformerV2(new WSExistsTransformerV2(latestValue != null ? (WSTransformerV2PK)latestValue : (WSTransformerV2PK)xobject.getWsKey())).is_true()) {
InputDialog id=new InputDialog(view.getSite().getShell(),"String_Node_Str" + key.getPk(),"String_Node_Str" + (latestValue != null ? newKey.getPk() : key.getPk()) + "String_Node_Str","String_Node_Str" + (selected.getEndpointAddress().equals(xobject.getEndpointAddress()) ? "String_Node_Str" : xobject.getEndpointAddress().split("String_Node_Str")[0] + "String_Node_Str") + key.getPk(),new IInputValidator(){
public String isValid(String newText){
if ((newText == null) || "String_Node_Str".equals(newText)) return "String_Node_Str";
return null;
}
}
);
id.setBlockOnOpen(true);
if (id.open() == Window.CANCEL) {
list.remove(xobject);
iter=list.iterator();
break;
}
newKey=new WSTransformerV2PK(id.getValue());
keyTrackMap.put(xobject,newKey);
break;
}
XtentisPort originalPort=Util.getPort(new URL(xobject.getEndpointAddress()),xobject.getUniverse(),xobject.getUsername(),xobject.getPassword());
WSTransformerV2 originalTransformer=originalPort.getTransformerV2(new WSGetTransformerV2(key));
WSTransformerV2 newTransformer=new WSTransformerV2(newKey.getPk(),originalTransformer.getDescription(),originalTransformer.getProcessSteps());
destPort.putTransformerV2(new WSPutTransformerV2(newTransformer));
TreeObject newObj=new TreeObject(newKey.getPk(),parent != null ? parent.getServerRoot() : xobject.getServerRoot(),xobject.getType(),newKey,null);
newTreeObject(newObj,selected);
list.remove(xobject);
iter=list.iterator();
}
break;
case TreeObject.MENU:
{
WSMenuPK key=(WSMenuPK)xobject.getWsKey();
WSMenuPK newKey=latestValue != null ? (WSMenuPK)latestValue : new WSMenuPK(key.getPk());
if (destPort.existsMenu(new WSExistsMenu(latestValue != null ? (WSMenuPK)latestValue : (WSMenuPK)xobject.getWsKey())).is_true()) {
InputDialog id=new InputDialog(view.getSite().getShell(),"String_Node_Str" + key.getPk(),"String_Node_Str" + (latestValue != null ? newKey.getPk() : key.getPk()) + "String_Node_Str","String_Node_Str" + (selected.getEndpointAddress().equals(xobject.getEndpointAddress()) ? "String_Node_Str" : xobject.getEndpointAddress().split("String_Node_Str")[0] + "String_Node_Str") + key.getPk(),new IInputValidator(){
public String isValid(String newText){
if ((newText == null) || "String_Node_Str".equals(newText)) return "String_Node_Str";
return null;
}
}
);
id.setBlockOnOpen(true);
if (id.open() == Window.CANCEL) {
list.remove(xobject);
iter=list.iterator();
break;
}
newKey=new WSMenuPK(id.getValue());
keyTrackMap.put(xobject,newKey);
break;
}
XtentisPort originalPort=Util.getPort(new URL(xobject.getEndpointAddress()),xobject.getUniverse(),xobject.getUsername(),xobject.getPassword());
WSMenu originalMenu=originalPort.getMenu(new WSGetMenu(key));
WSMenu newMenu=new WSMenu(newKey.getPk(),originalMenu.getDescription(),originalMenu.getMenuEntries());
destPort.putMenu(new WSPutMenu(newMenu));
TreeObject newObj=new TreeObject(newKey.getPk(),parent != null ? parent.getServerRoot() : xobject.getServerRoot(),xobject.getType(),newKey,null);
newTreeObject(newObj,selected);
list.remove(xobject);
iter=list.iterator();
}
break;
case TreeObject.UNIVERSE:
{
WSUniversePK key=(WSUniversePK)xobject.getWsKey();
WSUniversePK newKey=latestValue != null ? (WSUniversePK)latestValue : new WSUniversePK(key.getPk());
if (destPort.existsUniverse(new WSExistsUniverse(latestValue != null ? (WSUniversePK)latestValue : (WSUniversePK)xobject.getWsKey())).is_true()) {
InputDialog id=new InputDialog(view.getSite().getShell(),"String_Node_Str" + key.getPk(),"String_Node_Str" + (latestValue != null ? newKey.getPk() : key.getPk()) + "String_Node_Str","String_Node_Str" + (selected.getEndpointAddress().equals(xobject.getEndpointAddress()) ? "String_Node_Str" : xobject.getEndpointAddress().split("String_Node_Str")[0] + "String_Node_Str") + key.getPk(),new IInputValidator(){
public String isValid(String newText){
if ((newText == null) || "String_Node_Str".equals(newText)) return "String_Node_Str";
return null;
}
}
);
id.setBlockOnOpen(true);
if (id.open() == Window.CANCEL) {
list.remove(xobject);
iter=list.iterator();
break;
}
newKey=new WSUniversePK(id.getValue());
keyTrackMap.put(xobject,newKey);
break;
}
XtentisPort originalPort=Util.getPort(new URL(xobject.getEndpointAddress()),xobject.getUniverse(),xobject.getUsername(),xobject.getPassword());
WSUniverse originalUniverse=originalPort.getUniverse(new WSGetUniverse(key));
WSUniverse newUniverse=new WSUniverse(newKey.getPk(),originalUniverse.getDescription(),originalUniverse.getXtentisObjectsRevisionIDs(),originalUniverse.getDefaultItemsRevisionID(),originalUniverse.getItemsRevisionIDs());
destPort.putUniverse(new WSPutUniverse(newUniverse));
TreeObject newObj=new TreeObject(newKey.getPk(),parent != null ? parent.getServerRoot() : xobject.getServerRoot(),xobject.getType(),newKey,null);
newTreeObject(newObj,selected);
list.remove(xobject);
iter=list.iterator();
}
break;
case TreeObject.SYNCHRONIZATIONPLAN:
{
WSSynchronizationPlanPK key=(WSSynchronizationPlanPK)xobject.getWsKey();
WSSynchronizationPlanPK newKey=latestValue != null ? (WSSynchronizationPlanPK)latestValue : new WSSynchronizationPlanPK(key.getPk());
if (destPort.existsSynchronizationPlan(new WSExistsSynchronizationPlan(latestValue != null ? (WSSynchronizationPlanPK)latestValue : (WSSynchronizationPlanPK)xobject.getWsKey())).is_true()) {
InputDialog id=new InputDialog(view.getSite().getShell(),"String_Node_Str" + key.getPk(),"String_Node_Str" + (latestValue != null ? newKey.getPk() : key.getPk()) + "String_Node_Str","String_Node_Str" + (selected.getEndpointAddress().equals(xobject.getEndpointAddress()) ? "String_Node_Str" : xobject.getEndpointAddress().split("String_Node_Str")[0] + "String_Node_Str") + key.getPk(),new IInputValidator(){
public String isValid(String newText){
if ((newText == null) || "String_Node_Str".equals(newText)) return "String_Node_Str";
return null;
}
}
);
id.setBlockOnOpen(true);
if (id.open() == Window.CANCEL) {
list.remove(xobject);
iter=list.iterator();
break;
}
newKey=new WSSynchronizationPlanPK(id.getValue());
keyTrackMap.put(xobject,newKey);
break;
}
XtentisPort originalPort=Util.getPort(new URL(xobject.getEndpointAddress()),xobject.getUniverse(),xobject.getUsername(),xobject.getPassword());
WSSynchronizationPlan originalSynchronizationPlan=originalPort.getSynchronizationPlan(new WSGetSynchronizationPlan(key));
WSSynchronizationPlan newSynchronizationPlan=new WSSynchronizationPlan(newKey.getPk(),originalSynchronizationPlan.getDescription(),originalSynchronizationPlan.getRemoteSystemName(),originalSynchronizationPlan.getRemoteSystemURL(),originalSynchronizationPlan.getRemoteSystemUsername(),originalSynchronizationPlan.getRemoteSystemPassword(),originalSynchronizationPlan.getTisURL(),originalSynchronizationPlan.getTisUsername(),originalSynchronizationPlan.getTisPassword(),originalSynchronizationPlan.getTisParameters(),originalSynchronizationPlan.getXtentisObjectsSynchronizations(),originalSynchronizationPlan.getItemsSynchronizations());
destPort.putSynchronizationPlan(new WSPutSynchronizationPlan(newSynchronizationPlan));
TreeObject newObj=new TreeObject(newKey.getPk(),parent != null ? parent.getServerRoot() : xobject.getServerRoot(),xobject.getType(),newKey,null);
newTreeObject(newObj,selected);
list.remove(xobject);
iter=list.iterator();
}
break;
default :
}
}
if (list.isEmpty()) break;
}
}
 catch (Exception e) {
log.error(e.getStackTrace());
MessageDialog.openError(view.getSite().getShell(),"String_Node_Str","String_Node_Str" + e.getLocalizedMessage());
}
 finally {
keyTrackMap.clear();
destPort=null;
parent=null;
}
}

Fixed version (ground truth):
public void run(){
  TreeObject selected=(TreeObject)((IStructuredSelection)view.getViewer().getSelection()).getFirstElement();
  Map<TreeObject,Object> keyTrackMap=new HashMap<TreeObject,Object>();
  try {
    super.run();
    if (this.view == null) {
      MessageDialog.openError(view.getSite().getShell(),"String_Node_Str","String_Node_Str");
      return;
    }
    if (destPort == null) {
      destPort=Util.getPort(new URL(selected.getEndpointAddress()),selected.getUniverse(),selected.getUsername(),selected.getPassword());
    }
    ArrayList<TreeObject> list=WorkbenchClipboard.getWorkbenchClipboard().get();
    while (true) {
      for (Iterator<TreeObject> iter=list.iterator(); iter.hasNext(); ) {
        TreeObject xobject=iter.next();
        Object latestValue=keyTrackMap.get(xobject);
switch (xobject.getType()) {
case TreeObject.DATA_MODEL:
{
            WSDataModelPK key=(WSDataModelPK)xobject.getWsKey();
            WSDataModelPK newKey=latestValue != null ? (WSDataModelPK)latestValue : new WSDataModelPK(key.getPk());
            if (destPort.existsDataModel(new WSExistsDataModel(latestValue != null ? (WSDataModelPK)latestValue : (WSDataModelPK)xobject.getWsKey())).is_true()) {
              InputDialog id=new InputDialog(view.getSite().getShell(),"String_Node_Str" + key.getPk(),"String_Node_Str" + (latestValue != null ? newKey.getPk() : key.getPk()) + "String_Node_Str","String_Node_Str" + (selected.getEndpointAddress().equals(xobject.getEndpointAddress()) ? "String_Node_Str" : xobject.getEndpointAddress().split("String_Node_Str")[0] + "String_Node_Str") + key.getPk(),new IInputValidator(){
                public String isValid(                String newText){
                  if ((newText == null) || "String_Node_Str".equals(newText))                   return "String_Node_Str";
                  return null;
                }
              }
);
              id.setBlockOnOpen(true);
              if (id.open() == Window.CANCEL) {
                list.remove(xobject);
                iter=list.iterator();
                break;
              }
              newKey=new WSDataModelPK(id.getValue());
              keyTrackMap.put(xobject,newKey);
              break;
            }
            XtentisPort originalPort=Util.getPort(new URL(xobject.getEndpointAddress()),xobject.getUniverse(),xobject.getUsername(),xobject.getPassword());
            WSDataModel originalDataModel=originalPort.getDataModel(new WSGetDataModel(key));
            WSDataModel newDataModel=new WSDataModel(newKey.getPk(),originalDataModel.getDescription(),originalDataModel.getXsdSchema());
            destPort.putDataModel(new WSPutDataModel(newDataModel));
            TreeObject newObj=new TreeObject(newKey.getPk(),parent != null ? parent.getServerRoot() : selected.getServerRoot(),xobject.getType(),newKey,null);
            newTreeObject(newObj,selected);
            list.remove(xobject);
            iter=list.iterator();
          }
        break;
case TreeObject.VIEW:
{
        WSViewPK key=(WSViewPK)xobject.getWsKey();
        WSViewPK newKey=latestValue != null ? (WSViewPK)latestValue : new WSViewPK(key.getPk());
        if (destPort.existsView(new WSExistsView(latestValue != null ? (WSViewPK)latestValue : (WSViewPK)xobject.getWsKey())).is_true()) {
          InputDialog id=new InputDialog(view.getSite().getShell(),"String_Node_Str" + key.getPk(),"String_Node_Str" + (latestValue != null ? newKey.getPk() : key.getPk()) + "String_Node_Str","String_Node_Str" + (selected.getEndpointAddress().equals(xobject.getEndpointAddress()) ? "String_Node_Str" : xobject.getEndpointAddress().split("String_Node_Str")[0] + "String_Node_Str") + key.getPk(),new IInputValidator(){
            public String isValid(            String newText){
              if ((newText == null) || "String_Node_Str".equals(newText))               return "String_Node_Str";
              return null;
            }
          }
);
          id.setBlockOnOpen(true);
          if (id.open() == Window.CANCEL) {
            list.remove(xobject);
            iter=list.iterator();
            break;
          }
          newKey=new WSViewPK(id.getValue());
          keyTrackMap.put(xobject,newKey);
          break;
        }
        XtentisPort originalPort=Util.getPort(new URL(xobject.getEndpointAddress()),xobject.getUniverse(),xobject.getUsername(),xobject.getPassword());
        WSView originalView=originalPort.getView(new WSGetView(key));
        WSView newView=new WSView(newKey.getPk(),originalView.getDescription(),originalView.getViewableBusinessElements(),originalView.getWhereConditions(),originalView.getSearchableBusinessElements(),null,new WSBoolean(false));
        destPort.putView(new WSPutView(newView));
        TreeObject newObj=new TreeObject(newKey.getPk(),parent != null ? parent.getServerRoot() : xobject.getServerRoot(),xobject.getType(),newKey,null);
        newTreeObject(newObj,selected);
        list.remove(xobject);
        iter=list.iterator();
      }
    break;
case TreeObject.DATA_CLUSTER:
{
    WSDataClusterPK key=(WSDataClusterPK)xobject.getWsKey();
    WSDataClusterPK newKey=latestValue != null ? (WSDataClusterPK)latestValue : new WSDataClusterPK(key.getPk());
    if (destPort.existsDataCluster(new WSExistsDataCluster(latestValue != null ? (WSDataClusterPK)latestValue : (WSDataClusterPK)xobject.getWsKey())).is_true()) {
      InputDialog id=new InputDialog(view.getSite().getShell(),"String_Node_Str" + key.getPk(),"String_Node_Str" + (latestValue != null ? newKey.getPk() : key.getPk()) + "String_Node_Str","String_Node_Str" + (selected.getEndpointAddress().equals(xobject.getEndpointAddress()) ? "String_Node_Str" : xobject.getEndpointAddress().split("String_Node_Str")[0] + "String_Node_Str") + key.getPk(),new IInputValidator(){
        public String isValid(        String newText){
          if ((newText == null) || "String_Node_Str".equals(newText))           return "String_Node_Str";
          return null;
        }
      }
);
      id.setBlockOnOpen(true);
      if (id.open() == Window.CANCEL) {
        list.remove(xobject);
        iter=list.iterator();
        break;
      }
      newKey=new WSDataClusterPK(id.getValue());
      keyTrackMap.put(xobject,newKey);
      break;
    }
    XtentisPort originalPort=Util.getPort(new URL(xobject.getEndpointAddress()),xobject.getUniverse(),xobject.getUsername(),xobject.getPassword());
    WSDataCluster originalDataCluster=originalPort.getDataCluster(new WSGetDataCluster(key));
    WSDataCluster newDataCluster=new WSDataCluster(newKey.getPk(),originalDataCluster.getDescription(),originalDataCluster.getVocabulary());
    destPort.putDataCluster(new WSPutDataCluster(newDataCluster));
    TreeObject newObj=new TreeObject(newKey.getPk(),parent != null ? parent.getServerRoot() : xobject.getServerRoot(),xobject.getType(),newKey,null);
    newTreeObject(newObj,selected);
    copyXObjectContent(((WSDataClusterPK)xobject.getWsKey()).getPk(),newKey.getPk(),newObj.getUniverse(),TreeObject.DATA_CLUSTER);
    list.remove(xobject);
    iter=list.iterator();
  }
break;
case TreeObject.STORED_PROCEDURE:
{
WSStoredProcedurePK key=(WSStoredProcedurePK)xobject.getWsKey();
WSStoredProcedurePK newKey=latestValue != null ? (WSStoredProcedurePK)latestValue : new WSStoredProcedurePK(key.getPk());
if (destPort.existsStoredProcedure(new WSExistsStoredProcedure(latestValue != null ? (WSStoredProcedurePK)latestValue : (WSStoredProcedurePK)xobject.getWsKey())).is_true()) {
  InputDialog id=new InputDialog(view.getSite().getShell(),"String_Node_Str" + key.getPk(),"String_Node_Str" + (latestValue != null ? newKey.getPk() : key.getPk()) + "String_Node_Str","String_Node_Str" + (selected.getEndpointAddress().equals(xobject.getEndpointAddress()) ? "String_Node_Str" : xobject.getEndpointAddress().split("String_Node_Str")[0] + "String_Node_Str") + key.getPk(),new IInputValidator(){
    public String isValid(    String newText){
      if ((newText == null) || "String_Node_Str".equals(newText))       return "String_Node_Str";
      return null;
    }
  }
);
  id.setBlockOnOpen(true);
  if (id.open() == Window.CANCEL) {
    list.remove(xobject);
    iter=list.iterator();
    break;
  }
  newKey=new WSStoredProcedurePK(id.getValue());
  keyTrackMap.put(xobject,newKey);
  break;
}
XtentisPort originalPort=Util.getPort(new URL(xobject.getEndpointAddress()),xobject.getUniverse(),xobject.getUsername(),xobject.getPassword());
WSStoredProcedure originalStoredProcedure=originalPort.getStoredProcedure(new WSGetStoredProcedure(key));
WSStoredProcedure newStoredProcedure=new WSStoredProcedure(newKey.getPk(),originalStoredProcedure.getDescription(),originalStoredProcedure.getProcedure(),originalStoredProcedure.getRefreshCache());
destPort.putStoredProcedure(new WSPutStoredProcedure(newStoredProcedure));
TreeObject newObj=new TreeObject(newKey.getPk(),parent != null ? parent.getServerRoot() : xobject.getServerRoot(),xobject.getType(),newKey,null);
newTreeObject(newObj,selected);
list.remove(xobject);
iter=list.iterator();
}
break;
case TreeObject.ROLE:
{
WSRolePK key=(WSRolePK)xobject.getWsKey();
WSRolePK newKey=latestValue != null ? (WSRolePK)latestValue : new WSRolePK(key.getPk());
if (destPort.existsRole(new WSExistsRole(latestValue != null ? (WSRolePK)latestValue : (WSRolePK)xobject.getWsKey())).is_true()) {
InputDialog id=new InputDialog(view.getSite().getShell(),"String_Node_Str" + key.getPk(),"String_Node_Str" + (latestValue != null ? newKey.getPk() : key.getPk()) + "String_Node_Str","String_Node_Str" + (selected.getEndpointAddress().equals(xobject.getEndpointAddress()) ? "String_Node_Str" : xobject.getEndpointAddress().split("String_Node_Str")[0] + "String_Node_Str") + key.getPk(),new IInputValidator(){
public String isValid(String newText){
  if ((newText == null) || "String_Node_Str".equals(newText))   return "String_Node_Str";
  return null;
}
}
);
id.setBlockOnOpen(true);
if (id.open() == Window.CANCEL) {
list.remove(xobject);
iter=list.iterator();
break;
}
newKey=new WSRolePK(id.getValue());
keyTrackMap.put(xobject,newKey);
break;
}
XtentisPort originalPort=Util.getPort(new URL(xobject.getEndpointAddress()),xobject.getUniverse(),xobject.getUsername(),xobject.getPassword());
WSRole originalRole=originalPort.getRole(new WSGetRole(key));
WSRole newRole=new WSRole(newKey.getPk(),originalRole.getDescription(),originalRole.getSpecification());
destPort.putRole(new WSPutRole(newRole));
TreeObject newObj=new TreeObject(newKey.getPk(),parent != null ? parent.getServerRoot() : xobject.getServerRoot(),xobject.getType(),newKey,null);
newTreeObject(newObj,selected);
list.remove(xobject);
iter=list.iterator();
}
break;
case TreeObject.ROUTING_RULE:
{
WSRoutingRulePK key=(WSRoutingRulePK)xobject.getWsKey();
WSRoutingRulePK newKey=latestValue != null ? (WSRoutingRulePK)latestValue : new WSRoutingRulePK(key.getPk());
if (destPort.existsRoutingRule(new WSExistsRoutingRule(latestValue != null ? (WSRoutingRulePK)latestValue : (WSRoutingRulePK)xobject.getWsKey())).is_true()) {
InputDialog id=new InputDialog(view.getSite().getShell(),"String_Node_Str" + key.getPk(),"String_Node_Str" + (latestValue != null ? newKey.getPk() : key.getPk()) + "String_Node_Str","String_Node_Str" + (selected.getEndpointAddress().equals(xobject.getEndpointAddress()) ? "String_Node_Str" : xobject.getEndpointAddress().split("String_Node_Str")[0] + "String_Node_Str") + key.getPk(),new IInputValidator(){
public String isValid(String newText){
if ((newText == null) || "String_Node_Str".equals(newText)) return "String_Node_Str";
return null;
}
}
);
id.setBlockOnOpen(true);
if (id.open() == Window.CANCEL) {
list.remove(xobject);
iter=list.iterator();
break;
}
newKey=new WSRoutingRulePK(id.getValue());
keyTrackMap.put(xobject,newKey);
break;
}
XtentisPort originalPort=Util.getPort(new URL(xobject.getEndpointAddress()),xobject.getUniverse(),xobject.getUsername(),xobject.getPassword());
WSRoutingRule originalRoutingRule=originalPort.getRoutingRule(new WSGetRoutingRule(key));
WSRoutingRule newRoutingRule=new WSRoutingRule(newKey.getPk(),originalRoutingRule.getDescription(),originalRoutingRule.isSynchronous(),originalRoutingRule.getConcept(),originalRoutingRule.getServiceJNDI(),originalRoutingRule.getParameters(),originalRoutingRule.getWsRoutingRuleExpressions(),originalRoutingRule.getCondition(),originalRoutingRule.getDeactive());
destPort.putRoutingRule(new WSPutRoutingRule(newRoutingRule));
TreeObject newObj=new TreeObject(newKey.getPk(),parent != null ? parent.getServerRoot() : xobject.getServerRoot(),xobject.getType(),newKey,null);
newTreeObject(newObj,selected);
list.remove(xobject);
iter=list.iterator();
}
break;
case TreeObject.TRANSFORMER:
{
WSTransformerV2PK key=(WSTransformerV2PK)xobject.getWsKey();
WSTransformerV2PK newKey=latestValue != null ? (WSTransformerV2PK)latestValue : new WSTransformerV2PK(key.getPk());
if (destPort.existsTransformerV2(new WSExistsTransformerV2(latestValue != null ? (WSTransformerV2PK)latestValue : (WSTransformerV2PK)xobject.getWsKey())).is_true()) {
InputDialog id=new InputDialog(view.getSite().getShell(),"String_Node_Str" + key.getPk(),"String_Node_Str" + (latestValue != null ? newKey.getPk() : key.getPk()) + "String_Node_Str","String_Node_Str" + (selected.getEndpointAddress().equals(xobject.getEndpointAddress()) ? "String_Node_Str" : xobject.getEndpointAddress().split("String_Node_Str")[0] + "String_Node_Str") + key.getPk(),new IInputValidator(){
public String isValid(String newText){
if ((newText == null) || "String_Node_Str".equals(newText)) return "String_Node_Str";
return null;
}
}
);
id.setBlockOnOpen(true);
if (id.open() == Window.CANCEL) {
list.remove(xobject);
iter=list.iterator();
break;
}
newKey=new WSTransformerV2PK(id.getValue());
keyTrackMap.put(xobject,newKey);
break;
}
XtentisPort originalPort=Util.getPort(new URL(xobject.getEndpointAddress()),xobject.getUniverse(),xobject.getUsername(),xobject.getPassword());
WSTransformerV2 originalTransformer=originalPort.getTransformerV2(new WSGetTransformerV2(key));
WSTransformerV2 newTransformer=new WSTransformerV2(newKey.getPk(),originalTransformer.getDescription(),originalTransformer.getProcessSteps());
destPort.putTransformerV2(new WSPutTransformerV2(newTransformer));
TreeObject newObj=new TreeObject(newKey.getPk(),parent != null ? parent.getServerRoot() : xobject.getServerRoot(),xobject.getType(),newKey,null);
newTreeObject(newObj,selected);
list.remove(xobject);
iter=list.iterator();
}
break;
case TreeObject.MENU:
{
WSMenuPK key=(WSMenuPK)xobject.getWsKey();
WSMenuPK newKey=latestValue != null ? (WSMenuPK)latestValue : new WSMenuPK(key.getPk());
if (destPort.existsMenu(new WSExistsMenu(latestValue != null ? (WSMenuPK)latestValue : (WSMenuPK)xobject.getWsKey())).is_true()) {
InputDialog id=new InputDialog(view.getSite().getShell(),"String_Node_Str" + key.getPk(),"String_Node_Str" + (latestValue != null ? newKey.getPk() : key.getPk()) + "String_Node_Str","String_Node_Str" + (selected.getEndpointAddress().equals(xobject.getEndpointAddress()) ? "String_Node_Str" : xobject.getEndpointAddress().split("String_Node_Str")[0] + "String_Node_Str") + key.getPk(),new IInputValidator(){
public String isValid(String newText){
if ((newText == null) || "String_Node_Str".equals(newText)) return "String_Node_Str";
return null;
}
}
);
id.setBlockOnOpen(true);
if (id.open() == Window.CANCEL) {
list.remove(xobject);
iter=list.iterator();
break;
}
newKey=new WSMenuPK(id.getValue());
keyTrackMap.put(xobject,newKey);
break;
}
XtentisPort originalPort=Util.getPort(new URL(xobject.getEndpointAddress()),xobject.getUniverse(),xobject.getUsername(),xobject.getPassword());
WSMenu originalMenu=originalPort.getMenu(new WSGetMenu(key));
WSMenu newMenu=new WSMenu(newKey.getPk(),originalMenu.getDescription(),originalMenu.getMenuEntries());
destPort.putMenu(new WSPutMenu(newMenu));
TreeObject newObj=new TreeObject(newKey.getPk(),parent != null ? parent.getServerRoot() : xobject.getServerRoot(),xobject.getType(),newKey,null);
newTreeObject(newObj,selected);
list.remove(xobject);
iter=list.iterator();
}
break;
case TreeObject.UNIVERSE:
{
WSUniversePK key=(WSUniversePK)xobject.getWsKey();
WSUniversePK newKey=latestValue != null ? (WSUniversePK)latestValue : new WSUniversePK(key.getPk());
if (destPort.existsUniverse(new WSExistsUniverse(latestValue != null ? (WSUniversePK)latestValue : (WSUniversePK)xobject.getWsKey())).is_true()) {
InputDialog id=new InputDialog(view.getSite().getShell(),"String_Node_Str" + key.getPk(),"String_Node_Str" + (latestValue != null ? newKey.getPk() : key.getPk()) + "String_Node_Str","String_Node_Str" + (selected.getEndpointAddress().equals(xobject.getEndpointAddress()) ? "String_Node_Str" : xobject.getEndpointAddress().split("String_Node_Str")[0] + "String_Node_Str") + key.getPk(),new IInputValidator(){
public String isValid(String newText){
if ((newText == null) || "String_Node_Str".equals(newText)) return "String_Node_Str";
return null;
}
}
);
id.setBlockOnOpen(true);
if (id.open() == Window.CANCEL) {
list.remove(xobject);
iter=list.iterator();
break;
}
newKey=new WSUniversePK(id.getValue());
keyTrackMap.put(xobject,newKey);
break;
}
XtentisPort originalPort=Util.getPort(new URL(xobject.getEndpointAddress()),xobject.getUniverse(),xobject.getUsername(),xobject.getPassword());
WSUniverse originalUniverse=originalPort.getUniverse(new WSGetUniverse(key));
WSUniverse newUniverse=new WSUniverse(newKey.getPk(),originalUniverse.getDescription(),originalUniverse.getXtentisObjectsRevisionIDs(),originalUniverse.getDefaultItemsRevisionID(),originalUniverse.getItemsRevisionIDs());
destPort.putUniverse(new WSPutUniverse(newUniverse));
TreeObject newObj=new TreeObject(newKey.getPk(),parent != null ? parent.getServerRoot() : xobject.getServerRoot(),xobject.getType(),newKey,null);
newTreeObject(newObj,selected);
list.remove(xobject);
iter=list.iterator();
}
break;
case TreeObject.SYNCHRONIZATIONPLAN:
{
WSSynchronizationPlanPK key=(WSSynchronizationPlanPK)xobject.getWsKey();
WSSynchronizationPlanPK newKey=latestValue != null ? (WSSynchronizationPlanPK)latestValue : new WSSynchronizationPlanPK(key.getPk());
if (destPort.existsSynchronizationPlan(new WSExistsSynchronizationPlan(latestValue != null ? (WSSynchronizationPlanPK)latestValue : (WSSynchronizationPlanPK)xobject.getWsKey())).is_true()) {
InputDialog id=new InputDialog(view.getSite().getShell(),"String_Node_Str" + key.getPk(),"String_Node_Str" + (latestValue != null ? newKey.getPk() : key.getPk()) + "String_Node_Str","String_Node_Str" + (selected.getEndpointAddress().equals(xobject.getEndpointAddress()) ? "String_Node_Str" : xobject.getEndpointAddress().split("String_Node_Str")[0] + "String_Node_Str") + key.getPk(),new IInputValidator(){
public String isValid(String newText){
if ((newText == null) || "String_Node_Str".equals(newText)) return "String_Node_Str";
return null;
}
}
);
id.setBlockOnOpen(true);
if (id.open() == Window.CANCEL) {
list.remove(xobject);
iter=list.iterator();
break;
}
newKey=new WSSynchronizationPlanPK(id.getValue());
keyTrackMap.put(xobject,newKey);
break;
}
XtentisPort originalPort=Util.getPort(new URL(xobject.getEndpointAddress()),xobject.getUniverse(),xobject.getUsername(),xobject.getPassword());
WSSynchronizationPlan originalSynchronizationPlan=originalPort.getSynchronizationPlan(new WSGetSynchronizationPlan(key));
WSSynchronizationPlan newSynchronizationPlan=new WSSynchronizationPlan(newKey.getPk(),originalSynchronizationPlan.getDescription(),originalSynchronizationPlan.getRemoteSystemName(),originalSynchronizationPlan.getRemoteSystemURL(),originalSynchronizationPlan.getRemoteSystemUsername(),originalSynchronizationPlan.getRemoteSystemPassword(),originalSynchronizationPlan.getTisURL(),originalSynchronizationPlan.getTisUsername(),originalSynchronizationPlan.getTisPassword(),originalSynchronizationPlan.getTisParameters(),originalSynchronizationPlan.getXtentisObjectsSynchronizations(),originalSynchronizationPlan.getItemsSynchronizations());
destPort.putSynchronizationPlan(new WSPutSynchronizationPlan(newSynchronizationPlan));
TreeObject newObj=new TreeObject(newKey.getPk(),parent != null ? parent.getServerRoot() : xobject.getServerRoot(),xobject.getType(),newKey,null);
newTreeObject(newObj,selected);
list.remove(xobject);
iter=list.iterator();
}
break;
default :
}
}
if (list.isEmpty()) break;
}
}
 catch (Exception e) {
log.error(e.getMessage(),e);
MessageDialog.openError(view.getSite().getShell(),"String_Node_Str","String_Node_Str" + e.getLocalizedMessage());
}
 finally {
keyTrackMap.clear();
destPort=null;
parent=null;
}
}