Change-Id: I337c90fff3c013819a42a7622ac6bacc72828c07
assertTrue(externalString.startsWith(" <>"));
}
+ @Test
+ public void testAppendSanitized() {
+ StringBuilder r = new StringBuilder();
+ PersonIdent.appendSanitized(r, " Baz>\n\u1234<Quux ");
+ assertEquals("Baz\u1234Quux", r.toString());
+ }
}
+
* string builder to append to.
* @param str
* input string.
+ * @since 4.4
*/
- private static void appendSanitized(StringBuilder r, String str) {
+ public static void appendSanitized(StringBuilder r, String str) {
// Trim any whitespace less than \u0020 as in String#trim().
int i = 0;
while (i < str.length() && str.charAt(i) <= ' ') {
return tzOffset;
}
+ /**
+ * Hashcode is based only on the email address and timestamp.
+ */
public int hashCode() {
int hc = getEmailAddress().hashCode();
hc *= 31;
return r.toString();
}
}
+