Program: 136272
Project: 136272
Buggy source:
private void runCommand(CommandType type){
  ResourceNode rn=null;
  if (selectedNode.getOwningComponent() instanceof ResourceNode)   rn=(ResourceNode)selectedNode.getOwningComponent();
  if (selectedNode == null) {
    return;
  }
switch (type) {
case DELETE:
    Node owner=selectedNode.getOwningComponent();
  for (  Node n : view.getSelectedNodes())   if (owner.isEditable() && n.isDeleteable())   n.delete();
 else   postWarning(type,n);
view.refresh(owner);
if (owner instanceof ResourceNode) OtmRegistry.getNavigatorView().refresh();
break;
case RESOURCE:
LibraryNode effectiveLib=getEffectiveLibrary(selectedNode);
if (effectiveLib != null) {
ResourceNode newR=new ResourceNode(effectiveLib,predicate);
if (predicate == null) predicate=getBusinessObject(newR);
if (predicate == null) newR.setAbstract(true);
 else new ResourceBuilder().build(newR,predicate);
if (view != null) {
view.select(newR);
view.refresh(newR);
}
mc.refresh();
}
 else postWarning(type);
break;
case ACTION:
if (rn != null) view.refresh(new ActionNode(rn));
 else postWarning(type);
break;
case ACTIONFACET:
if (rn != null) view.refresh(new ActionFacet(rn));
 else postWarning(type);
break;
case PARAMGROUP:
if (rn != null) view.refresh(new ParamGroup(rn));
 else postWarning(type);
break;
case ACTIONRESPONSE:
if (selectedNode instanceof ActionNode) view.refresh(new ActionResponse((ActionNode)selectedNode));
 else postWarning(type);
break;
case PARENTREF:
if (selectedNode instanceof ResourceNode) view.refresh(new ParentRef((ResourceNode)selectedNode));
 else postWarning(type);
break;
case NONE:
default :
DialogUserNotifier.openWarning("String_Node_Str","String_Node_Str");
}
}

Fixed version (ground truth):
private void runCommand(CommandType type){
  ResourceNode rn=null;
  if (selectedNode.getOwningComponent() instanceof ResourceNode)   rn=(ResourceNode)selectedNode.getOwningComponent();
  if (selectedNode == null) {
    return;
  }
switch (type) {
case DELETE:
    Node owner=selectedNode.getOwningComponent();
  for (  Node n : view.getSelectedNodes())   if (owner.isEditable() && n.isDeleteable())   n.delete();
 else   postWarning(type,n);
view.refresh(owner);
if (owner instanceof ResourceNode) OtmRegistry.getNavigatorView().refresh();
break;
case RESOURCE:
LibraryNode effectiveLib=getEffectiveLibrary(selectedNode);
if (effectiveLib != null) {
ResourceNode newR=new ResourceNode(effectiveLib,predicate);
if (predicate == null) predicate=getBusinessObject(newR);
if (predicate == null) newR.delete();
 else new ResourceBuilder().build(newR,predicate);
if (view != null) {
view.select(newR);
view.refresh(newR);
}
mc.refresh();
}
 else postWarning(type);
break;
case ACTION:
if (rn != null) view.refresh(new ActionNode(rn));
 else postWarning(type);
break;
case ACTIONFACET:
if (rn != null) view.refresh(new ActionFacet(rn));
 else postWarning(type);
break;
case PARAMGROUP:
if (rn != null) view.refresh(new ParamGroup(rn));
 else postWarning(type);
break;
case ACTIONRESPONSE:
if (selectedNode instanceof ActionNode) view.refresh(new ActionResponse((ActionNode)selectedNode));
 else postWarning(type);
break;
case PARENTREF:
if (selectedNode instanceof ResourceNode) view.refresh(new ParentRef((ResourceNode)selectedNode));
 else postWarning(type);
break;
case NONE:
default :
DialogUserNotifier.openWarning("String_Node_Str","String_Node_Str");
}
}