Issue 17220: OCL String::indexOf (ocl2-rtf) Source: Nomos Software (Dr. Edward Willink, ed(at)willink.me.uk) Nature: Uncategorized Issue Severity: Summary: The description of String::indexOf() states "No string is a substring of the empty string.". This modifies the axiom that every string is a substring of itself. It would appear that the empty string has got confused with null. An extension of the library with startsWith and endsWith operations would require the modified axiom to be accommodated making corner cases equivalently strange. This modified axiom is not observed by other String libraries such as the java.lang.String. Suggest: Replace the text: "The empty string is considered to be a substring of every string but the empty string, at index 1. No string is a substring of the empty string." by "The empty string is a substring of every string at index 1 (and also at all other indexes)." Resolution: Revised Text: Actions taken: March 9, 2012: received issue Discussion: End of Annotations:===== m: Ed Willink To: issues@omg.org Subject: OCL String::indexOf The description of String::indexOf() states "No string is a substring of the empty string.". This modifies the axiom that every string is a substring of itself. It would appear that the empty string has got confused with null. An extension of the library with startsWith and endsWith operations would require the modified axiom to be accommodated making corner cases equivalently strange. This modified axiom is not observed by other String libraries such as the java.lang.String. Suggest: Replace the text: "The empty string is considered to be a substring of every string but the empty string, at index 1. No string is a substring of the empty string." by "The empty string is a substring of every string at index 1 (and also at all other indexes)." Regards Ed Willink