Program: 148384
Project: 148384
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));
    RoleAssignmentDialog.doSave(port,((WSDataModel)newWsObject).getName(),"String_Node_Str");
  break;
case TreeObject.VIEW:
port.putView(new WSPutView((WSView)newWsObject));
break;
case TreeObject.DATA_CLUSTER:
port.putDataCluster(new WSPutDataCluster((WSDataCluster)newWsObject));
RoleAssignmentDialog.doSave(port,((WSDataCluster)newWsObject).getName(),"String_Node_Str");
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);
}
 else {
xobject.fireEvent(IXObjectModelListener.SAVE,xobject.getParent(),xobject);
}
state=0;
}
 catch (Exception e) {
log.error(e.getStackTrace());
ErrorExceptionDialog.openError(this.editor.getSite().getShell(),"String_Node_Str",CommonUtil.getErrMsgFromException(e));
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));
    RoleAssignmentDialog.doSave(port,((WSDataModel)newWsObject).getName(),"String_Node_Str");
  break;
case TreeObject.VIEW:
port.putView(new WSPutView((WSView)newWsObject));
break;
case TreeObject.DATA_CLUSTER:
port.putDataCluster(new WSPutDataCluster((WSDataCluster)newWsObject));
RoleAssignmentDialog.doSave(port,((WSDataCluster)newWsObject).getName(),"String_Node_Str");
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);
}
 else {
xobject.fireEvent(IXObjectModelListener.SAVE,xobject.getParent(),xobject);
}
state=0;
}
 catch (Exception e) {
log.error(e.getMessage(),e);
ErrorExceptionDialog.openError(this.editor.getSite().getShell(),"String_Node_Str",CommonUtil.getErrMsgFromException(e));
state=1;
}
}