Replace usages of CharMatcher constants

Guava is discouraging these in favor of the static methods to allow
optimizations like lazy-loading of implementations.

Change-Id: I2e6ab4859ccfe5cc934f507dcbc46d2892e2dabd
This commit is contained in:
Dave Borowitz 2016-02-23 14:50:46 -05:00
parent c0276793d6
commit d1e498fa1c
2 changed files with 3 additions and 3 deletions

View File

@ -83,7 +83,7 @@ public class GerritPublicKeyChecker extends PublicKeyChecker {
Map<Long, Fingerprint> fps =
Maps.newHashMapWithExpectedSize(strs.length);
for (String str : strs) {
str = CharMatcher.WHITESPACE.removeFrom(str).toUpperCase();
str = CharMatcher.whitespace().removeFrom(str).toUpperCase();
Fingerprint fp = new Fingerprint(BaseEncoding.base16().decode(str));
fps.put(fp.getId(), fp);
}

View File

@ -99,7 +99,7 @@ public class GpgKeys implements
throws ResourceNotFoundException, PGPException, OrmException,
IOException {
checkVisible(self, parent);
String str = CharMatcher.WHITESPACE.removeFrom(id.get()).toUpperCase();
String str = CharMatcher.whitespace().removeFrom(id.get()).toUpperCase();
if ((str.length() != 8 && str.length() != 40)
|| !CharMatcher.anyOf("0123456789ABCDEF").matchesAllOf(str)) {
throw new ResourceNotFoundException(id);
@ -122,7 +122,7 @@ public class GpgKeys implements
static byte[] parseFingerprint(String str,
Iterable<AccountExternalId> existingExtIds)
throws ResourceNotFoundException {
str = CharMatcher.WHITESPACE.removeFrom(str).toUpperCase();
str = CharMatcher.whitespace().removeFrom(str).toUpperCase();
if ((str.length() != 8 && str.length() != 40)
|| !CharMatcher.anyOf("0123456789ABCDEF").matchesAllOf(str)) {
throw new ResourceNotFoundException(str);