Skip to content

Commit ed4f0ce

Browse files
kluevercopybara-github
authored andcommitted
Fix up ByteString.isValidUtf8() javadocs.
PiperOrigin-RevId: 859257007
1 parent b0366de commit ed4f0ce

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

java/core/src/main/java/com/google/protobuf/ByteString.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -956,7 +956,7 @@ public final String toStringUtf8() {
956956
*
957957
* <pre>{@code
958958
* Arrays.equals(byteString.toByteArray(),
959-
* new String(byteString.toByteArray(), "UTF-8").getBytes("UTF-8"))
959+
* new String(byteString.toByteArray(), UTF_8).getBytes(UTF_8))
960960
* }</pre>
961961
*
962962
* <p>This method returns {@code false} for "overlong" byte sequences, as well as for 3-byte
@@ -965,9 +965,8 @@ public final String toStringUtf8() {
965965
* been modified to also reject "overlong" byte sequences, but (as of 2011) still accepts 3-byte
966966
* surrogate character byte sequences.
967967
*
968-
* <p>See the Unicode Standard,<br>
969-
* Table 3-6. <em>UTF-8 Bit Distribution</em>,<br>
970-
* Table 3-7. <em>Well Formed UTF-8 Byte Sequences</em>.
968+
* <p>See the Unicode Standard, Table 3-6 <em>UTF-8 Bit Distribution</em>, and Table 3-7 <em>Well
969+
* Formed UTF-8 Byte Sequences</em>.
971970
*
972971
* @return whether the bytes in this {@code ByteString} are a well-formed UTF-8 byte sequence
973972
*/

0 commit comments

Comments
 (0)