Program: 148752
Project: 148752
Buggy source:
public static void deleteTreeObject(TreeObject xobject,ServerView view) throws Exception {
  XtentisPort port=Util.getPort(new URL(xobject.getEndpointAddress()),xobject.getUniverse(),xobject.getUsername(),xobject.getPassword());
  java.util.List<IAvailableModel> availablemodels=AvailableModelUtil.getAvailableModels();
  for (  IAvailableModel model : availablemodels) {
    model.deleteTreeObject(port,xobject);
  }
switch (xobject.getType()) {
case TreeObject.DATA_MODEL:
    port.deleteDataModel(new WSDeleteDataModel((WSDataModelPK)xobject.getWsKey()));
  deleteSpecificationFromAttachedRole(port,xobject,"String_Node_Str");
break;
case TreeObject.VIEW:
port.deleteView(new WSDeleteView((WSViewPK)xobject.getWsKey()));
deleteSpecificationFromAttachedRole(port,xobject,"String_Node_Str");
break;
case TreeObject.DATA_CLUSTER:
port.deleteDataCluster(new WSDeleteDataCluster((WSDataClusterPK)xobject.getWsKey()));
deleteSpecificationFromAttachedRole(port,xobject,"String_Node_Str");
break;
case TreeObject.STORED_PROCEDURE:
port.deleteStoredProcedure(new WSDeleteStoredProcedure((WSStoredProcedurePK)xobject.getWsKey()));
break;
case TreeObject.ROUTING_RULE:
port.deleteRoutingRule(new WSDeleteRoutingRule((WSRoutingRulePK)xobject.getWsKey()));
break;
case TreeObject.TRANSFORMER:
port.deleteTransformerV2(new WSDeleteTransformerV2((WSTransformerV2PK)xobject.getWsKey()));
break;
case TreeObject.MENU:
port.deleteMenu(new WSDeleteMenu((WSMenuPK)xobject.getWsKey()));
deleteSpecificationFromAttachedRole(port,xobject,"String_Node_Str");
break;
case TreeObject.CATEGORY_FOLDER:
break;
case TreeObject.ROLE:
deleteSpecificationFromAttachedRole(port,xobject,"String_Node_Str");
break;
case TreeObject.SYNCHRONIZATIONPLAN:
deleteSpecificationFromAttachedRole(port,xobject,"String_Node_Str");
break;
case TreeObject.UNIVERSE:
deleteSpecificationFromAttachedRole(port,xobject,"String_Node_Str");
break;
default :
return;
}
if (xobject.getParent() != null) {
LocalTreeObjectRepository.getInstance().switchOffSynchronize();
xobject.getParent().removeChild(xobject);
LocalTreeObjectRepository.getInstance().swithOnSynchronize();
}
view.getViewer().refresh();
}

Fixed version (ground truth):
public static void deleteTreeObject(TreeObject xobject,ServerView view) throws Exception {
  XtentisPort port=Util.getPort(new URL(xobject.getEndpointAddress()),xobject.getUniverse(),xobject.getUsername(),xobject.getPassword());
  java.util.List<IAvailableModel> availablemodels=AvailableModelUtil.getAvailableModels();
  for (  IAvailableModel model : availablemodels) {
    model.deleteTreeObject(port,xobject);
  }
switch (xobject.getType()) {
case TreeObject.DATA_MODEL:
    port.deleteDataModel(new WSDeleteDataModel((WSDataModelPK)xobject.getWsKey()));
  deleteSpecificationFromAttachedRole(port,xobject,EXtentisObjects.DataMODEL.getName());
break;
case TreeObject.VIEW:
port.deleteView(new WSDeleteView((WSViewPK)xobject.getWsKey()));
deleteSpecificationFromAttachedRole(port,xobject,EXtentisObjects.View.getName());
break;
case TreeObject.DATA_CLUSTER:
port.deleteDataCluster(new WSDeleteDataCluster((WSDataClusterPK)xobject.getWsKey()));
deleteSpecificationFromAttachedRole(port,xobject,EXtentisObjects.DataCluster.getName());
break;
case TreeObject.STORED_PROCEDURE:
port.deleteStoredProcedure(new WSDeleteStoredProcedure((WSStoredProcedurePK)xobject.getWsKey()));
break;
case TreeObject.ROUTING_RULE:
port.deleteRoutingRule(new WSDeleteRoutingRule((WSRoutingRulePK)xobject.getWsKey()));
deleteSpecificationFromAttachedRole(port,xobject,EXtentisObjects.RoutingRule.getName());
break;
case TreeObject.TRANSFORMER:
port.deleteTransformerV2(new WSDeleteTransformerV2((WSTransformerV2PK)xobject.getWsKey()));
deleteSpecificationFromAttachedRole(port,xobject,EXtentisObjects.Transformer.getName());
break;
case TreeObject.MENU:
port.deleteMenu(new WSDeleteMenu((WSMenuPK)xobject.getWsKey()));
deleteSpecificationFromAttachedRole(port,xobject,EXtentisObjects.Menu.getName());
break;
case TreeObject.CATEGORY_FOLDER:
break;
case TreeObject.ROLE:
deleteSpecificationFromAttachedRole(port,xobject,EXtentisObjects.Role.getName());
break;
case TreeObject.SYNCHRONIZATIONPLAN:
deleteSpecificationFromAttachedRole(port,xobject,EXtentisObjects.SynchronizationPlan.getName());
break;
case TreeObject.UNIVERSE:
deleteSpecificationFromAttachedRole(port,xobject,EXtentisObjects.Universe.getName());
break;
default :
return;
}
if (xobject.getParent() != null) {
LocalTreeObjectRepository.getInstance().switchOffSynchronize();
xobject.getParent().removeChild(xobject);
LocalTreeObjectRepository.getInstance().swithOnSynchronize();
}
view.getViewer().refresh();
}