Program: 97570
Project: 97570
Buggy source:
private void processRelations(ArtifactEvent artifactEvent,boolean handledConfigReload){
  if (!handledConfigReload) {
    for (    EventBasicGuidRelation guidRel : artifactEvent.getRelations()) {
      try {
        RelationType typeByGuid=RelationTypeManager.getTypeByGuid(guidRel.getRelTypeGuid());
        if (configReloadRelationTypeGuids.contains(typeByGuid.getGuid())) {
          AtsBulkLoad.reloadConfig(false);
          break;
        }
      }
 catch (      OseeCoreException ex) {
        OseeLog.log(Activator.class,Level.SEVERE,ex);
      }
    }
  }
  for (  EventBasicGuidRelation guidRel : artifactEvent.getRelations()) {
    try {
      if (guidRel.is(AtsRelationTypes.TeamWorkflowTargetedForVersion_Workflow)) {
        for (        TeamWorkFlowArtifact teamArt : ArtifactCache.getActive(guidRel,TeamWorkFlowArtifact.class)) {
          Artifact verArt=null;
          try {
            verArt=teamArt.getRelatedArtifact(AtsRelationTypes.TeamWorkflowTargetedForVersion_Version);
          }
 catch (          ArtifactDoesNotExist ex) {
          }
          if (verArt == null) {
            AtsVersionService.get().removeTargetedVersion(teamArt);
          }
 else {
            IAtsVersion version=AtsConfigCache.instance.getSoleByGuid(verArt.getGuid(),IAtsVersion.class);
            AtsVersionService.get().setTargetedVersion(teamArt,version);
          }
        }
      }
      if (guidRel.is(AtsRelationTypes.SmaToTask_Task)) {
        for (        TaskArtifact taskArt : ArtifactCache.getActive(guidRel,TaskArtifact.class)) {
          AtsTaskCache.decache(taskArt.getParent());
        }
        for (        Artifact artifact : ArtifactCache.getActive(guidRel)) {
          if (artifact instanceof AbstractTaskableArtifact) {
            AtsTaskCache.decache(artifact);
          }
        }
      }
    }
 catch (    OseeCoreException ex) {
      OseeLog.log(Activator.class,Level.SEVERE,ex);
    }
  }
}

Fixed version (ground truth):
private void processRelations(ArtifactEvent artifactEvent,boolean handledConfigReload){
  if (!handledConfigReload) {
    for (    EventBasicGuidRelation guidRel : artifactEvent.getRelations()) {
      try {
        RelationType typeByGuid=RelationTypeManager.getTypeByGuid(guidRel.getRelTypeGuid());
        if (configReloadRelationTypeGuids.contains(typeByGuid.getGuid())) {
          AtsBulkLoad.reloadConfig(false);
          break;
        }
      }
 catch (      OseeCoreException ex) {
        OseeLog.log(Activator.class,Level.SEVERE,ex);
      }
    }
  }
  for (  EventBasicGuidRelation guidRel : artifactEvent.getRelations()) {
    try {
      if (guidRel.is(AtsRelationTypes.TeamWorkflowTargetedForVersion_Workflow)) {
        for (        TeamWorkFlowArtifact teamArt : ArtifactCache.getActive(guidRel,TeamWorkFlowArtifact.class)) {
          Artifact verArt=null;
          try {
            verArt=teamArt.getRelatedArtifact(AtsRelationTypes.TeamWorkflowTargetedForVersion_Version);
          }
 catch (          ArtifactDoesNotExist ex) {
          }
          if (verArt == null) {
            AtsVersionService.get().removeTargetedVersion(teamArt);
          }
 else {
            IAtsVersion version=AtsConfigCache.instance.getSoleByGuid(verArt.getGuid(),IAtsVersion.class);
            AtsVersionService.get().setTargetedVersion(teamArt,version);
          }
        }
      }
      if (guidRel.is(AtsRelationTypes.SmaToTask_Task)) {
        for (        TaskArtifact taskArt : ArtifactCache.getActive(guidRel,TaskArtifact.class)) {
          AtsTaskCache.decache(taskArt.getParentAWA());
        }
        for (        Artifact artifact : ArtifactCache.getActive(guidRel)) {
          if (artifact instanceof AbstractTaskableArtifact) {
            AtsTaskCache.decache(artifact);
          }
        }
      }
      if (guidRel.is(AtsRelationTypes.TeamWorkflowToReview_Review)) {
        for (        AbstractReviewArtifact review : ArtifactCache.getActive(guidRel,AbstractReviewArtifact.class)) {
          AtsReviewCache.decache(review.getParentAWA());
        }
        for (        Artifact artifact : ArtifactCache.getActive(guidRel)) {
          if (artifact instanceof AbstractReviewArtifact) {
            AtsReviewCache.decache(artifact);
          }
        }
      }
    }
 catch (    OseeCoreException ex) {
      OseeLog.log(Activator.class,Level.SEVERE,ex);
    }
  }
}