Program: 167492
Project: 167492
Buggy source:
@Override public void componentEvent(Event e){
  IConfigurationService configurationService=context.getConfigurationService();
  if (e instanceof NodeSelectedEvent) {
    NodeSelectedEvent event=(NodeSelectedEvent)e;
    Node node=event.getNode();
    FlowStep flowStep=flow.findFlowStepWithId(node.getId());
    selected=flowStep;
    propertySheet.valueChange(flowStep);
    delButton.setEnabled(true);
  }
 else   if (e instanceof NodeDoubleClickedEvent) {
    NodeDoubleClickedEvent event=(NodeDoubleClickedEvent)e;
    Node node=event.getNode();
    FlowStep flowStep=flow.findFlowStepWithId(node.getId());
    projectNavigator.open(flowStep,flow,propertySheet);
  }
 else   if (e instanceof NodeMovedEvent) {
    NodeMovedEvent event=(NodeMovedEvent)e;
    Node node=event.getNode();
    FlowStep flowStep=flow.findFlowStepWithId(node.getId());
    if (flowStep != null) {
      flowStep.setX(node.getX());
      flowStep.setY(node.getY());
    }
    configurationService.save(flow);
  }
 else   if (e instanceof LinkEvent) {
    LinkEvent event=(LinkEvent)e;
    if (!event.isRemoved()) {
      flow.getFlowStepLinks().add(new FlowStepLink(event.getSourceNodeId(),event.getTargetNodeId()));
      configurationService.save(flow);
    }
 else {
      FlowStepLink link=flow.removeFlowStepLink(event.getSourceNodeId(),event.getTargetNodeId());
      if (link != null) {
        if (configurationService.delete(link)) {
          redrawFlow();
        }
      }
    }
  }
 else   if (e instanceof LinkSelectedEvent) {
    LinkSelectedEvent event=(LinkSelectedEvent)e;
    selected=flow.findFlowStepLink(event.getSourceNodeId(),event.getTargetNodeId());
    delButton.setEnabled(true);
  }
}

Fixed version (ground truth):
@Override public void componentEvent(Event e){
  IConfigurationService configurationService=context.getConfigurationService();
  if (e instanceof NodeSelectedEvent) {
    NodeSelectedEvent event=(NodeSelectedEvent)e;
    Node node=event.getNode();
    FlowStep flowStep=flow.findFlowStepWithId(node.getId());
    selected=flowStep;
    propertySheet.valueChange(flowStep);
    delButton.setEnabled(true);
  }
 else   if (e instanceof NodeDoubleClickedEvent) {
    NodeDoubleClickedEvent event=(NodeDoubleClickedEvent)e;
    Node node=event.getNode();
    FlowStep flowStep=flow.findFlowStepWithId(node.getId());
    projectNavigator.open(flowStep,flow,propertySheet);
  }
 else   if (e instanceof NodeMovedEvent) {
    NodeMovedEvent event=(NodeMovedEvent)e;
    Node node=event.getNode();
    FlowStep flowStep=flow.findFlowStepWithId(node.getId());
    if (flowStep != null) {
      flowStep.setX(node.getX());
      flowStep.setY(node.getY());
    }
    configurationService.save(flow);
  }
 else   if (e instanceof LinkEvent) {
    LinkEvent event=(LinkEvent)e;
    if (!event.isRemoved()) {
      flow.getFlowStepLinks().add(new FlowStepLink(event.getSourceNodeId(),event.getTargetNodeId()));
      Component sourceComp=flow.findFlowStepWithId(event.getSourceNodeId()).getComponent();
      Component targetComp=flow.findFlowStepWithId(event.getTargetNodeId()).getComponent();
      IComponentFactory factory=context.getComponentFactory();
      ComponentDefinition sourceDefn=factory.getComponentDefinitionForComponentType(sourceComp.getType());
      if (targetComp.getInputModel() == null) {
        if (sourceComp.getOutputModel() != null) {
          targetComp.setInputModel(sourceComp.getOutputModel());
        }
 else         if (sourceDefn.inputOutputModelsMatch() && sourceComp.getInputModel() != null) {
          targetComp.setInputModel(sourceComp.getInputModel());
        }
      }
      if (sourceComp.getOutputModel() == null) {
        if (targetComp.getInputModel() != null) {
          sourceComp.setOutputModel(targetComp.getInputModel());
        }
      }
      if (sourceComp.getInputModel() == null && sourceDefn.inputOutputModelsMatch()) {
        if (targetComp.getInputModel() != null) {
          sourceComp.setInputModel(targetComp.getInputModel());
        }
      }
      configurationService.save(flow);
    }
 else {
      FlowStepLink link=flow.removeFlowStepLink(event.getSourceNodeId(),event.getTargetNodeId());
      if (link != null) {
        if (configurationService.delete(link)) {
          redrawFlow();
        }
      }
    }
  }
 else   if (e instanceof LinkSelectedEvent) {
    LinkSelectedEvent event=(LinkSelectedEvent)e;
    selected=flow.findFlowStepLink(event.getSourceNodeId(),event.getTargetNodeId());
    delButton.setEnabled(true);
  }
}