Program: 148375
Project: 148375
Buggy source:
public void run(){
  try {
    super.run();
    if (this.view != null) {
      ISelection selection=view.getViewer().getSelection();
      xobject=(TreeObject)((IStructuredSelection)selection).getFirstElement();
    }
    if (xobject == null || !xobject.isXObject())     return;
    XtentisPort port=Util.getPort(new URL(xobject.getEndpointAddress()),xobject.getUniverse(),xobject.getUsername(),xobject.getPassword());
switch (xobject.getType()) {
case TreeObject.DATA_MODEL:
      WSDataModel wsDataModel=port.getDataModel(new WSGetDataModel((WSDataModelPK)xobject.getWsKey()));
    xobject.setWsObject(wsDataModel);
  XSDEditorUtil.openDataModel(xobject,false);
return;
case TreeObject.VIEW:
WSView wsView=port.getView(new WSGetView((WSViewPK)xobject.getWsKey()));
xobject.setWsObject(wsView);
break;
case TreeObject.DATA_CLUSTER:
WSDataCluster wsDataCluster=port.getDataCluster(new WSGetDataCluster((WSDataClusterPK)xobject.getWsKey()));
xobject.setWsObject(wsDataCluster);
break;
case TreeObject.STORED_PROCEDURE:
WSStoredProcedure wsStoredProcedure=port.getStoredProcedure(new WSGetStoredProcedure((WSStoredProcedurePK)xobject.getWsKey()));
xobject.setWsObject(wsStoredProcedure);
break;
case TreeObject.ROLE:
WSRole wsRole=port.getRole(new WSGetRole((WSRolePK)xobject.getWsKey()));
xobject.setWsObject(wsRole);
break;
case TreeObject.ROUTING_RULE:
WSRoutingRule wsRoutingRule=port.getRoutingRule(new WSGetRoutingRule((WSRoutingRulePK)xobject.getWsKey()));
xobject.setWsObject(wsRoutingRule);
break;
case TreeObject.TRANSFORMER:
WSTransformerV2 wsTranformer=port.getTransformerV2(new WSGetTransformerV2((WSTransformerV2PK)xobject.getWsKey()));
xobject.setWsObject(wsTranformer);
break;
case TreeObject.MENU:
WSMenu wsMenu=port.getMenu(new WSGetMenu((WSMenuPK)xobject.getWsKey()));
xobject.setWsObject(wsMenu);
break;
case TreeObject.UNIVERSE:
WSUniverse wsUniverse=port.getUniverse(new WSGetUniverse((WSUniversePK)xobject.getWsKey()));
xobject.setWsObject(wsUniverse);
break;
case TreeObject.SYNCHRONIZATIONPLAN:
WSSynchronizationPlan wsSynchronizationPlan=port.getSynchronizationPlan(new WSGetSynchronizationPlan((WSSynchronizationPlanPK)xobject.getWsKey()));
xobject.setWsObject(wsSynchronizationPlan);
break;
case TreeObject.JOB_REGISTRY:
break;
case TreeObject.JOB:
xobject.setWsObject(xobject.getDisplayName());
break;
case TreeObject.SERVICE_CONFIGURATION:
break;
case TreeObject.RESOURCES:
case TreeObject.CUSTOM_TYPE:
case TreeObject.DATA_MODEL_RESOURCE:
case TreeObject.DATA_MODEL_TYPES_RESOURCE:
case TreeObject.CUSTOM_TYPES_RESOURCE:
case TreeObject.PICTURES_RESOURCE:
break;
default :
MessageDialog.openError(view.getSite().getShell(),"String_Node_Str","String_Node_Str" + IConstants.TALEND + "String_Node_Str"+ xobject.getType());
return;
}
if (page == null) this.page=view.getSite().getWorkbenchWindow().getActivePage();
this.page.openEditor(new XObjectEditorInput(xobject,xobject.getDisplayName()),"String_Node_Str");
}
 catch (Exception e) {
log.error(e.getStackTrace());
MessageDialog.openError(view.getSite().getShell(),"String_Node_Str","String_Node_Str" + e.getLocalizedMessage());
}
}

Fixed version (ground truth):
public void run(){
  try {
    super.run();
    if (this.view != null) {
      ISelection selection=view.getViewer().getSelection();
      xobject=(TreeObject)((IStructuredSelection)selection).getFirstElement();
    }
    if (xobject == null || !xobject.isXObject())     return;
    XtentisPort port=Util.getPort(new URL(xobject.getEndpointAddress()),xobject.getUniverse(),xobject.getUsername(),xobject.getPassword());
switch (xobject.getType()) {
case TreeObject.DATA_MODEL:
      WSDataModel wsDataModel=port.getDataModel(new WSGetDataModel((WSDataModelPK)xobject.getWsKey()));
    xobject.setWsObject(wsDataModel);
  XSDEditorUtil.openDataModel(xobject,false);
return;
case TreeObject.VIEW:
WSView wsView=port.getView(new WSGetView((WSViewPK)xobject.getWsKey()));
xobject.setWsObject(wsView);
break;
case TreeObject.DATA_CLUSTER:
WSDataCluster wsDataCluster=port.getDataCluster(new WSGetDataCluster((WSDataClusterPK)xobject.getWsKey()));
xobject.setWsObject(wsDataCluster);
break;
case TreeObject.STORED_PROCEDURE:
WSStoredProcedure wsStoredProcedure=port.getStoredProcedure(new WSGetStoredProcedure((WSStoredProcedurePK)xobject.getWsKey()));
xobject.setWsObject(wsStoredProcedure);
break;
case TreeObject.ROLE:
WSRole wsRole=port.getRole(new WSGetRole((WSRolePK)xobject.getWsKey()));
xobject.setWsObject(wsRole);
break;
case TreeObject.ROUTING_RULE:
WSRoutingRule wsRoutingRule=port.getRoutingRule(new WSGetRoutingRule((WSRoutingRulePK)xobject.getWsKey()));
xobject.setWsObject(wsRoutingRule);
break;
case TreeObject.TRANSFORMER:
WSTransformerV2 wsTranformer=port.getTransformerV2(new WSGetTransformerV2((WSTransformerV2PK)xobject.getWsKey()));
xobject.setWsObject(wsTranformer);
break;
case TreeObject.MENU:
WSMenu wsMenu=port.getMenu(new WSGetMenu((WSMenuPK)xobject.getWsKey()));
xobject.setWsObject(wsMenu);
break;
case TreeObject.UNIVERSE:
WSUniverse wsUniverse=port.getUniverse(new WSGetUniverse((WSUniversePK)xobject.getWsKey()));
xobject.setWsObject(wsUniverse);
break;
case TreeObject.SYNCHRONIZATIONPLAN:
WSSynchronizationPlan wsSynchronizationPlan=port.getSynchronizationPlan(new WSGetSynchronizationPlan((WSSynchronizationPlanPK)xobject.getWsKey()));
xobject.setWsObject(wsSynchronizationPlan);
break;
case TreeObject.JOB_REGISTRY:
break;
case TreeObject.JOB:
xobject.setWsObject(xobject.getDisplayName());
break;
case TreeObject.SERVICE_CONFIGURATION:
break;
case TreeObject.RESOURCES:
case TreeObject.CUSTOM_TYPE:
case TreeObject.DATA_MODEL_RESOURCE:
case TreeObject.DATA_MODEL_TYPES_RESOURCE:
case TreeObject.CUSTOM_TYPES_RESOURCE:
case TreeObject.PICTURES_RESOURCE:
break;
default :
MessageDialog.openError(view.getSite().getShell(),"String_Node_Str","String_Node_Str" + IConstants.TALEND + "String_Node_Str"+ xobject.getType());
return;
}
if (page == null) this.page=view.getSite().getWorkbenchWindow().getActivePage();
this.page.openEditor(new XObjectEditorInput(xobject,xobject.getDisplayName()),"String_Node_Str");
}
 catch (Exception e) {
log.error(e.getMessage(),e);
MessageDialog.openError(view.getSite().getShell(),"String_Node_Str","String_Node_Str" + e.getLocalizedMessage());
}
}