Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRyan D. Brooks2018-07-14 13:28:54 -0400
committerRyan D. Brooks2018-07-14 13:28:54 -0400
commit72346261866f59d636b97621a556f45606f86c5b (patch)
treed31181b0de8b72f6ab1ee7a4ff275980f5b5a64f
parent29872fea547fab32ea86b67b25739031bea001cf (diff)
downloadorg.eclipse.osee-72346261866f59d636b97621a556f45606f86c5b.tar.gz
org.eclipse.osee-72346261866f59d636b97621a556f45606f86c5b.tar.xz
org.eclipse.osee-72346261866f59d636b97621a556f45606f86c5b.zip
refactor: Make Artifact.getRelatedArtifacts @NonNull
-rw-r--r--plugins/org.eclipse.osee.define.ide/src/org/eclipse/osee/define/ide/blam/operation/PublishSubsystemToDesignTraceability.java4
-rw-r--r--plugins/org.eclipse.osee.define.ide/src/org/eclipse/osee/define/ide/blam/operation/SubsystemToLowLevelReqTraceReport.java4
-rw-r--r--plugins/org.eclipse.osee.define.ide/src/org/eclipse/osee/define/ide/blam/operation/SystemSubsystemReport.java10
-rw-r--r--plugins/org.eclipse.osee.define.ide/src/org/eclipse/osee/define/ide/traceability/BranchTraceabilityOperation.java4
-rw-r--r--plugins/org.eclipse.osee.define.ide/src/org/eclipse/osee/define/ide/traceability/report/StdTestToCsciTable.java4
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/META-INF/MANIFEST.MF1
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/Artifact.java3
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/RelationManager.java7
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/WordTemplateRenderer.java29
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/word/WordTemplateProcessor.java29
10 files changed, 41 insertions, 54 deletions
diff --git a/plugins/org.eclipse.osee.define.ide/src/org/eclipse/osee/define/ide/blam/operation/PublishSubsystemToDesignTraceability.java b/plugins/org.eclipse.osee.define.ide/src/org/eclipse/osee/define/ide/blam/operation/PublishSubsystemToDesignTraceability.java
index 515f78e45a..86f0a1b7c7 100644
--- a/plugins/org.eclipse.osee.define.ide/src/org/eclipse/osee/define/ide/blam/operation/PublishSubsystemToDesignTraceability.java
+++ b/plugins/org.eclipse.osee.define.ide/src/org/eclipse/osee/define/ide/blam/operation/PublishSubsystemToDesignTraceability.java
@@ -120,9 +120,7 @@ public class PublishSubsystemToDesignTraceability extends AbstractBlam {
boolean loopNeverRan = true;
List<Artifact> relatedArtifacts =
subsystemRequirement.getRelatedArtifacts(CoreRelationTypes.Design__Design);
- if (relatedArtifacts != null) {
- ViewIdUtility.removeExcludedArtifacts(relatedArtifacts.iterator(), excludedArtifactIdMap);
- }
+ ViewIdUtility.removeExcludedArtifacts(relatedArtifacts.iterator(), excludedArtifactIdMap);
for (Artifact subsystemDesign : relatedArtifacts) {
if (subsystemDesign.isOfType(CoreArtifactTypes.SubsystemDesign)) {
loopNeverRan = false;
diff --git a/plugins/org.eclipse.osee.define.ide/src/org/eclipse/osee/define/ide/blam/operation/SubsystemToLowLevelReqTraceReport.java b/plugins/org.eclipse.osee.define.ide/src/org/eclipse/osee/define/ide/blam/operation/SubsystemToLowLevelReqTraceReport.java
index 1cbd2a26e5..9253222d9c 100644
--- a/plugins/org.eclipse.osee.define.ide/src/org/eclipse/osee/define/ide/blam/operation/SubsystemToLowLevelReqTraceReport.java
+++ b/plugins/org.eclipse.osee.define.ide/src/org/eclipse/osee/define/ide/blam/operation/SubsystemToLowLevelReqTraceReport.java
@@ -134,7 +134,7 @@ public class SubsystemToLowLevelReqTraceReport extends AbstractBlam {
List<Artifact> relatedArtifacts =
lowLevelReq.getRelatedArtifacts(CoreRelationTypes.Requirement_Trace__Higher_Level);
- if (relatedArtifacts != null && !relatedArtifacts.isEmpty()) {
+ if (!relatedArtifacts.isEmpty()) {
ViewIdUtility.removeExcludedArtifacts(relatedArtifacts.iterator(), excludedArtifactIdMap);
isRelated = true;
}
@@ -195,7 +195,7 @@ public class SubsystemToLowLevelReqTraceReport extends AbstractBlam {
List<Artifact> relatedArtifacts =
higherLevelReq.getRelatedArtifacts(CoreRelationTypes.Requirement_Trace__Lower_Level);
boolean isRelated = false;
- if (relatedArtifacts != null && !relatedArtifacts.isEmpty()) {
+ if (!relatedArtifacts.isEmpty()) {
ViewIdUtility.removeExcludedArtifacts(relatedArtifacts.iterator(), excludedArtifactIdMap);
isRelated = true;
}
diff --git a/plugins/org.eclipse.osee.define.ide/src/org/eclipse/osee/define/ide/blam/operation/SystemSubsystemReport.java b/plugins/org.eclipse.osee.define.ide/src/org/eclipse/osee/define/ide/blam/operation/SystemSubsystemReport.java
index 7e962c962d..473b4463ad 100644
--- a/plugins/org.eclipse.osee.define.ide/src/org/eclipse/osee/define/ide/blam/operation/SystemSubsystemReport.java
+++ b/plugins/org.eclipse.osee.define.ide/src/org/eclipse/osee/define/ide/blam/operation/SystemSubsystemReport.java
@@ -192,7 +192,7 @@ public class SystemSubsystemReport extends AbstractBlam {
Artifact component = productComponent.getChild(subSysName);
List<Artifact> sysReqByComp = component.getRelatedArtifacts(CoreRelationTypes.Allocation__Requirement);
- if (sysReqByComp != null && !sysReqByComp.isEmpty()) {
+ if (!sysReqByComp.isEmpty()) {
ViewIdUtility.removeExcludedArtifacts(sysReqByComp.iterator(), findExcludedArtifactsByView);
}
storeInHierarchyOrderBySubsystem(subSysName, sysReqByComp);
@@ -299,7 +299,7 @@ public class SystemSubsystemReport extends AbstractBlam {
boolean isRelated = false;
List<Artifact> relatedArtifacts = artifact.getRelatedArtifacts(CoreRelationTypes.Allocation__Component);
- if (relatedArtifacts != null && !relatedArtifacts.isEmpty()) {
+ if (!relatedArtifacts.isEmpty()) {
ViewIdUtility.removeExcludedArtifacts(relatedArtifacts.iterator(), findExcludedArtifactsByView);
isRelated = true;
}
@@ -334,7 +334,7 @@ public class SystemSubsystemReport extends AbstractBlam {
excelWriter.writeRow("PIDS Paragraph #", "PIDS Paragraph Title", "Notes <rationale>");
List<Artifact> relatedArtifacts = component.getRelatedArtifacts(CoreRelationTypes.Allocation__Requirement);
- if (relatedArtifacts != null && !relatedArtifacts.isEmpty()) {
+ if (!relatedArtifacts.isEmpty()) {
ViewIdUtility.removeExcludedArtifacts(relatedArtifacts.iterator(), findExcludedArtifactsByView);
}
for (Artifact subsysReq : relatedArtifacts) {
@@ -420,7 +420,7 @@ public class SystemSubsystemReport extends AbstractBlam {
boolean isRelated = false;
List<Artifact> relatedArtifacts = sysReq.getRelatedArtifacts(CoreRelationTypes.Requirement_Trace__Lower_Level);
- if (relatedArtifacts != null && !relatedArtifacts.isEmpty()) {
+ if (!relatedArtifacts.isEmpty()) {
ViewIdUtility.removeExcludedArtifacts(relatedArtifacts.iterator(), findExcludedArtifactsByView);
isRelated = true;
}
@@ -470,7 +470,7 @@ public class SystemSubsystemReport extends AbstractBlam {
boolean isRelated = false;
List<Artifact> relatedArtifacts =
subsysReq.getRelatedArtifacts(CoreRelationTypes.Requirement_Trace__Higher_Level);
- if (relatedArtifacts != null && !relatedArtifacts.isEmpty()) {
+ if (!relatedArtifacts.isEmpty()) {
ViewIdUtility.removeExcludedArtifacts(relatedArtifacts.iterator(), findExcludedArtifactsByView);
isRelated = true;
}
diff --git a/plugins/org.eclipse.osee.define.ide/src/org/eclipse/osee/define/ide/traceability/BranchTraceabilityOperation.java b/plugins/org.eclipse.osee.define.ide/src/org/eclipse/osee/define/ide/traceability/BranchTraceabilityOperation.java
index 59abb909bb..f13529774c 100644
--- a/plugins/org.eclipse.osee.define.ide/src/org/eclipse/osee/define/ide/traceability/BranchTraceabilityOperation.java
+++ b/plugins/org.eclipse.osee.define.ide/src/org/eclipse/osee/define/ide/traceability/BranchTraceabilityOperation.java
@@ -117,9 +117,7 @@ public class BranchTraceabilityOperation extends TraceabilityProviderOperation {
for (Artifact req : reqs) {
List<Artifact> verifiers = req.getRelatedArtifacts(CoreRelationTypes.Verification__Verifier);
- if (verifiers != null) {
- ViewIdUtility.removeExcludedArtifacts(verifiers.iterator(), excludedArtifactIdMap);
- }
+ ViewIdUtility.removeExcludedArtifacts(verifiers.iterator(), excludedArtifactIdMap);
Set<String> verifierNames = new HashSet<>();
String inspection = getInspectionQual(req);
if (Strings.isValid(inspection)) {
diff --git a/plugins/org.eclipse.osee.define.ide/src/org/eclipse/osee/define/ide/traceability/report/StdTestToCsciTable.java b/plugins/org.eclipse.osee.define.ide/src/org/eclipse/osee/define/ide/traceability/report/StdTestToCsciTable.java
index bad14d165d..9833bf58d2 100644
--- a/plugins/org.eclipse.osee.define.ide/src/org/eclipse/osee/define/ide/traceability/report/StdTestToCsciTable.java
+++ b/plugins/org.eclipse.osee.define.ide/src/org/eclipse/osee/define/ide/traceability/report/StdTestToCsciTable.java
@@ -167,9 +167,7 @@ public class StdTestToCsciTable implements ISimpleTable {
for (Artifact requirement : source.getAllSwRequirements()) {
List<String> testScripts = new ArrayList<String>();
requirementsToCodeUnits.forEachValue(requirement, testScripts::add);
- if (testScripts != null) {
- toReturn.put(requirement, testScripts);
- }
+ toReturn.put(requirement, testScripts);
}
return toReturn;
}
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/META-INF/MANIFEST.MF b/plugins/org.eclipse.osee.framework.skynet.core/META-INF/MANIFEST.MF
index decb9b066f..6eac33439d 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.osee.framework.skynet.core/META-INF/MANIFEST.MF
@@ -64,6 +64,7 @@ Import-Package: com.google.common.collect;version="15.0.0",
org.eclipse.emf.common.util,
org.eclipse.emf.ecore,
org.eclipse.emf.ecore.util,
+ org.eclipse.jdt.annotation,
org.eclipse.osee.activity.api,
org.eclipse.osee.cache.admin,
org.eclipse.osee.define.api,
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/Artifact.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/Artifact.java
index 0668068b4d..924d7b3f46 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/Artifact.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/Artifact.java
@@ -28,6 +28,7 @@ import java.util.Set;
import java.util.logging.Level;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
+import org.eclipse.jdt.annotation.NonNull;
import org.eclipse.osee.framework.core.data.Adaptable;
import org.eclipse.osee.framework.core.data.ApplicabilityId;
import org.eclipse.osee.framework.core.data.ArtifactToken;
@@ -186,7 +187,7 @@ public class Artifact extends NamedIdBase implements ArtifactToken, Adaptable, F
return RelationManager.getRelatedArtifacts(this, new RelationTypeSide(relationType, RelationSide.SIDE_B));
}
- public List<Artifact> getRelatedArtifacts(RelationTypeSide relationTypeSide) {
+ public @NonNull List<Artifact> getRelatedArtifacts(RelationTypeSide relationTypeSide) {
return RelationManager.getRelatedArtifacts(this, relationTypeSide);
}
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/RelationManager.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/RelationManager.java
index 65247d93ef..daad311c1a 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/RelationManager.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/RelationManager.java
@@ -21,6 +21,7 @@ import java.util.List;
import java.util.Set;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.logging.Level;
+import org.eclipse.jdt.annotation.NonNull;
import org.eclipse.osee.framework.core.data.ApplicabilityId;
import org.eclipse.osee.framework.core.data.ArtifactId;
import org.eclipse.osee.framework.core.data.ArtifactToken;
@@ -104,11 +105,11 @@ public class RelationManager {
return getRelatedArtifacts(artifact, relationType, relationSide, false);
}
- public static List<Artifact> getRelatedArtifacts(Artifact artifact, IRelationType relationType, RelationSide relationSide) {
+ public static @NonNull List<Artifact> getRelatedArtifacts(Artifact artifact, IRelationType relationType, RelationSide relationSide) {
return getRelatedArtifacts(artifact, relationType, relationSide, true);
}
- private static List<Artifact> getRelatedArtifacts(Artifact artifact, IRelationType relationType, RelationSide relationSide, boolean sort) {
+ private static @NonNull List<Artifact> getRelatedArtifacts(Artifact artifact, IRelationType relationType, RelationSide relationSide, boolean sort) {
if (artifact.isHistorical()) {
throw new OseeCoreException("Artifact [%s] is historical. Historical relations are only supported on server",
artifact);
@@ -266,7 +267,7 @@ public class RelationManager {
return getRelatedArtifactsUnSorted(artifact, relationEnum, relationEnum.getSide());
}
- public static List<Artifact> getRelatedArtifacts(Artifact artifact, RelationTypeSide relationEnum) {
+ public static @NonNull List<Artifact> getRelatedArtifacts(Artifact artifact, RelationTypeSide relationEnum) {
return getRelatedArtifacts(artifact, relationEnum, relationEnum.getSide());
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/WordTemplateRenderer.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/WordTemplateRenderer.java
index 0d28fbac42..907565f195 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/WordTemplateRenderer.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/WordTemplateRenderer.java
@@ -238,15 +238,12 @@ public class WordTemplateRenderer extends WordRenderer {
List<Artifact> templateRelatedArtifacts =
template.getRelatedArtifacts(CoreRelationTypes.SupportingInfo_SupportingInfo);
- if (templateRelatedArtifacts != null) {
-
- if (templateRelatedArtifacts.size() == 1) {
- templateStyles = templateRelatedArtifacts.get(0).getSoleAttributeValueAsString(
- CoreAttributeTypes.WholeWordContent, "");
- } else if (templateRelatedArtifacts.size() > 1) {
- OseeLog.log(this.getClass(), Level.INFO,
- "More than one style relation currently not supported. Defaulting to styles defined in the template.");
- }
+ if (templateRelatedArtifacts.size() == 1) {
+ templateStyles = templateRelatedArtifacts.get(0).getSoleAttributeValueAsString(
+ CoreAttributeTypes.WholeWordContent, "");
+ } else if (templateRelatedArtifacts.size() > 1) {
+ OseeLog.log(this.getClass(), Level.INFO,
+ "More than one style relation currently not supported. Defaulting to styles defined in the template.");
}
}
} else {
@@ -259,14 +256,12 @@ public class WordTemplateRenderer extends WordRenderer {
List<Artifact> templateRelatedArtifacts =
template.getRelatedArtifacts(CoreRelationTypes.SupportingInfo_SupportingInfo);
- if (templateRelatedArtifacts != null) {
- if (templateRelatedArtifacts.size() == 1) {
- templateStyles = templateRelatedArtifacts.get(0).getSoleAttributeValueAsString(
- CoreAttributeTypes.WholeWordContent, "");
- } else if (templateRelatedArtifacts.size() > 1) {
- OseeLog.log(this.getClass(), Level.INFO,
- "More than one style relation currently not supported. Defaulting to styles defined in the template.");
- }
+ if (templateRelatedArtifacts.size() == 1) {
+ templateStyles = templateRelatedArtifacts.get(0).getSoleAttributeValueAsString(
+ CoreAttributeTypes.WholeWordContent, "");
+ } else if (templateRelatedArtifacts.size() > 1) {
+ OseeLog.log(this.getClass(), Level.INFO,
+ "More than one style relation currently not supported. Defaulting to styles defined in the template.");
}
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/word/WordTemplateProcessor.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/word/WordTemplateProcessor.java
index 926f580ed2..a63fd19a88 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/word/WordTemplateProcessor.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/word/WordTemplateProcessor.java
@@ -192,16 +192,13 @@ public class WordTemplateProcessor {
List<Artifact> slaveTemplateRelatedArtifacts =
slaveTemplateArtifact.getRelatedArtifacts(CoreRelationTypes.SupportingInfo_SupportingInfo);
- if (slaveTemplateRelatedArtifacts != null) {
- if (slaveTemplateRelatedArtifacts.size() == 1) {
- slaveTemplateStyles += slaveTemplateRelatedArtifacts.get(0).getSoleAttributeValueAsString(
- CoreAttributeTypes.WholeWordContent, "");
- } else {
- OseeLog.log(this.getClass(), Level.INFO,
- "More than one style relation currently not supported. Defaulting to styles defined in the template.");
- }
+ if (slaveTemplateRelatedArtifacts.size() == 1) {
+ slaveTemplateStyles += slaveTemplateRelatedArtifacts.get(0).getSoleAttributeValueAsString(
+ CoreAttributeTypes.WholeWordContent, "");
+ } else {
+ OseeLog.log(this.getClass(), Level.INFO,
+ "More than one style relation currently not supported. Defaulting to styles defined in the template.");
}
-
}
try {
@@ -229,14 +226,12 @@ public class WordTemplateProcessor {
masterTemplateArtifact.getRelatedArtifacts(CoreRelationTypes.SupportingInfo_SupportingInfo);
String masterTemplateStyles = "";
- if (masterTemplateRelatedArtifacts != null) {
- if (masterTemplateRelatedArtifacts.size() == 1) {
- masterTemplateStyles += masterTemplateRelatedArtifacts.get(0).getSoleAttributeValueAsString(
- CoreAttributeTypes.WholeWordContent, "");
- } else {
- OseeLog.log(this.getClass(), Level.INFO,
- "More than one style relation currently not supported. Defaulting to styles defined in the template.");
- }
+ if (masterTemplateRelatedArtifacts.size() == 1) {
+ masterTemplateStyles += masterTemplateRelatedArtifacts.get(0).getSoleAttributeValueAsString(
+ CoreAttributeTypes.WholeWordContent, "");
+ } else {
+ OseeLog.log(this.getClass(), Level.INFO,
+ "More than one style relation currently not supported. Defaulting to styles defined in the template.");
}
getExcludeArtifactTypes();

Back to the top