--- old/src/java.base/share/classes/sun/text/normalizer/UTF16.java 2015-05-18 17:53:35.972753413 +0400 +++ new/src/java.base/share/classes/sun/text/normalizer/UTF16.java 2015-05-18 17:53:35.824753413 +0400 @@ -38,26 +38,26 @@ /** *
Standalone utility class providing UTF16 character conversions and - * indexing conversions.
+ * indexing conversions. *Code that uses strings alone rarely need modification.
* By design, UTF-16 does not allow overlap, so searching for strings is a safe
* operation. Similarly, concatenation is always safe. Substringing is safe if
* the start and end are both on UTF-32 boundaries. In normal code, the values
* for start and end are on those boundaries, since they arose from operations
* like searching. If not, the nearest UTF-32 boundaries can be determined
- * using bounds()
.
bounds()
.
* Examples:
* The following examples illustrate use of some of these methods. - *
+ ** Notes: *{@code * // iteration forwards: Original - * for (int i = 0; i < s.length(); ++i) { + * for (int i = 0; i < s.length(); ++i) { * char ch = s.charAt(i); * doSomethingWith(ch); * } * * // iteration forwards: Changes for UTF-32 * int ch; - * for (int i = 0; i < s.length(); i+=UTF16.getCharCount(ch)) { + * for (int i = 0; i < s.length(); i+=UTF16.getCharCount(ch)) { * ch = UTF16.charAt(s,i); * doSomethingWith(ch); * } @@ -74,7 +74,7 @@ * ch = UTF16.charAt(s,i); * doSomethingWith(ch); * } - *+ * }
Converts argument code point and returns a String object representing - * the code point's value in UTF16 format.
+ * the code point's value in UTF16 format. *This method does not check for the validity of the codepoint, the * results are not guaranteed if a invalid codepoint is passed as - * argument.
+ * argument. *The result is a string whose length is 1 for non-supplementary code - * points, 2 otherwise.
+ * points, 2 otherwise. * @param ch code point * @return string representation of the code point */