Github user aledsage commented on a diff in the pull request:
https://github.com/apache/brooklyn-server/pull/146#discussion_r64989547
--- Diff: api/src/main/java/org/apache/brooklyn/api/entity/EntitySpec.java
---
@@ -432,5 +432,10 @@ public Entity getParent() {
private void checkMutable() {
if (immutable) throw new IllegalStateException("Cannot modify
immutable entity spec "+this);
}
-
+
+ @Override
+ public String toString(){
+ return getClass().getName();
--- End diff --
Interestingly, there is already a `toString`, inherited from
`AbstractBrooklynObjectSpec`. That will include the entity type, and will
append `+"@"+Integer.toHexString(System.identityHashCode(this)`!
I can see why we might want the identityHashCode (so that when looking at
the logs we can tell if something is using the same instance). But on-balance,
I think it's fine to not include it. Therefore, instead of this impl I suggest
you change `AbstractBrooklynObjectSpec` to be:
@Override
public String toString() {
return Objects.toStringHelper(this).omitNullValues()
.add("type", type)
.add("displayName", displayName)
.toString();
}
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---