Skip to content

Commit

Permalink
Fix mangled Javadocs.
Browse files Browse the repository at this point in the history
RELNOTES=n/a

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=198884357
  • Loading branch information
dimo414 authored and ronshapiro committed Jun 4, 2018
1 parent dd71527 commit c2f8967
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 32 deletions.
34 changes: 18 additions & 16 deletions android/guava/src/com/google/common/base/Strings.java
Original file line number Diff line number Diff line change
Expand Up @@ -212,16 +212,30 @@ public static String commonSuffix(CharSequence a, CharSequence b) {
return a.subSequence(a.length() - s, a.length()).toString();
}

/**
* True when a valid surrogate pair starts at the given {@code index} in the given {@code string}.
* Out-of-range indexes return false.
*/
@VisibleForTesting
static boolean validSurrogatePairAt(CharSequence string, int index) {
return index >= 0
&& index <= (string.length() - 2)
&& Character.isHighSurrogate(string.charAt(index))
&& Character.isLowSurrogate(string.charAt(index + 1));
}

/**
* Returns the given {@code template} string with each occurrence of {@code "%s"} replaced with
* the corresponding argument value from {@code args}; or, if the placeholder and argument counts
* do not match, returns a best-effort form of that string. Will not throw an exception under
* normal conditions.
*
* <p><b>Note:</b> For most string-formatting needs, use {@link String#format}, {@link
* PrintWriter#format}, and related methods. These support the full range of {@linkplain
* Formatter#syntax format specifiers}, and alert you to usage errors by throwing {@link
* InvalidFormatException}.
* <p><b>Note:</b> For most string-formatting needs, use {@link String#format String.format},
* {@link java.io.PrintWriter#format PrintWriter.format}, and related methods. These support the
* full range of <a
* href="https://docs.oracle.com/javase/9/docs/api/java/util/Formatter.html#syntax">format
* specifiers</a>, and alert you to usage errors by throwing {@link
* java.util.IllegalFormatException}.
*
* <p>In certain cases, such as outputting debugging information or constructing a message to be
* used for another unchecked exception, an exception during string formatting would serve little
Expand Down Expand Up @@ -296,16 +310,4 @@ private static String lenientToString(@NullableDecl Object o) {
return "<" + objectToString + " threw " + e.getClass().getName() + ">";
}
}

/**
* True when a valid surrogate pair starts at the given {@code index} in the given {@code string}.
* Out-of-range indexes return false.
*/
@VisibleForTesting
static boolean validSurrogatePairAt(CharSequence string, int index) {
return index >= 0
&& index <= (string.length() - 2)
&& Character.isHighSurrogate(string.charAt(index))
&& Character.isLowSurrogate(string.charAt(index + 1));
}
}
34 changes: 18 additions & 16 deletions guava/src/com/google/common/base/Strings.java
Original file line number Diff line number Diff line change
Expand Up @@ -211,16 +211,30 @@ public static String commonSuffix(CharSequence a, CharSequence b) {
return a.subSequence(a.length() - s, a.length()).toString();
}

/**
* True when a valid surrogate pair starts at the given {@code index} in the given {@code string}.
* Out-of-range indexes return false.
*/
@VisibleForTesting
static boolean validSurrogatePairAt(CharSequence string, int index) {
return index >= 0
&& index <= (string.length() - 2)
&& Character.isHighSurrogate(string.charAt(index))
&& Character.isLowSurrogate(string.charAt(index + 1));
}

/**
* Returns the given {@code template} string with each occurrence of {@code "%s"} replaced with
* the corresponding argument value from {@code args}; or, if the placeholder and argument counts
* do not match, returns a best-effort form of that string. Will not throw an exception under
* normal conditions.
*
* <p><b>Note:</b> For most string-formatting needs, use {@link String#format}, {@link
* PrintWriter#format}, and related methods. These support the full range of {@linkplain
* Formatter#syntax format specifiers}, and alert you to usage errors by throwing {@link
* InvalidFormatException}.
* <p><b>Note:</b> For most string-formatting needs, use {@link String#format String.format},
* {@link java.io.PrintWriter#format PrintWriter.format}, and related methods. These support the
* full range of <a
* href="https://docs.oracle.com/javase/9/docs/api/java/util/Formatter.html#syntax">format
* specifiers</a>, and alert you to usage errors by throwing {@link
* java.util.IllegalFormatException}.
*
* <p>In certain cases, such as outputting debugging information or constructing a message to be
* used for another unchecked exception, an exception during string formatting would serve little
Expand Down Expand Up @@ -296,16 +310,4 @@ private static String lenientToString(@Nullable Object o) {
return "<" + objectToString + " threw " + e.getClass().getName() + ">";
}
}

/**
* True when a valid surrogate pair starts at the given {@code index} in the given {@code string}.
* Out-of-range indexes return false.
*/
@VisibleForTesting
static boolean validSurrogatePairAt(CharSequence string, int index) {
return index >= 0
&& index <= (string.length() - 2)
&& Character.isHighSurrogate(string.charAt(index))
&& Character.isLowSurrogate(string.charAt(index + 1));
}
}

0 comments on commit c2f8967

Please sign in to comment.