Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRyan D. Brooks2018-07-27 09:49:21 -0400
committerRyan Brooks2018-08-08 11:56:41 -0400
commit54a88c5ad914690a8447a0471c78a20397858deb (patch)
treefdac9bcd01a19e5dbbeea19486bb515aa7fffa28
parent07f6a3dda3a669b792ee5a857f082902052127c3 (diff)
downloadorg.eclipse.osee-54a88c5ad914690a8447a0471c78a20397858deb.tar.gz
org.eclipse.osee-54a88c5ad914690a8447a0471c78a20397858deb.tar.xz
org.eclipse.osee-54a88c5ad914690a8447a0471c78a20397858deb.zip
bug[ats_TW10229]: Handle invalid traces in SubsystemToLowLevelReqTraceReport
-rw-r--r--plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/blam/operation/SubsystemToLowLevelReqTraceReport.java44
1 files changed, 21 insertions, 23 deletions
diff --git a/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/blam/operation/SubsystemToLowLevelReqTraceReport.java b/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/blam/operation/SubsystemToLowLevelReqTraceReport.java
index 4b3965a8c1..f637091696 100644
--- a/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/blam/operation/SubsystemToLowLevelReqTraceReport.java
+++ b/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/blam/operation/SubsystemToLowLevelReqTraceReport.java
@@ -197,35 +197,37 @@ public class SubsystemToLowLevelReqTraceReport extends AbstractBlam {
private void processSubsystemReq(String[] row, Artifact higherLevelReq) throws IOException {
List<Artifact> relatedArtifacts =
higherLevelReq.getRelatedArtifacts(CoreRelationTypes.Requirement_Trace__Lower_Level);
- boolean isTraced = !relatedArtifacts.isEmpty();
+ ViewIdUtility.removeExcludedArtifacts(relatedArtifacts.iterator(), excludedArtifactIdMap);
+ boolean isTraced = !Collections.disjoint(lowLevelReqs, relatedArtifacts);
+
List<Artifact> allocatedComponets = higherLevelReq.getRelatedArtifacts(CoreRelationTypes.Allocation__Component);
boolean allocated = !Collections.disjoint(components, allocatedComponets);
/*
- * Do not include if a subsystem requirement is not allocated to the any of the relevant components and this does
- * not appear to be simply a case of missing allocation (i.e. also not traced to any lower-level requirements).
+ * Do not include if a subsystem requirement is not allocated to the any of the relevant components, except when
+ * this appears to be a case of missing allocation (i.e. it is still traced to any lower-level requirements).
*/
if (isTraced || allocated) {
- row[1] = correct(higherLevelReq.getSoleAttributeValue(CoreAttributeTypes.ParagraphNumber, ""));
+ row[1] = higherLevelReq.getSoleAttributeValue(CoreAttributeTypes.ParagraphNumber, null);
row[2] = higherLevelReq.getName();
- if (isTraced) {
- ViewIdUtility.removeExcludedArtifacts(relatedArtifacts.iterator(), excludedArtifactIdMap);
+
+ if (allocated) {
+ row[5] = org.eclipse.osee.framework.jdk.core.util.Collections.toString(", ", allocatedComponets);
+ } else {
+ row[5] = "Missing allocation";
}
- for (Artifact lowerLevelReq : relatedArtifacts) {
- if (lowLevelReqs.contains(lowerLevelReq)) {
- row[3] = correct(lowerLevelReq.getSoleAttributeValue(CoreAttributeTypes.ParagraphNumber, ""));
- row[4] = lowerLevelReq.getName();
-
- if (allocated) {
- row[5] = org.eclipse.osee.framework.jdk.core.util.Collections.toString(", ", allocatedComponets);
- } else {
- row[5] = "Missing allocation";
+
+ if (isTraced) {
+ for (Artifact lowerLevelReq : relatedArtifacts) {
+ if (lowLevelReqs.contains(lowerLevelReq)) {
+ row[3] = lowerLevelReq.getSoleAttributeValue(CoreAttributeTypes.ParagraphNumber, null);
+ row[4] = lowerLevelReq.getName();
+ excelWriter.writeRow(row);
}
- excelWriter.writeRow(row);
}
- }
- if (!isTraced) { // if this requirement is not traced to any low level requirement(i.e. the for loop didn't run)
- row[3] = row[4] = row[5] = null;
+ } else {
+ row[3] = null;
+ row[4] = null;
excelWriter.writeRow(row);
}
}
@@ -263,10 +265,6 @@ public class SubsystemToLowLevelReqTraceReport extends AbstractBlam {
ViewIdUtility.removeExcludedArtifacts(components.iterator(), excludedArtifactIdMap);
}
- private String correct(String value) {
- return value.equals("") ? null : value;
- }
-
private String getAssociatedSubSystem(Artifact subSysReq) {
for (Entry<String, List<Artifact>> entry : subsysToSubsysReqsMap.entrySet()) {
String subSysName = entry.getKey();

Back to the top