[ https://issues.apache.org/jira/browse/IGNITE-19183?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17720412#comment-17720412 ]
Sergey Uttsel commented on IGNITE-19183: ---------------------------------------- I see org.apache.ignite.internal.cluster.management.topology.api.LogicalNode#toString is marked with TODO IGNITE-19183 We have {{{}LogicalNode extends ClusterNode{}}}. class ClusterNode \{ private final String id; private final String name; private final NetworkAddress address; private final NodeMetadata nodeMetadata; public String toString() { return S.toString(ClusterNode.class, this); } } classd LogicalNode extends ClusterNode \{ private final Map<String, String> nodeAttributes; public String toString() { return S.toString(LogicalNode.class, this); } } toString on a LogicalNode instance prints: {noformat} LogicalNode []{noformat} {{{}{}}}It's expected behavior. If I change toString in LogicalNode to: public String toString() \{ return S.toString(LogicalNode.class, this, super.toString()); } then toString prints: {noformat} LogicalNode [super=ClusterNode [id=qqq, name=www, address=zzz:111, nodeMetadata=null]]{noformat} It's expected behavior. If I add annotation _@IgniteToStringInclude_ on {noformat} private final Map<String, String> nodeAttributes;{noformat} {{{}{}}}field then toString prints: {noformat} LogicalNode [nodeAttributes=EmptyMap {}, super=ClusterNode [id=qqq, name=www, address=zzz:111, nodeMetadata=null]]{noformat} {{{}{}}}It's expected behavior because by default a Map implementation is excluded. See IgniteToStringBuilder java doc. Ignite2 has the same rules. > IgniteToStringBuilder#toString(java.lang.Class<T>, T) do not properly print > inherited classes > --------------------------------------------------------------------------------------------- > > Key: IGNITE-19183 > URL: https://issues.apache.org/jira/browse/IGNITE-19183 > Project: Ignite > Issue Type: Bug > Reporter: Mirza Aliev > Priority: Major > Labels: ignite-3 > > {*}Expected behaviour{*}: > {code:java} > class A { > int f1; > } > class B extend A { > int f2; > } > {code} > {{S.toString(B.class, this);}} will return "B [f1 = x, f2 = y]" > {*}Actual behaviour{*}: > {{S.toString(B.class, this);}} returns "B []" -- This message was sent by Atlassian Jira (v8.20.10#820010)