Do not emit attributes when they are empty, which brings
the verbosity down quite a bit -- as this is typically the case.
Change-Id: Icb2fa7abb02e9714fed640ec07af1623056a73db
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
032751054483c095a91eb3bf820b133a6b256dc5)
@Override
protected ToStringHelper addToStringAttributes(final ToStringHelper toStringHelper) {
- return super.addToStringAttributes(toStringHelper).add("attributes", attributes);
+ super.addToStringAttributes(toStringHelper);
+ if (!attributes.isEmpty()) {
+ toStringHelper.add("attributes", attributes);
+ }
+ return toStringHelper;
}
}
@Override
protected ToStringHelper addToStringAttributes(final ToStringHelper toStringHelper) {
- return super.addToStringAttributes(toStringHelper).add("attributes", attributes);
+ super.addToStringAttributes(toStringHelper);
+ if (!attributes.isEmpty()) {
+ toStringHelper.add("attributes", attributes);
+ }
+ return toStringHelper;
}
@Override