Issue 13460: IntegerValue::toString uses Java String.valueOf (fuml-ftf) Source: Model Driven Solutions (Mr. Ed Seidewitz, ed-s(at)modeldriven.com) Nature: Uncategorized Issue Severity: Summary: Specification: Semantics of a Foundation Subset for Executable UML Models, FTF – Beta 1 (ptc/08-11-03) Section: 8.3.2.2.10 IntegerValue Summary: The IntegerValue::toString operation uses the Java String.valueOf operation, which has no Annex A mapping. Proposed Resolution: Replace the body of the toString operation with: String stringValue = ""; if (this.value == 0) { stringValue = "0"; } else { int positiveValue = this.value; if (positiveValue < 0) { positiveValue = -positiveValue; } do { int digit = positiveValue % 10; if (digit == 0) { stringValue = "0" + stringValue; } else if (digit == 1) { stringValue = "1" + stringValue; } else if (digit == 2) { stringValue = "2" + stringValue; } else if (digit == 3) { stringValue = "3" + stringValue; } else if (digit == 4) { stringValue = "4" + stringValue; } else if (digit == 5) { stringValue = "5" + stringValue; } else if (digit == 6) { stringValue = "6" + stringValue; } else if (digit == 7) { stringValue = "7" + stringValue; } else if (digit == 8) { stringValue = "8" + stringValue; } else if (digit == 9) { stringValue = "9" + stringValue; } positiveValue = positiveValue / 10; } while (positiveValue > 0); if (this.value < 0) { stringValue = "-" + stringValue; } } return stringValue; Resolution: Change the code as proposed Revised Text: Replace the body of the IntegerValue::toString operation with: String stringValue = ""; if (this.value == 0) { stringValue = "0"; } else { int positiveValue = this.value; if (positiveValue < 0) { positiveValue = -positiveValue; } do { int digit = positiveValue % 10; if (digit == 0) { stringValue = "0" + stringValue; } else if (digit == 1) { stringValue = "1" + stringValue; } else if (digit == 2) { stringValue = "2" + stringValue; } else if (digit == 3) { stringValue = "3" + stringValue; } else if (digit == 4) { stringValue = "4" + stringValue; } else if (digit == 5) { stringValue = "5" + stringValue; } else if (digit == 6) { stringValue = "6" + stringValue; } else if (digit == 7) { stringValue = "7" + stringValue; } else if (digit == 8) { stringValue = "8" + stringValue; } else if (digit == 9) { stringValue = "9" + stringValue; } positiveValue = positiveValue / 10; } while (positiveValue > 0); if (this.value < 0) { stringValue = "-" + stringValue; } } Actions taken: February 7, 2009: received issue July 23, 2010: closed issue Discussion: End of Annotations:===== ubject: IntegerValue::toString uses Java String.valueOf Date: Sat, 7 Feb 2009 11:21:12 -0500 X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: IntegerValue::toString uses Java String.valueOf thread-index: AcmJQBd/BM0PmEuNSRS1BF0uYfbjoQ== From: "Ed Seidewitz" To: Specification: Semantics of a Foundation Subset for Executable UML Models, FTF . Beta 1 (ptc/08-11-03) Section: 8.3.2.2.10 IntegerValue Summary: The IntegerValue::toString operation uses the Java String.valueOf operation, which has no Annex A mapping. Proposed Resolution: Replace the body of the toString operation with: String stringValue = ""; if (this.value == 0) { stringValue = "0"; } else { int positiveValue = this.value; if (positiveValue < 0) { positiveValue = -positiveValue; } do { int digit = positiveValue % 10; if (digit == 0) { stringValue = "0" + stringValue; } else if (digit == 1) { stringValue = "1" + stringValue; } else if (digit == 2) { stringValue = "2" + stringValue; } else if (digit == 3) { stringValue = "3" + stringValue; } else if (digit == 4) { stringValue = "4" + stringValue; } else if (digit == 5) { stringValue = "5" + stringValue; } else if (digit == 6) { stringValue = "6" + stringValue; } else if (digit == 7) { stringValue = "7" + stringValue; } else if (digit == 8) { stringValue = "8" + stringValue; } else if (digit == 9) { stringValue = "9" + stringValue; } positiveValue = positiveValue / 10; } while (positiveValue > 0); if (this.value < 0) { stringValue = "-" + stringValue; } } return stringValue;