mirror of
https://github.com/google/nomulus.git
synced 2025-08-12 12:39:39 +02:00
Replace deprecated CharMatcher method
CharMatcher.isLetterOrDigit() is deprecated for failing to support supplementary characters. We explicitly declare a matcher for ascii letters and digits. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=252671830
This commit is contained in:
parent
7cfbfdd0e4
commit
0ed0455100
4 changed files with 76 additions and 3 deletions
|
@ -14,15 +14,19 @@
|
|||
|
||||
package google.registry.util;
|
||||
|
||||
import static com.google.common.base.CharMatcher.javaLetterOrDigit;
|
||||
|
||||
import com.google.common.base.Ascii;
|
||||
import com.google.common.base.CharMatcher;
|
||||
|
||||
/** Utilities for working with {@code Registrar} objects. */
|
||||
public class RegistrarUtils {
|
||||
|
||||
private static final CharMatcher ASCII_LETTER_OR_DIGIT_MATCHER =
|
||||
JavaCharMatchers.asciiLetterOrDigitMatcher();
|
||||
|
||||
/** Strip out anything that isn't a letter or digit, and lowercase. */
|
||||
public static String normalizeRegistrarName(String name) {
|
||||
return Ascii.toLowerCase(javaLetterOrDigit().retainFrom(name));
|
||||
return Ascii.toLowerCase(ASCII_LETTER_OR_DIGIT_MATCHER.retainFrom(name));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue