Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordonald.g.dunne2012-10-30 15:09:22 +0000
committerRoberto E. Escobar2012-10-30 15:09:22 +0000
commit3d91127f916dcc7d6c6d51805765db56e42be2fe (patch)
tree5c2dcbcc08e554b2dd099691a72fe9048effe2d6 /plugins/org.eclipse.osee.framework.access
parentaf9dd5ee5dc016fa8a678a053a5a6b6564ba0601 (diff)
downloadorg.eclipse.osee-3d91127f916dcc7d6c6d51805765db56e42be2fe.tar.gz
org.eclipse.osee-3d91127f916dcc7d6c6d51805765db56e42be2fe.tar.xz
org.eclipse.osee-3d91127f916dcc7d6c6d51805765db56e42be2fe.zip
refinement: Improve AccessControlCacheHandler to support deleted branches
Diffstat (limited to 'plugins/org.eclipse.osee.framework.access')
-rw-r--r--plugins/org.eclipse.osee.framework.access/src/org/eclipse/osee/framework/access/internal/AccessControlCacheHandler.java5
-rw-r--r--plugins/org.eclipse.osee.framework.access/src/org/eclipse/osee/framework/access/internal/data/BranchAccessObject.java7
2 files changed, 9 insertions, 3 deletions
diff --git a/plugins/org.eclipse.osee.framework.access/src/org/eclipse/osee/framework/access/internal/AccessControlCacheHandler.java b/plugins/org.eclipse.osee.framework.access/src/org/eclipse/osee/framework/access/internal/AccessControlCacheHandler.java
index 178c3f354a6..039a4edfd32 100644
--- a/plugins/org.eclipse.osee.framework.access/src/org/eclipse/osee/framework/access/internal/AccessControlCacheHandler.java
+++ b/plugins/org.eclipse.osee.framework.access/src/org/eclipse/osee/framework/access/internal/AccessControlCacheHandler.java
@@ -11,7 +11,6 @@
package org.eclipse.osee.framework.access.internal;
import java.util.List;
-
import org.eclipse.osee.framework.access.AccessControlData;
import org.eclipse.osee.framework.access.AccessObject;
import org.eclipse.osee.framework.access.internal.data.BranchAccessObject;
@@ -24,7 +23,9 @@ public class AccessControlCacheHandler {
public void updateAccessListForBranchObject(AccessControlService service, final String branchGuid) throws OseeCoreException {
BranchAccessObject branchAccessObject = BranchAccessObject.getBranchAccessObject(branchGuid);
- updateAccessList(service, branchAccessObject);
+ if (branchAccessObject != null) {
+ updateAccessList(service, branchAccessObject);
+ }
}
public void updateAccessList(AccessControlService service, AccessObject accessObject) throws OseeCoreException {
diff --git a/plugins/org.eclipse.osee.framework.access/src/org/eclipse/osee/framework/access/internal/data/BranchAccessObject.java b/plugins/org.eclipse.osee.framework.access/src/org/eclipse/osee/framework/access/internal/data/BranchAccessObject.java
index d4335e5c2c7..569173afc6a 100644
--- a/plugins/org.eclipse.osee.framework.access/src/org/eclipse/osee/framework/access/internal/data/BranchAccessObject.java
+++ b/plugins/org.eclipse.osee.framework.access/src/org/eclipse/osee/framework/access/internal/data/BranchAccessObject.java
@@ -15,6 +15,7 @@ import java.util.Map;
import org.eclipse.osee.framework.access.AccessObject;
import org.eclipse.osee.framework.core.data.IOseeBranch;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
+import org.eclipse.osee.framework.core.model.Branch;
import org.eclipse.osee.framework.database.core.ConnectionHandler;
import org.eclipse.osee.framework.skynet.core.artifact.BranchManager;
@@ -57,7 +58,11 @@ public class BranchAccessObject extends AccessObject {
}
public static BranchAccessObject getBranchAccessObject(String branchGuid) throws OseeCoreException {
- return getBranchAccessObject(BranchManager.getBranchByGuid(branchGuid));
+ if (BranchManager.branchExists(branchGuid)) {
+ Branch branch = BranchManager.getBranchByGuid(branchGuid);
+ return getBranchAccessObject(branch);
+ }
+ return null;
}
public static BranchAccessObject getBranchAccessObject(int branchId) {

Back to the top