From cdb94ba24f160cde2d31da52236fac1a3d58ad3a Mon Sep 17 00:00:00 2001 From: gbrodman Date: Mon, 22 Jul 2019 14:12:55 -0400 Subject: [PATCH] Fix a few deprecations (#186) --- .../model/domain/fee/FeeExtensionCommandDescriptor.java | 4 ++-- .../model/domain/fee12/FeeCheckCommandExtensionItemV12.java | 4 ++-- .../java/google/registry/tools/CreateOrUpdateTldCommand.java | 3 +-- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/core/src/main/java/google/registry/model/domain/fee/FeeExtensionCommandDescriptor.java b/core/src/main/java/google/registry/model/domain/fee/FeeExtensionCommandDescriptor.java index feff05ba2..8ce8f8886 100644 --- a/core/src/main/java/google/registry/model/domain/fee/FeeExtensionCommandDescriptor.java +++ b/core/src/main/java/google/registry/model/domain/fee/FeeExtensionCommandDescriptor.java @@ -15,9 +15,9 @@ package google.registry.model.domain.fee; import com.google.common.base.Ascii; -import com.google.common.base.CharMatcher; import google.registry.model.ImmutableObject; import google.registry.model.domain.fee.FeeQueryCommandExtensionItem.CommandName; +import java.util.Locale; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlValue; @@ -47,7 +47,7 @@ public class FeeExtensionCommandDescriptor extends ImmutableObject { public CommandName getCommand() { // Require the xml string to be lowercase. - if (command != null && CharMatcher.javaLowerCase().matchesAllOf(command)) { + if (command != null && command.toLowerCase(Locale.ENGLISH).equals(command)) { try { return CommandName.valueOf(Ascii.toUpperCase(command)); } catch (IllegalArgumentException e) { diff --git a/core/src/main/java/google/registry/model/domain/fee12/FeeCheckCommandExtensionItemV12.java b/core/src/main/java/google/registry/model/domain/fee12/FeeCheckCommandExtensionItemV12.java index 4bc0322a5..fe8079914 100644 --- a/core/src/main/java/google/registry/model/domain/fee12/FeeCheckCommandExtensionItemV12.java +++ b/core/src/main/java/google/registry/model/domain/fee12/FeeCheckCommandExtensionItemV12.java @@ -15,9 +15,9 @@ package google.registry.model.domain.fee12; import com.google.common.base.Ascii; -import com.google.common.base.CharMatcher; import google.registry.model.domain.Period; import google.registry.model.domain.fee.FeeCheckCommandExtensionItem; +import java.util.Locale; import java.util.Optional; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlElement; @@ -83,7 +83,7 @@ public class FeeCheckCommandExtensionItemV12 extends FeeCheckCommandExtensionIte @Override public CommandName getCommandName() { // Require the xml string to be lowercase. - if (commandName != null && CharMatcher.javaLowerCase().matchesAllOf(commandName)) { + if (commandName != null && commandName.toLowerCase(Locale.ENGLISH).equals(commandName)) { try { return CommandName.valueOf(Ascii.toUpperCase(commandName)); } catch (IllegalArgumentException e) { diff --git a/core/src/main/java/google/registry/tools/CreateOrUpdateTldCommand.java b/core/src/main/java/google/registry/tools/CreateOrUpdateTldCommand.java index 29b4963d5..e31c2cc92 100644 --- a/core/src/main/java/google/registry/tools/CreateOrUpdateTldCommand.java +++ b/core/src/main/java/google/registry/tools/CreateOrUpdateTldCommand.java @@ -19,7 +19,6 @@ import static google.registry.util.CollectionUtils.findDuplicates; import static google.registry.util.DomainNameUtils.canonicalizeDomainName; import com.beust.jcommander.Parameter; -import com.google.common.base.CharMatcher; import com.google.common.base.Joiner; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableSet; @@ -255,7 +254,7 @@ abstract class CreateOrUpdateTldCommand extends MutatingCommand { tld, canonicalizeDomainName(tld)); checkArgument( - !CharMatcher.javaDigit().matches(tld.charAt(0)), + !Character.isDigit(tld.charAt(0)), "TLDs cannot begin with a number"); Registry oldRegistry = getOldRegistry(tld); // TODO(b/26901539): Add a flag to set the pricing engine once we have more than one option.