bug[ats_ATS371114]: Duplicate Active attributes loaded for User

   - Add better error logging to better determine what is happening

Change-Id: Iac92c3f6ae28791a42aa991471218bd8483fd480
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 8b7738d..ee56a45 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
@@ -639,19 +639,35 @@
       List<Attribute<T>> soleAttributes = getAttributes(attributeType);
       if (soleAttributes.isEmpty()) {
          if (!isAttributeTypeValid(attributeType)) {
-            throw new OseeArgumentException("The attribute type %s is not valid for artifacts of type [%s]",
-               attributeType, getArtifactTypeName());
+            throw new OseeArgumentException(
+               "The attribute type %s is not valid for artifacts of type [%s] on artifact [%s] on branch [%s]",
+               attributeType, getArtifactTypeName(), toStringWithId(), getBranch());
          }
          throw new AttributeDoesNotExist("Attribute of type [%s] could not be found on artifact [%s] on branch [%s]",
-            attributeType, this, getBranch());
+            attributeType, toStringWithId(), getBranch());
       } else if (soleAttributes.size() > 1) {
-         throw new MultipleAttributesExist(
-            "Attribute [%s] must have exactly one instance.  It currently has %d for artifact [%s]", attributeType,
-            soleAttributes.size(), getGuid());
+         String errMsg = String.format(
+            "Attribute [%s] must have exactly one instance.  It currently has %d for artifact %s; Attributes [%s]",
+            attributeType, soleAttributes.size(), toStringWithId(), getAttributeString(soleAttributes));
+         throw new MultipleAttributesExist(errMsg);
       }
       return soleAttributes.iterator().next().getValue();
    }
 
+   private <T> String getAttributeString(List<Attribute<T>> attributes) {
+      StringBuilder sb = new StringBuilder();
+      for (Attribute<T> attr : attributes) {
+         sb.append("attribute id=[");
+         sb.append(attr.getId());
+         sb.append("] gamma=[");
+         sb.append(attr.getGammaId());
+         sb.append("] ");
+      }
+      String result = sb.toString();
+      System.err.println(result);
+      return result;
+   }
+
    /**
     * Return sole attribute string value for given attribute type name. Handles AttributeDoesNotExist case by returning
     * defaultReturnValue.<br>