summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorshawn.f.cook2011-12-12 16:49:19 (EST)
committerRoberto E. Escobar2011-12-12 16:50:54 (EST)
commit1c9a7adbcaa66f526d585a45dc2613e3d0ff7e7b (patch)
treefc88a3ab5e7336ae24612fa0b29964f5838c1ee7
parent8a054099cdcb6854618cef06b22032e1aa8744eb (diff)
downloadorg.eclipse.osee-1c9a7adbcaa66f526d585a45dc2613e3d0ff7e7b.zip
org.eclipse.osee-1c9a7adbcaa66f526d585a45dc2613e3d0ff7e7b.tar.gz
org.eclipse.osee-1c9a7adbcaa66f526d585a45dc2613e3d0ff7e7b.tar.bz2
bug[bgz_366448]: AtsBranchManagerCore.getEarliestTransactionId() throwing exception
-rw-r--r--plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/branch/AtsBranchManagerCore.java16
1 files changed, 9 insertions, 7 deletions
diff --git a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/branch/AtsBranchManagerCore.java b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/branch/AtsBranchManagerCore.java
index c0464ca..9a35794 100644
--- a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/branch/AtsBranchManagerCore.java
+++ b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/branch/AtsBranchManagerCore.java
@@ -479,13 +479,15 @@ public class AtsBranchManagerCore {
public static TransactionRecord getEarliestTransactionId(TeamWorkFlowArtifact teamArt) throws OseeCoreException {
Collection<TransactionRecord> transactionIds = getTransactionIds(teamArt, false);
- if (transactionIds.size() == 1) {
- return transactionIds.iterator().next();
- }
- TransactionRecord earliestTransactionId = transactionIds.iterator().next();
- for (TransactionRecord transactionId : transactionIds) {
- if (transactionId.getId() < earliestTransactionId.getId()) {
- earliestTransactionId = transactionId;
+ TransactionRecord earliestTransactionId;
+ if (transactionIds.isEmpty()) {
+ earliestTransactionId = null;
+ } else {
+ earliestTransactionId = transactionIds.iterator().next();
+ for (TransactionRecord transactionId : transactionIds) {
+ if (transactionId.getId() < earliestTransactionId.getId()) {
+ earliestTransactionId = transactionId;
+ }
}
}
return earliestTransactionId;