Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRyan D. Brooks2017-08-24 16:51:54 -0400
committerRyan D. Brooks2017-08-29 15:58:29 -0400
commitfc34536f84b5c00d1f1ff1e4edad1cd3905a7c5a (patch)
tree20671803e0f0178674840bd68f820be9a3bfd965
parentf5b562cfcc469ea61f060b3ada7b8640c48e69b4 (diff)
downloadorg.eclipse.osee-fc34536f84b5c00d1f1ff1e4edad1cd3905a7c5a.tar.gz
org.eclipse.osee-fc34536f84b5c00d1f1ff1e4edad1cd3905a7c5a.tar.xz
org.eclipse.osee-fc34536f84b5c00d1f1ff1e4edad1cd3905a7c5a.zip
bug: Only use ViewApplicabilityUtil with valid branches
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/operation/DetailedTestStatusOld.java2
-rw-r--r--plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/blam/operation/PublishWithSpecifiedTemplate.java2
-rw-r--r--plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/report/PublishStdStpTraceability.java2
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/branch/ViewApplicabilityUtil.java8
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/change/view/ChangeReportPageViewApplicability.java6
5 files changed, 11 insertions, 9 deletions
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/operation/DetailedTestStatusOld.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/operation/DetailedTestStatusOld.java
index 708aaff231..88444466dc 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/operation/DetailedTestStatusOld.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/operation/DetailedTestStatusOld.java
@@ -548,7 +548,7 @@ public class DetailedTestStatusOld extends AbstractBlam {
if (branchViewWidget != null) {
branchViewWidget.setEditable(true);
BranchId branch = branchWidget.getSelection();
- if (branch != null && branch.isInvalid()) {
+ if (branch != null && branch.isValid()) {
branchViews = ViewApplicabilityUtil.getBranchViews(ViewApplicabilityUtil.getParentBranch(branch));
branchViewWidget.setDataStrings(branchViews.values());
}
diff --git a/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/blam/operation/PublishWithSpecifiedTemplate.java b/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/blam/operation/PublishWithSpecifiedTemplate.java
index e824567b6f..45e6282944 100644
--- a/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/blam/operation/PublishWithSpecifiedTemplate.java
+++ b/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/blam/operation/PublishWithSpecifiedTemplate.java
@@ -400,7 +400,7 @@ public class PublishWithSpecifiedTemplate extends AbstractBlam {
if (artifacts != null && !artifacts.isEmpty()) {
Artifact art = artifacts.iterator().next();
BranchId isArtBranch = art.getBranch();
- if (isArtBranch != null) {
+ if (isArtBranch != null && isArtBranch.isValid()) {
if (ViewApplicabilityUtil.isBranchOfProductLine(isArtBranch)) {
branchViews = ViewApplicabilityUtil.getBranchViews(isArtBranch);
branchViewWidget.setDataStrings(branchViews.values());
diff --git a/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/report/PublishStdStpTraceability.java b/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/report/PublishStdStpTraceability.java
index 3e34faf2bb..2acce6d67a 100644
--- a/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/report/PublishStdStpTraceability.java
+++ b/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/report/PublishStdStpTraceability.java
@@ -214,7 +214,7 @@ public class PublishStdStpTraceability extends AbstractBlam {
if (branchViewWidget != null) {
branchViewWidget.setEditable(true);
BranchId branch = branchWidget.getSelection();
- if (branch != null && branch.isInvalid()) {
+ if (branch != null && branch.isValid()) {
branchViews = ViewApplicabilityUtil.getBranchViews(ViewApplicabilityUtil.getParentBranch(branch));
branchViewWidget.setDataStrings(branchViews.values());
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/branch/ViewApplicabilityUtil.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/branch/ViewApplicabilityUtil.java
index 0634998f09..bac8e9953d 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/branch/ViewApplicabilityUtil.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/branch/ViewApplicabilityUtil.java
@@ -101,9 +101,11 @@ public class ViewApplicabilityUtil {
public static Map<Long, String> getBranchViews(BranchId branch) {
Map<Long, String> viewsToBranchData = new HashMap<Long, String>();
- List<Artifact> branchViews = ArtifactQuery.getArtifactListFromType(CoreArtifactTypes.BranchView, branch);
- for (Artifact art : branchViews) {
- viewsToBranchData.put(art.getId(), art.getName());
+ if (branch.isValid()) {
+ List<Artifact> branchViews = ArtifactQuery.getArtifactListFromType(CoreArtifactTypes.BranchView, branch);
+ for (Artifact art : branchViews) {
+ viewsToBranchData.put(art.getId(), art.getName());
+ }
}
return viewsToBranchData;
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/change/view/ChangeReportPageViewApplicability.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/change/view/ChangeReportPageViewApplicability.java
index b95df4ce83..972b3b3fc7 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/change/view/ChangeReportPageViewApplicability.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/change/view/ChangeReportPageViewApplicability.java
@@ -97,8 +97,9 @@ public class ChangeReportPageViewApplicability {
private BranchId getBranch() {
Conditions.assertNotNull(editor, "Change Editor");
ChangeReportEditorInput editorInput = editor.getEditorInput();
+ BranchId branch = BranchId.SENTINEL;
if (editorInput != null) {
- BranchId branch = editorInput.getBranch();
+ branch = editorInput.getBranch();
if (branch == null) {
ChangeUiData changeData = editorInput.getChangeData();
if (changeData != null) {
@@ -110,9 +111,8 @@ public class ChangeReportPageViewApplicability {
if (branch == null && button != null && !button.isDisposed()) {
button.setEnabled(false);
}
- return branch;
}
- return null;
+ return branch;
}
private boolean changeView() {

Back to the top