Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoberto E. Escobar2012-01-18 20:58:40 +0000
committerRyan D. Brooks2012-01-18 20:58:40 +0000
commitbb949b8ac4ea737d715c7c857383bdaf229ba575 (patch)
tree28093cf7983a74ea56d5e92cfaf5da7d18c015f6
parent5e164bd0119e277386c2a2cfac70faa4c0148cae (diff)
downloadorg.eclipse.osee-bb949b8ac4ea737d715c7c857383bdaf229ba575.tar.gz
org.eclipse.osee-bb949b8ac4ea737d715c7c857383bdaf229ba575.tar.xz
org.eclipse.osee-bb949b8ac4ea737d715c7c857383bdaf229ba575.zip
bug[ats_64YBQ]: Branch.isEditable should check for Commit In Progress and return false
-rw-r--r--plugins/org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/commit/CommitDbOperation.java2
-rw-r--r--plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/Branch.java2
-rw-r--r--plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/enums/BranchState.java4
3 files changed, 6 insertions, 2 deletions
diff --git a/plugins/org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/commit/CommitDbOperation.java b/plugins/org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/commit/CommitDbOperation.java
index c3ccc3e748a..2346216235b 100644
--- a/plugins/org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/commit/CommitDbOperation.java
+++ b/plugins/org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/commit/CommitDbOperation.java
@@ -125,7 +125,7 @@ public class CommitDbOperation extends AbstractDbTxOperation {
int count =
getDatabaseService().runPreparedQueryFetchObject(0, SELECT_SOURCE_BRANCH_STATE, sourceBranch.getId(),
BranchState.COMMIT_IN_PROGRESS.getValue());
- if (sourceBranch.getBranchState().equals(BranchState.COMMIT_IN_PROGRESS) || sourceBranch.getArchiveState().isArchived() || count > 0) {
+ if (sourceBranch.getBranchState().isCommitInProgress() || sourceBranch.getArchiveState().isArchived() || count > 0) {
throw new OseeStateException("Commit completed or in progress for [%s]", sourceBranch);
}
diff --git a/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/Branch.java b/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/Branch.java
index c3aa8d227ab..a604bed9293 100644
--- a/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/Branch.java
+++ b/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/Branch.java
@@ -151,7 +151,7 @@ public class Branch extends AbstractOseeType<String> implements IAdaptable, IOse
public boolean isEditable() {
BranchState state = getBranchState();
- return !state.isCommitted() && !state.isRebaselined() && //
+ return !state.isCommitInProgress() && !state.isCommitted() && !state.isRebaselined() && //
!state.isDeleted() && !state.isCreationInProgress() && //
!getArchiveState().isArchived() && !isPurged();
}
diff --git a/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/enums/BranchState.java b/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/enums/BranchState.java
index 2f0a1a389bc..5580e3d573a 100644
--- a/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/enums/BranchState.java
+++ b/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/enums/BranchState.java
@@ -34,6 +34,10 @@ public enum BranchState {
return value;
}
+ public boolean isCommitInProgress() {
+ return this == BranchState.COMMIT_IN_PROGRESS;
+ }
+
public boolean isCommitted() {
return this == BranchState.COMMITTED;
}

Back to the top