Issue 18365: Objects with cyclic references cannot be converted to string representations (fuml-rtf) Source: Model Driven Solutions (Mr. Ed Seidewitz, ed-s(at)modeldriven.com) Nature: Uncategorized Issue Severity: Summary: Specification: Semantics of a Foundational Subset for Executable UML Models (fUML), v1.1, RTF Beta (ptc/2012-10-18) Subclause: 8.3.2.2.2 CompundValue The CompoundValue::toString operation calls toString on each value of each featureValue of a compound value. If one of these values is a reference then Reference::toString operation calls toString on the referenced object. Thus, if two or more objects cyclically reference each other, calling toString on any one of them will result in an infinite recursion. Resolution: Update CompoundValue::toString Agreed. If the feature value is a reference, then it is sufficient to show the object ID and list the names of the types of the object. Revised Text: In 8.3.2.2.2 CompoundValue, in the toString operation, in the nested while statement while (j <= featureValue.values.size()) { buffer = buffer + " " + featureValue.values.getValue(j - 1).toString(); j = j + 1; } replace the first statement in the loop with Value value = featureValue.values.getValue(j - 1); if (value instanceof Reference) { Object_ object = ((Reference)value).referent; buffer = buffer + " Reference to (" + object.objectId() + ":"; types = object.getTypes(); int n = 1; while (n <= types.size()) { buffer = buffer + " " + types.getValue(n - 1).name; n = n + 1; } buffer = buffer + ")"; } else { buffer = buffer + " " + value.toString(); } Actions taken: January 5, 2013: received issue October 8, 2015: Resolved December 22, 2015: closed issue Discussion: End of Annotations:===== m: Ed Seidewitz To: "issues@omg.org" Date: Sat, 5 Jan 2013 15:36:49 -0500 Subject: Objects with cyclic references cannot be converted to string representations Thread-Topic: Objects with cyclic references cannot be converted to string representations Thread-Index: Ac3rhBweRwePdaeGTrGcOifpEkODPQ== Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US X-Mailprotector-Decision: deliver X-Mailprotector-Connection: TLSv1|[10.1.50.226]|10.1.50.226|outbound.mailprotector.net|0.0|0.0|0|||0|0|0|0 X-Mailprotector-Results: null_ptr subject_50_chars clean X-Mailprotector-Score: 60 X-Mailprotector-IP-Analysis: 0, 10.1.50.226, Ugly c=0.695582 p=-0.990632 Source White X-Mailprotector-Scan-Diagnostics: 0-0-0-5416-c X-Mailprotector-ID: 32dbef0d-54fc-48d2-99f9-5d11f85ff2ae Specification: Semantics of a Foundational Subset for Executable UML Models (fUML), v1.1, RTF Beta (ptc/2012-10-18) Subclause: 8.3.2.2.2 CompundValue The CompoundValue::toString operation calls toString on each value of each featureValue of a compound value. If one of these values is a reference then Reference::toString operation calls toString on the referenced object. Thus, if two or more objects cyclically reference each other, calling toString on any one of them will result in an infinite recursion.