Program: 149116
Project: 149116
Buggy source:
public void run(){
  try {
    TreeObject xobject=(TreeObject)((XObjectEditorInput)editor.getEditorInput()).getModel();
    Object newWsObject=xobject.getWsObject();
    if (!xobject.isXObject())     return;
    XtentisPort port=Util.getPort(new URL(xobject.getEndpointAddress()),xobject.getUniverse(),xobject.getUsername(),xobject.getPassword());
switch (xobject.getType()) {
case TreeObject.DATA_MODEL:
      port.putDataModel(new WSPutDataModel((WSDataModel)newWsObject));
    break;
case TreeObject.VIEW:
  port.putView(new WSPutView((WSView)newWsObject));
break;
case TreeObject.DATA_CLUSTER:
port.putDataCluster(new WSPutDataCluster((WSDataCluster)newWsObject));
break;
case TreeObject.STORED_PROCEDURE:
port.putStoredProcedure(new WSPutStoredProcedure((WSStoredProcedure)newWsObject));
break;
case TreeObject.ROLE:
port.putRole(new WSPutRole((WSRole)newWsObject));
break;
case TreeObject.ROUTING_RULE:
port.putRoutingRule(new WSPutRoutingRule((WSRoutingRule)newWsObject));
break;
case TreeObject.TRANSFORMER:
port.putTransformerV2(new WSPutTransformerV2((WSTransformerV2)newWsObject));
break;
case TreeObject.MENU:
port.putMenu(new WSPutMenu((WSMenu)newWsObject));
break;
case TreeObject.UNIVERSE:
port.putUniverse(new WSPutUniverse((WSUniverse)newWsObject));
break;
case TreeObject.SYNCHRONIZATIONPLAN:
port.putSynchronizationPlan(new WSPutSynchronizationPlan((WSSynchronizationPlan)newWsObject));
break;
default :
MessageDialog.openError(this.editor.getSite().getShell(),"String_Node_Str","String_Node_Str" + IConstants.TALEND + "String_Node_Str"+ xobject.getType());
return;
}
if (xobject.getParent() == null) {
if (xobject.getType() != TreeObject.DOCUMENT) {
TreeParent folder=xobject.findServerFolder(xobject.getType());
folder.addChild(xobject);
}
xobject.fireEvent(IXObjectModelListener.SAVE,xobject.getParent(),xobject);
xobject.getServerRoot().fireEvent(IXObjectModelListener.NEED_REFRESH,null,xobject.getServerRoot());
}
 else {
xobject.fireEvent(IXObjectModelListener.SAVE,xobject.getParent(),xobject);
}
state=0;
}
 catch (Exception e) {
e.printStackTrace();
ErrorExceptionDialog.openError(this.editor.getSite().getShell(),"String_Node_Str","String_Node_Str" + IConstants.TALEND + "String_Node_Str"+ e.getLocalizedMessage());
state=1;
}
}

Fixed version (ground truth):
public void run(){
  try {
    TreeObject xobject=(TreeObject)((XObjectEditorInput)editor.getEditorInput()).getModel();
    Object newWsObject=xobject.getWsObject();
    if (!xobject.isXObject())     return;
    XtentisPort port=Util.getPort(new URL(xobject.getEndpointAddress()),xobject.getUniverse(),xobject.getUsername(),xobject.getPassword());
switch (xobject.getType()) {
case TreeObject.DATA_MODEL:
      port.putDataModel(new WSPutDataModel((WSDataModel)newWsObject));
    break;
case TreeObject.VIEW:
  port.putView(new WSPutView((WSView)newWsObject));
break;
case TreeObject.DATA_CLUSTER:
port.putDataCluster(new WSPutDataCluster((WSDataCluster)newWsObject));
break;
case TreeObject.STORED_PROCEDURE:
port.putStoredProcedure(new WSPutStoredProcedure((WSStoredProcedure)newWsObject));
break;
case TreeObject.ROLE:
port.putRole(new WSPutRole((WSRole)newWsObject));
break;
case TreeObject.ROUTING_RULE:
port.putRoutingRule(new WSPutRoutingRule((WSRoutingRule)newWsObject));
break;
case TreeObject.TRANSFORMER:
port.putTransformerV2(new WSPutTransformerV2((WSTransformerV2)newWsObject));
break;
case TreeObject.MENU:
port.putMenu(new WSPutMenu((WSMenu)newWsObject));
break;
case TreeObject.UNIVERSE:
port.putUniverse(new WSPutUniverse((WSUniverse)newWsObject));
break;
case TreeObject.SYNCHRONIZATIONPLAN:
port.putSynchronizationPlan(new WSPutSynchronizationPlan((WSSynchronizationPlan)newWsObject));
break;
case TreeObject.SERVICE_CONFIGURATION:
break;
default :
MessageDialog.openError(this.editor.getSite().getShell(),"String_Node_Str","String_Node_Str" + IConstants.TALEND + "String_Node_Str"+ xobject.getType());
return;
}
if (xobject.getParent() == null) {
if (xobject.getType() != TreeObject.DOCUMENT) {
TreeParent folder=xobject.findServerFolder(xobject.getType());
folder.addChild(xobject);
}
xobject.fireEvent(IXObjectModelListener.SAVE,xobject.getParent(),xobject);
xobject.getServerRoot().fireEvent(IXObjectModelListener.NEED_REFRESH,null,xobject.getServerRoot());
}
 else {
xobject.fireEvent(IXObjectModelListener.SAVE,xobject.getParent(),xobject);
}
state=0;
}
 catch (Exception e) {
e.printStackTrace();
ErrorExceptionDialog.openError(this.editor.getSite().getShell(),"String_Node_Str","String_Node_Str" + IConstants.TALEND + "String_Node_Str"+ e.getLocalizedMessage());
state=1;
}
}