mirror of
https://github.com/google/nomulus
synced 2026-02-04 12:02:30 +00: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:
@@ -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));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user