Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordonald.g.dunne2018-01-17 17:27:33 +0000
committerdonald.g.dunne2018-01-17 17:27:33 +0000
commit0526843d97db2c50be7b193988269c86d2acc50b (patch)
treea69ca3339eb878fa411913f74512decfc60adb6d
parentf2abcb486c9d38451c48fa1687505c523f8ce326 (diff)
downloadorg.eclipse.osee-0526843d97db2c50be7b193988269c86d2acc50b.tar.gz
org.eclipse.osee-0526843d97db2c50be7b193988269c86d2acc50b.tar.xz
org.eclipse.osee-0526843d97db2c50be7b193988269c86d2acc50b.zip
bug[ats_TW6213]: Handle ArtifactReferencedAttribute in Artifact.getSoleAttrValue
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/Artifact.java16
1 files changed, 11 insertions, 5 deletions
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 5202bb9382c..0b9c9d737e0 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
@@ -247,9 +247,9 @@ public class Artifact extends FullyNamedIdentity<String> implements IArtifact, A
}
/**
- * Determines if this artifact's type equals, or is a sub-type of, at least one of the given artifact types.
- * This is a relatively expensive operation, only use this method when you need either the multiple artifact
- * types or to have sub-types included; otherwise us the less expensive equalsType below.
+ * Determines if this artifact's type equals, or is a sub-type of, at least one of the given artifact types. This is
+ * a relatively expensive operation, only use this method when you need either the multiple artifact types or to have
+ * sub-types included; otherwise us the less expensive equalsType below.
*/
public final boolean isOfType(ArtifactTypeId... artifactTypes) {
return getArtifactType().inheritsFrom(artifactTypes);
@@ -735,8 +735,14 @@ public class Artifact extends FullyNamedIdentity<String> implements IArtifact, A
if (soleAttributes.size() == 1) {
T value = soleAttributes.iterator().next().getValue();
if (value == null) {
- OseeLog.log(Activator.class, Level.SEVERE,
- "Attribute \"" + attributeType + "\" has null value for Artifact " + getGuid() + " \"" + getName() + "\"");
+ /**
+ * ArtifactReferenceAttributes can have an attribute value (art id), but getValue would return null if art
+ * id can't be resolved. Do not error on null, but instead just return default value.
+ */
+ if (!(soleAttributes.iterator().next() instanceof ArtifactReferenceAttribute)) {
+ OseeLog.log(Activator.class, Level.SEVERE,
+ "Attribute \"" + attributeType + "\" has null value for Artifact " + getGuid() + " \"" + getName() + "\"");
+ }
return defaultReturnValue;
}
return value;

Back to the top