Program: 96771
Project: 96771
Buggy source:
public static boolean promptChangeVersion(final Collection<? extends TeamWorkFlowArtifact> awas,VersionReleaseType versionReleaseType,VersionLockedType versionLockType) throws OseeCoreException {
  IAtsTeamDefinition teamDefHoldingVersions=null;
  for (  TeamWorkFlowArtifact teamArt : awas) {
    if (!teamArt.getTeamDefinition().isTeamUsesVersions()) {
      AWorkbench.popup("String_Node_Str","String_Node_Str" + teamArt.getTeamDefinition().getName() + "String_Node_Str");
      return false;
    }
    if (AtsClientService.get().getVersionService().isReleased(teamArt) || AtsClientService.get().getVersionService().isVersionLocked(teamArt)) {
      String error="String_Node_Str" + teamArt.getName() + "String_Node_Str";
      if (AtsUtilClient.isAtsAdmin() && !MessageDialog.openConfirm(Displays.getActiveShell(),"String_Node_Str",error + "String_Node_Str")) {
        return false;
      }
 else       if (!AtsUtilClient.isAtsAdmin()) {
        AWorkbench.popup("String_Node_Str",error);
        continue;
      }
    }
    if (teamDefHoldingVersions != null && teamDefHoldingVersions != teamArt.getTeamDefinition().getTeamDefinitionHoldingVersions()) {
      AWorkbench.popup("String_Node_Str","String_Node_Str");
      return false;
    }
    if (teamDefHoldingVersions == null) {
      teamDefHoldingVersions=teamArt.getTeamDefinition().getTeamDefinitionHoldingVersions();
    }
  }
  if (teamDefHoldingVersions == null) {
    AWorkbench.popup("String_Node_Str","String_Node_Str");
    return false;
  }
  TeamWorkFlowArtifact teamArt=awas.iterator().next();
  final VersionListDialog dialog=new VersionListDialog("String_Node_Str","String_Node_Str",teamDefHoldingVersions.getVersions(versionReleaseType,versionLockType));
  if (awas.size() == 1 && AtsClientService.get().getVersionService().hasTargetedVersion(teamArt)) {
    dialog.setInitialSelections(Arrays.asList(AtsClientService.get().getVersionService().getTargetedVersion(teamArt)));
  }
  int result=dialog.open();
  if (result != 0) {
    return false;
  }
  Object obj=dialog.getSelectedFirst();
  IAtsVersion newVersion=(IAtsVersion)obj;
  if (newVersion != null && newVersion.isVersionLocked()) {
    String error="String_Node_Str" + newVersion.getCommitFullDisplayName() + "String_Node_Str";
    if (AtsUtilClient.isAtsAdmin() && !MessageDialog.openConfirm(Displays.getActiveShell(),"String_Node_Str",error + "String_Node_Str")) {
      return false;
    }
 else     if (!AtsUtilClient.isAtsAdmin()) {
      AWorkbench.popup("String_Node_Str",error);
    }
  }
  IAtsChangeSet changes=AtsClientService.get().createChangeSet("String_Node_Str");
  for (  TeamWorkFlowArtifact teamArt1 : awas) {
    AtsClientService.get().getVersionService().setTargetedVersion(teamArt1,newVersion,changes);
  }
  changes.execute();
  ArtifactQuery.reloadArtifacts(awas);
  return true;
}

Fixed version (ground truth):
public static boolean promptChangeVersion(final Collection<? extends TeamWorkFlowArtifact> awas,VersionReleaseType versionReleaseType,VersionLockedType versionLockType) throws OseeCoreException {
  IAtsTeamDefinition teamDefHoldingVersions=null;
  for (  TeamWorkFlowArtifact teamArt : awas) {
    if (!teamArt.getTeamDefinition().isTeamUsesVersions()) {
      AWorkbench.popup("String_Node_Str","String_Node_Str" + teamArt.getTeamDefinition().getName() + "String_Node_Str");
      return false;
    }
    if (AtsClientService.get().getVersionService().isReleased(teamArt) || AtsClientService.get().getVersionService().isVersionLocked(teamArt)) {
      String error="String_Node_Str" + teamArt.getName() + "String_Node_Str";
      if (AtsUtilClient.isAtsAdmin() && !MessageDialog.openConfirm(Displays.getActiveShell(),"String_Node_Str",error + "String_Node_Str")) {
        return false;
      }
 else       if (!AtsUtilClient.isAtsAdmin()) {
        AWorkbench.popup("String_Node_Str",error);
        continue;
      }
    }
    if (teamDefHoldingVersions != null && !teamDefHoldingVersions.equals(teamArt.getTeamDefinition().getTeamDefinitionHoldingVersions())) {
      AWorkbench.popup("String_Node_Str","String_Node_Str");
      return false;
    }
    if (teamDefHoldingVersions == null) {
      teamDefHoldingVersions=teamArt.getTeamDefinition().getTeamDefinitionHoldingVersions();
    }
  }
  if (teamDefHoldingVersions == null) {
    AWorkbench.popup("String_Node_Str","String_Node_Str");
    return false;
  }
  TeamWorkFlowArtifact teamArt=awas.iterator().next();
  final VersionListDialog dialog=new VersionListDialog("String_Node_Str","String_Node_Str",teamDefHoldingVersions.getVersions(versionReleaseType,versionLockType));
  if (awas.size() == 1 && AtsClientService.get().getVersionService().hasTargetedVersion(teamArt)) {
    dialog.setInitialSelections(Arrays.asList(AtsClientService.get().getVersionService().getTargetedVersion(teamArt)));
  }
  int result=dialog.open();
  if (result != 0) {
    return false;
  }
  Object obj=dialog.getSelectedFirst();
  IAtsVersion newVersion=(IAtsVersion)obj;
  if (newVersion != null && newVersion.isVersionLocked()) {
    String error="String_Node_Str" + newVersion.getCommitFullDisplayName() + "String_Node_Str";
    if (AtsUtilClient.isAtsAdmin() && !MessageDialog.openConfirm(Displays.getActiveShell(),"String_Node_Str",error + "String_Node_Str")) {
      return false;
    }
 else     if (!AtsUtilClient.isAtsAdmin()) {
      AWorkbench.popup("String_Node_Str",error);
    }
  }
  IAtsChangeSet changes=AtsClientService.get().createChangeSet("String_Node_Str");
  for (  TeamWorkFlowArtifact teamArt1 : awas) {
    AtsClientService.get().getVersionService().setTargetedVersion(teamArt1,newVersion,changes);
  }
  changes.execute();
  ArtifactQuery.reloadArtifacts(awas);
  return true;
}