Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorddunne2010-09-30 13:47:32 -0400
committerRyan D. Brooks2010-09-30 13:47:32 -0400
commit16998f1cef759153975a429a1918e623f226f819 (patch)
tree40648b1603477b869ffe4ea9c0f880d47fdd3454 /plugins
parentc24bedcf5269da35404b92dd033ef4c29ee08796 (diff)
downloadorg.eclipse.osee-16998f1cef759153975a429a1918e623f226f819.tar.gz
org.eclipse.osee-16998f1cef759153975a429a1918e623f226f819.tar.xz
org.eclipse.osee-16998f1cef759153975a429a1918e623f226f819.zip
bug: Fix SMADetailsSection from giving exception when AtsCmService not available
Diffstat (limited to 'plugins')
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMADetailsSection.java18
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/internal/AtsPlugin.java3
2 files changed, 18 insertions, 3 deletions
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMADetailsSection.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMADetailsSection.java
index c4df6dd6ba..82b5770257 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMADetailsSection.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMADetailsSection.java
@@ -12,13 +12,16 @@ package org.eclipse.osee.ats.editor;
import java.util.Collection;
import java.util.Map;
+import java.util.logging.Level;
import org.eclipse.osee.ats.artifact.AbstractWorkflowArtifact;
import org.eclipse.osee.ats.artifact.TeamWorkFlowArtifact;
+import org.eclipse.osee.ats.internal.AtsPlugin;
import org.eclipse.osee.ats.util.AtsArtifactTypes;
import org.eclipse.osee.framework.core.data.AccessContextId;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.eclipse.osee.framework.core.services.CmAccessControl;
import org.eclipse.osee.framework.jdk.core.util.Lib;
+import org.eclipse.osee.framework.logging.OseeLog;
import org.eclipse.osee.framework.skynet.core.UserManager;
import org.eclipse.osee.framework.skynet.core.utility.Artifacts;
import org.eclipse.osee.framework.ui.swt.Widgets;
@@ -104,7 +107,14 @@ public class SMADetailsSection extends SectionPart {
details.put("Parent Team Workflow Id", workflow.getParentTeamWorkflow().getHumanReadableId());
}
if (workflow.isOfType(AtsArtifactTypes.TeamWorkflow)) {
- String message = null;
+ details.put("Access Context Id", getAccessContextId(workflow));
+ }
+ return details;
+ }
+
+ private String getAccessContextId(AbstractWorkflowArtifact workflow) {
+ String message = null;
+ try {
CmAccessControl accessControl = workflow.getAccessControl();
if (accessControl == null) {
message = "AtsCmAccessControlService not started";
@@ -112,9 +122,11 @@ public class SMADetailsSection extends SectionPart {
Collection<? extends AccessContextId> ids = accessControl.getContextId(UserManager.getUser(), this);
message = ids.toString();
}
- details.put("Access Context Id", message);
+ } catch (Exception ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ message = String.format("Error getting context id [%s]", ex.getMessage());
}
- return details;
+ return message;
}
@Override
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/internal/AtsPlugin.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/internal/AtsPlugin.java
index 0dcc266e23..06407a864d 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/internal/AtsPlugin.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/internal/AtsPlugin.java
@@ -70,6 +70,9 @@ public class AtsPlugin implements BundleActivator {
}
public CmAccessControl getCmService() {
+ if (cmAccessHandler == null) {
+ return null;
+ }
return cmAccessHandler.getCmService();
}

Back to the top