Program: 97120
Project: 97120
Buggy source:
private void safelyProcessHandler(final ArtifactEvent artifactEvent,final ISMAEditorEventHandler handler) throws OseeCoreException {
  final AbstractWorkflowArtifact awa=handler.getSMAEditor().getAwa();
  boolean refreshed=false;
  if (artifactEvent.isDeletedPurged(awa)) {
    handler.getSMAEditor().closeEditor();
  }
 else   if (workflowModifiedOrReloaded(artifactEvent,awa) || workflowRelationIsAddedChangedOrDeleted(artifactEvent,awa) || workflowActionIsModifedOrReloaded(artifactEvent,awa)|| workflowActionRelationIsAddedChangedOrDeleted(artifactEvent,awa)|| teamWorkflowParallelConfigurationChanged(artifactEvent,awa)) {
    refreshed=true;
    Displays.ensureInDisplayThread(new Runnable(){
      @Override public void run(){
        handler.getSMAEditor().refreshPages();
      }
    }
);
  }
 else   if (isReloaded(artifactEvent,awa)) {
    SMAEditor.close(Collections.singleton(awa),false);
    if (!awa.isDeleted()) {
      SMAEditor.editArtifact(awa);
    }
  }
  if (!refreshed && awa.isTeamWorkflow() && ReviewManager.hasReviews((TeamWorkFlowArtifact)awa)) {
    try {
      for (      AbstractReviewArtifact reviewArt : ReviewManager.getReviews((TeamWorkFlowArtifact)awa)) {
        if (artifactEvent.isHasEvent(reviewArt)) {
          refreshed=true;
          Displays.ensureInDisplayThread(new Runnable(){
            @Override public void run(){
              handler.getSMAEditor().refreshPages();
            }
          }
);
          break;
        }
      }
    }
 catch (    Exception ex) {
    }
  }
  if (!refreshed && awa.isTeamWorkflow() && ((TeamWorkFlowArtifact)awa).hasTaskArtifacts()) {
    try {
      for (      TaskArtifact taskArt : ((TeamWorkFlowArtifact)awa).getTaskArtifactsFromCurrentState()) {
        if (artifactEvent.isHasEvent(taskArt)) {
          refreshed=true;
          Displays.ensureInDisplayThread(new Runnable(){
            @Override public void run(){
              handler.getSMAEditor().refreshPages();
            }
          }
);
          break;
        }
      }
    }
 catch (    Exception ex) {
    }
  }
  if (!refreshed) {
    try {
      for (      TeamWorkFlowArtifact teamWf : ActionManager.getTeams(awa.getParentActionArtifact())) {
        ActionArtifact parentAction=teamWf.getParentActionArtifact();
        if (!awa.equals(teamWf) && (artifactEvent.isHasEvent(teamWf) || (parentAction != null && artifactEvent.isRelAddedChangedDeleted(parentAction)))) {
          refreshed=true;
          Displays.ensureInDisplayThread(new Runnable(){
            @Override public void run(){
              handler.getSMAEditor().refreshPages();
            }
          }
);
          return;
        }
      }
    }
 catch (    Exception ex) {
    }
  }
}

Fixed version (ground truth):
private void safelyProcessHandler(final ArtifactEvent artifactEvent,final ISMAEditorEventHandler handler) throws OseeCoreException {
  final AbstractWorkflowArtifact awa=handler.getSMAEditor().getAwa();
  boolean refreshed=false;
  if (artifactEvent.isDeletedPurged(awa)) {
    handler.getSMAEditor().closeEditor();
  }
 else   if (workflowModifiedOrReloaded(artifactEvent,awa) || workflowRelationIsAddedChangedOrDeleted(artifactEvent,awa) || workflowActionIsModifedOrReloaded(artifactEvent,awa)|| workflowActionRelationIsAddedChangedOrDeleted(artifactEvent,awa)|| teamWorkflowParallelConfigurationChanged(artifactEvent,awa)) {
    refreshed=true;
    Displays.ensureInDisplayThread(new Runnable(){
      @Override public void run(){
        handler.getSMAEditor().refreshPages();
      }
    }
);
  }
 else   if (isReloaded(artifactEvent,awa)) {
    SMAEditor.close(Collections.singleton(awa),false);
    if (!awa.isDeleted()) {
      SMAEditor.editArtifact(awa);
    }
  }
  if (!refreshed && awa.isTeamWorkflow() && ReviewManager.hasReviews((TeamWorkFlowArtifact)awa)) {
    try {
      for (      AbstractReviewArtifact reviewArt : ReviewManager.getReviews((TeamWorkFlowArtifact)awa)) {
        if (artifactEvent.isHasEvent(reviewArt)) {
          refreshed=true;
          Displays.ensureInDisplayThread(new Runnable(){
            @Override public void run(){
              handler.getSMAEditor().refreshPages();
            }
          }
);
          break;
        }
      }
    }
 catch (    Exception ex) {
    }
  }
  if (!refreshed && awa.isTeamWorkflow() && ((TeamWorkFlowArtifact)awa).hasTaskArtifacts()) {
    try {
      for (      TaskArtifact taskArt : ((TeamWorkFlowArtifact)awa).getTaskArtifactsFromCurrentState()) {
        if (artifactEvent.isHasEvent(taskArt)) {
          refreshed=true;
          Displays.ensureInDisplayThread(new Runnable(){
            @Override public void run(){
              handler.getSMAEditor().refreshPages();
            }
          }
);
          break;
        }
      }
    }
 catch (    Exception ex) {
    }
  }
  if (!refreshed) {
    try {
      for (      TeamWorkFlowArtifact teamWf : ActionManager.getTeams(awa.getParentActionArtifact())) {
        ActionArtifact parentAction=teamWf.getParentActionArtifact();
        if (!awa.equals(teamWf) && (artifactEvent.isHasEvent(teamWf) && (parentAction != null && artifactEvent.isRelAddedChangedDeleted(parentAction)))) {
          refreshed=true;
          Displays.ensureInDisplayThread(new Runnable(){
            @Override public void run(){
              handler.getSMAEditor().refreshPages();
            }
          }
);
          return;
        }
      }
    }
 catch (    Exception ex) {
    }
  }
}