diff --git a/java/google/registry/model/BUILD b/java/google/registry/model/BUILD index 4d260235d..bae68b0ad 100644 --- a/java/google/registry/model/BUILD +++ b/java/google/registry/model/BUILD @@ -89,6 +89,7 @@ java_library( "//third_party/java/jsr305_annotations", "//third_party/java/jsr330_inject", "//third_party/java/objectify:objectify-v4_1", + "//third_party/java/re2j", "//third_party/java/servlet/servlet_api", "//java/google/registry/config", "//java/google/registry/util", diff --git a/java/google/registry/model/registrar/Registrar.java b/java/google/registry/model/registrar/Registrar.java index 23ad35cc9..d7beef51a 100644 --- a/java/google/registry/model/registrar/Registrar.java +++ b/java/google/registry/model/registrar/Registrar.java @@ -43,6 +43,7 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableSet; import com.google.common.collect.ImmutableSortedSet; import com.google.common.collect.Sets; +import com.google.re2j.Pattern; import com.googlecode.objectify.Key; import com.googlecode.objectify.Work; @@ -76,7 +77,6 @@ import java.util.List; import java.util.Map; import java.util.Objects; import java.util.Set; -import java.util.regex.Pattern; /** Information about a registrar. */ @Cache(expirationSeconds = RECOMMENDED_MEMCACHE_EXPIRATION) diff --git a/java/google/registry/rdap/BUILD b/java/google/registry/rdap/BUILD index afbce5ec2..c607814bc 100644 --- a/java/google/registry/rdap/BUILD +++ b/java/google/registry/rdap/BUILD @@ -23,6 +23,7 @@ java_library( "//third_party/java/jsr305_annotations", "//third_party/java/jsr330_inject", "//third_party/java/objectify:objectify-v4_1", + "//third_party/java/re2j", "//third_party/java/servlet/servlet_api", "//java/google/registry/config", "//java/google/registry/model", diff --git a/java/google/registry/rdap/RdapActionBase.java b/java/google/registry/rdap/RdapActionBase.java index 6ef83340c..427246563 100644 --- a/java/google/registry/rdap/RdapActionBase.java +++ b/java/google/registry/rdap/RdapActionBase.java @@ -29,6 +29,7 @@ import com.google.common.base.Optional; import com.google.common.collect.ImmutableMap; import com.google.common.net.InternetDomainName; import com.google.common.net.MediaType; +import com.google.re2j.Pattern; import com.googlecode.objectify.cmd.Query; @@ -47,7 +48,6 @@ import org.json.simple.JSONValue; import java.net.URI; import java.net.URISyntaxException; -import java.util.regex.Pattern; import javax.inject.Inject; diff --git a/java/google/registry/rdap/RdapEntityAction.java b/java/google/registry/rdap/RdapEntityAction.java index 544cfbaa0..fafb1c262 100644 --- a/java/google/registry/rdap/RdapEntityAction.java +++ b/java/google/registry/rdap/RdapEntityAction.java @@ -20,6 +20,7 @@ import static google.registry.request.Action.Method.HEAD; import com.google.common.base.Optional; import com.google.common.collect.ImmutableMap; +import com.google.re2j.Pattern; import com.googlecode.objectify.Key; @@ -32,8 +33,6 @@ import google.registry.request.HttpException.BadRequestException; import google.registry.request.HttpException.NotFoundException; import google.registry.util.Clock; -import java.util.regex.Pattern; - import javax.inject.Inject; /** diff --git a/java/google/registry/rde/BUILD b/java/google/registry/rde/BUILD index d4b1b7895..8d0d1274a 100644 --- a/java/google/registry/rde/BUILD +++ b/java/google/registry/rde/BUILD @@ -28,6 +28,7 @@ java_library( "//third_party/java/jsr305_annotations", "//third_party/java/jsr330_inject", "//third_party/java/objectify:objectify-v4_1", + "//third_party/java/re2j", "//third_party/java/servlet/servlet_api", "//java/google/registry/config", "//java/google/registry/gcs", diff --git a/java/google/registry/rde/RdeUtil.java b/java/google/registry/rde/RdeUtil.java index 8df29877d..90b0dbf4b 100644 --- a/java/google/registry/rde/RdeUtil.java +++ b/java/google/registry/rde/RdeUtil.java @@ -18,6 +18,8 @@ import static google.registry.util.HexDumper.dumpHex; import static java.nio.charset.StandardCharsets.UTF_8; import com.google.common.io.BaseEncoding; +import com.google.re2j.Matcher; +import com.google.re2j.Pattern; import google.registry.xjc.rde.XjcRdeRrType; import google.registry.xml.XmlException; @@ -30,8 +32,6 @@ import org.joda.time.format.ISODateTimeFormat; import java.io.BufferedInputStream; import java.io.IOException; import java.nio.ByteBuffer; -import java.util.regex.Matcher; -import java.util.regex.Pattern; /** Helper methods for RDE. */ public final class RdeUtil { diff --git a/java/google/registry/repositories.bzl b/java/google/registry/repositories.bzl index 82c820b69..10430a78a 100644 --- a/java/google/registry/repositories.bzl +++ b/java/google/registry/repositories.bzl @@ -508,6 +508,12 @@ def domain_registry_repositories(): sha1 = "f7122f6ab1f64bdf9f5970b0e89bfb355e036897", ) + native.maven_jar( + name = "re2j", + artifact = "com.google.re2j:re2j:1.1", + sha1 = "d716952ab58aa4369ea15126505a36544d50a333", + ) + native.maven_jar( name = "servlet_api", artifact = "org.apache.tomcat:servlet-api:6.0.20", diff --git a/java/google/registry/tldconfig/idn/BUILD b/java/google/registry/tldconfig/idn/BUILD index f8cd5de16..17f612947 100644 --- a/java/google/registry/tldconfig/idn/BUILD +++ b/java/google/registry/tldconfig/idn/BUILD @@ -17,6 +17,7 @@ java_library( "//third_party/java/joda_time", "//third_party/java/jsr305_annotations", "//third_party/java/objectify:objectify-v4_1", + "//third_party/java/re2j", "//third_party/java/servlet/servlet_api", "//java/google/registry/util", ], diff --git a/java/google/registry/tldconfig/idn/IdnTable.java b/java/google/registry/tldconfig/idn/IdnTable.java index cfb1a91f7..14e24b43c 100644 --- a/java/google/registry/tldconfig/idn/IdnTable.java +++ b/java/google/registry/tldconfig/idn/IdnTable.java @@ -21,10 +21,10 @@ import com.google.common.base.Optional; import com.google.common.collect.ImmutableRangeSet; import com.google.common.collect.Range; import com.google.common.collect.RangeSet; +import com.google.re2j.Matcher; +import com.google.re2j.Pattern; import java.net.URI; -import java.util.regex.Matcher; -import java.util.regex.Pattern; /** An IDN table for a particular TLD. */ public final class IdnTable { diff --git a/java/google/registry/tmch/BUILD b/java/google/registry/tmch/BUILD index 577f3511c..8e78780e4 100644 --- a/java/google/registry/tmch/BUILD +++ b/java/google/registry/tmch/BUILD @@ -28,9 +28,9 @@ java_library( "//third_party/java/jsr305_annotations", "//third_party/java/jsr330_inject", "//third_party/java/objectify:objectify-v4_1", + "//third_party/java/re2j", "//third_party/java/servlet/servlet_api", "//java/google/registry/config", - "//java/google/registry/cron", "//java/google/registry/keyring/api", "//java/google/registry/model", "//java/google/registry/request", diff --git a/java/google/registry/tmch/LordnLog.java b/java/google/registry/tmch/LordnLog.java index 614aa3b3e..fb1bd4a9d 100644 --- a/java/google/registry/tmch/LordnLog.java +++ b/java/google/registry/tmch/LordnLog.java @@ -20,6 +20,7 @@ import static com.google.common.base.Preconditions.checkNotNull; import com.google.common.base.Splitter; import com.google.common.collect.ImmutableMap; +import com.google.re2j.Pattern; import org.joda.time.DateTime; @@ -27,7 +28,6 @@ import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Map.Entry; -import java.util.regex.Pattern; import javax.annotation.Nullable; import javax.annotation.concurrent.Immutable; diff --git a/java/google/registry/tools/AppEngineConnection.java b/java/google/registry/tools/AppEngineConnection.java index c828db331..55f6bc7d2 100644 --- a/java/google/registry/tools/AppEngineConnection.java +++ b/java/google/registry/tools/AppEngineConnection.java @@ -30,6 +30,8 @@ import com.google.common.collect.Iterables; import com.google.common.io.CharStreams; import com.google.common.net.HostAndPort; import com.google.common.net.MediaType; +import com.google.re2j.Matcher; +import com.google.re2j.Pattern; import com.beust.jcommander.Parameter; import com.beust.jcommander.Parameters; @@ -49,8 +51,6 @@ import java.net.URL; import java.net.URLEncoder; import java.util.Map; import java.util.Map.Entry; -import java.util.regex.Matcher; -import java.util.regex.Pattern; /** An http connection to the appengine server. */ @Parameters(separators = " =") diff --git a/java/google/registry/tools/BUILD b/java/google/registry/tools/BUILD index 712e81824..e8a021582 100644 --- a/java/google/registry/tools/BUILD +++ b/java/google/registry/tools/BUILD @@ -73,6 +73,7 @@ java_library( "//third_party/java/jsr305_annotations", "//third_party/java/jsr330_inject", "//third_party/java/objectify:objectify-v4_1", + "//third_party/java/re2j", "//third_party/java/appengine:appengine-remote-api", diff --git a/java/google/registry/tools/CreateAuctionCreditsCommand.java b/java/google/registry/tools/CreateAuctionCreditsCommand.java index 81daa9185..86d5284ed 100644 --- a/java/google/registry/tools/CreateAuctionCreditsCommand.java +++ b/java/google/registry/tools/CreateAuctionCreditsCommand.java @@ -27,6 +27,8 @@ import com.google.common.base.Splitter; import com.google.common.collect.FluentIterable; import com.google.common.collect.ImmutableMultimap; import com.google.common.collect.Iterables; +import com.google.re2j.Matcher; +import com.google.re2j.Pattern; import com.beust.jcommander.Parameter; import com.beust.jcommander.Parameters; @@ -49,8 +51,6 @@ import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.nio.file.Path; import java.util.List; -import java.util.regex.Matcher; -import java.util.regex.Pattern; /** * Command for creating new auction credits based on a CSV file from Pool. diff --git a/java/google/registry/tools/SetupOteCommand.java b/java/google/registry/tools/SetupOteCommand.java index 3b4782e41..434a83735 100644 --- a/java/google/registry/tools/SetupOteCommand.java +++ b/java/google/registry/tools/SetupOteCommand.java @@ -20,6 +20,7 @@ import static google.registry.util.X509Utils.loadCertificate; import com.google.common.base.Optional; import com.google.common.collect.ImmutableList; +import com.google.re2j.Pattern; import com.beust.jcommander.Parameter; import com.beust.jcommander.Parameters; @@ -36,7 +37,6 @@ import org.joda.time.Duration; import java.nio.file.Path; import java.util.ArrayList; import java.util.List; -import java.util.regex.Pattern; import javax.inject.Inject; diff --git a/java/google/registry/tools/params/BUILD b/java/google/registry/tools/params/BUILD index a58eb28e2..a727ab9d7 100644 --- a/java/google/registry/tools/params/BUILD +++ b/java/google/registry/tools/params/BUILD @@ -19,6 +19,7 @@ java_library( "//third_party/java/joda_money", "//third_party/java/joda_time", "//third_party/java/jsr305_annotations", + "//third_party/java/re2j", "//java/google/registry/model", "//java/google/registry/util", ], diff --git a/java/google/registry/tools/params/PathParameter.java b/java/google/registry/tools/params/PathParameter.java index 64f96fba8..8911ecad7 100644 --- a/java/google/registry/tools/params/PathParameter.java +++ b/java/google/registry/tools/params/PathParameter.java @@ -17,13 +17,14 @@ package google.registry.tools.params; import static com.google.common.base.Preconditions.checkArgument; import static com.google.common.base.Preconditions.checkNotNull; +import com.google.re2j.Pattern; + import com.beust.jcommander.ParameterException; import java.net.URI; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; -import java.util.regex.Pattern; /** Filesystem path CLI parameter converter/validator. */ public class PathParameter extends ParameterConverterValidator { diff --git a/java/google/registry/tools/params/PhoneNumberParameter.java b/java/google/registry/tools/params/PhoneNumberParameter.java index 82b84d9ca..1e881f3e6 100644 --- a/java/google/registry/tools/params/PhoneNumberParameter.java +++ b/java/google/registry/tools/params/PhoneNumberParameter.java @@ -16,7 +16,7 @@ package google.registry.tools.params; import static com.google.common.base.Preconditions.checkArgument; -import java.util.regex.Pattern; +import com.google.re2j.Pattern; /** Phone number CLI parameter converter/validator. */ public final class PhoneNumberParameter extends ParameterConverterValidator { diff --git a/java/google/registry/ui/forms/BUILD b/java/google/registry/ui/forms/BUILD index 3f9b362f8..9ef77929f 100644 --- a/java/google/registry/ui/forms/BUILD +++ b/java/google/registry/ui/forms/BUILD @@ -12,5 +12,6 @@ java_library( "//java/com/google/common/base", "//java/com/google/common/collect", "//third_party/java/jsr305_annotations", + "//third_party/java/re2j", ], ) diff --git a/java/google/registry/ui/forms/FormField.java b/java/google/registry/ui/forms/FormField.java index 0769d1f0f..8359011db 100644 --- a/java/google/registry/ui/forms/FormField.java +++ b/java/google/registry/ui/forms/FormField.java @@ -27,12 +27,12 @@ import com.google.common.collect.FluentIterable; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Range; +import com.google.re2j.Pattern; import java.util.Collection; import java.util.List; import java.util.Map; import java.util.Set; -import java.util.regex.Pattern; import javax.annotation.Detainted; import javax.annotation.Nonnull; diff --git a/java/google/registry/ui/forms/FormFields.java b/java/google/registry/ui/forms/FormFields.java index 2e63898d7..fba54a162 100644 --- a/java/google/registry/ui/forms/FormFields.java +++ b/java/google/registry/ui/forms/FormFields.java @@ -21,8 +21,7 @@ import static java.util.Locale.getISOCountries; import com.google.common.base.Function; import com.google.common.collect.ImmutableSet; - -import java.util.regex.Pattern; +import com.google.re2j.Pattern; import javax.annotation.Nullable; diff --git a/java/google/registry/ui/server/BUILD b/java/google/registry/ui/server/BUILD index 94d6fd419..c11c2818a 100644 --- a/java/google/registry/ui/server/BUILD +++ b/java/google/registry/ui/server/BUILD @@ -17,7 +17,6 @@ java_library( "//java/com/google/common/io", "//java/com/google/common/net", "//java/google/registry/model", - "//java/google/registry/security", "//java/google/registry/ui", "//java/google/registry/ui/forms", "//java/google/registry/util", @@ -25,6 +24,7 @@ java_library( "//third_party/java/joda_time", "//third_party/java/json_simple", "//third_party/java/jsr305_annotations", + "//third_party/java/re2j", "//third_party/java/servlet/servlet_api", "//third_party/closure/templates", diff --git a/java/google/registry/ui/server/RegistrarFormFields.java b/java/google/registry/ui/server/RegistrarFormFields.java index e4457dff6..e8aa78e03 100644 --- a/java/google/registry/ui/server/RegistrarFormFields.java +++ b/java/google/registry/ui/server/RegistrarFormFields.java @@ -23,6 +23,7 @@ import com.google.common.base.Function; import com.google.common.base.Splitter; import com.google.common.collect.ImmutableList; import com.google.common.net.InternetDomainName; +import com.google.re2j.Pattern; import google.registry.model.registrar.Registrar; import google.registry.model.registrar.RegistrarAddress; @@ -37,7 +38,6 @@ import java.security.cert.CertificateParsingException; import java.util.List; import java.util.Map; import java.util.Set; -import java.util.regex.Pattern; import javax.annotation.Nullable; @@ -45,7 +45,7 @@ import javax.annotation.Nullable; public final class RegistrarFormFields { public static final Pattern BASE64_PATTERN = Pattern.compile("[+/a-zA-Z0-9]*"); - public static final Pattern ASCII_PATTERN = Pattern.compile("\\p{ASCII}*"); + public static final Pattern ASCII_PATTERN = Pattern.compile("[[:ascii:]]*"); public static final String ASCII_ERROR = "Please only use ASCII-US characters."; private static final Function CIDR_TRANSFORM = diff --git a/java/google/registry/ui/server/SoyTemplateUtils.java b/java/google/registry/ui/server/SoyTemplateUtils.java index b0d402ca1..9d103464a 100644 --- a/java/google/registry/ui/server/SoyTemplateUtils.java +++ b/java/google/registry/ui/server/SoyTemplateUtils.java @@ -25,6 +25,8 @@ import com.google.common.base.Splitter; import com.google.common.base.Supplier; import com.google.common.collect.ImmutableMap; import com.google.common.io.Resources; +import com.google.re2j.Matcher; +import com.google.re2j.Pattern; import com.google.template.soy.SoyFileSet; import com.google.template.soy.SoyUtils; import com.google.template.soy.base.SoySyntaxException; @@ -40,8 +42,6 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -import java.util.regex.Matcher; -import java.util.regex.Pattern; /** Helper methods for rendering Soy templates from Java code. */ public final class SoyTemplateUtils { diff --git a/java/google/registry/ui/server/registrar/BUILD b/java/google/registry/ui/server/registrar/BUILD index c5f93bd36..d986ce8dc 100644 --- a/java/google/registry/ui/server/registrar/BUILD +++ b/java/google/registry/ui/server/registrar/BUILD @@ -16,6 +16,7 @@ java_library( "//java/com/google/common/collect", "//java/com/google/common/io", "//java/com/google/common/net", + "//third_party/java/re2j", "//java/google/registry/braintree", "//java/google/registry/config", "//java/google/registry/export/sheet", diff --git a/java/google/registry/ui/server/registrar/RegistrarPaymentAction.java b/java/google/registry/ui/server/registrar/RegistrarPaymentAction.java index 100eeae26..73d8bd52d 100644 --- a/java/google/registry/ui/server/registrar/RegistrarPaymentAction.java +++ b/java/google/registry/ui/server/registrar/RegistrarPaymentAction.java @@ -23,6 +23,7 @@ import static java.util.Arrays.asList; import com.google.common.base.Function; import com.google.common.collect.ImmutableMap; +import com.google.re2j.Pattern; import com.braintreegateway.BraintreeGateway; import com.braintreegateway.Result; @@ -49,7 +50,6 @@ import java.math.BigDecimal; import java.util.List; import java.util.Locale; import java.util.Map; -import java.util.regex.Pattern; import javax.inject.Inject; diff --git a/java/google/registry/util/BUILD b/java/google/registry/util/BUILD index 6915eb479..277fe5b1b 100644 --- a/java/google/registry/util/BUILD +++ b/java/google/registry/util/BUILD @@ -28,6 +28,7 @@ java_library( "//third_party/java/jsr305_annotations", "//third_party/java/jsr330_inject", "//third_party/java/objectify:objectify-v4_1", + "//third_party/java/re2j", "//third_party/java/servlet/servlet_api", "//java/google/registry/config", ], diff --git a/java/google/registry/util/SqlTemplate.java b/java/google/registry/util/SqlTemplate.java index 66d72a8ba..f588db9af 100644 --- a/java/google/registry/util/SqlTemplate.java +++ b/java/google/registry/util/SqlTemplate.java @@ -22,11 +22,11 @@ import static google.registry.util.PreconditionsUtils.checkArgumentNotNull; import com.google.common.base.CharMatcher; import com.google.common.base.Joiner; import com.google.common.collect.ImmutableMap; +import com.google.re2j.Matcher; +import com.google.re2j.Pattern; import java.util.HashSet; import java.util.Set; -import java.util.regex.Matcher; -import java.util.regex.Pattern; import javax.annotation.concurrent.Immutable; diff --git a/java/google/registry/xml/BUILD b/java/google/registry/xml/BUILD index a6d907a05..f843d5958 100644 --- a/java/google/registry/xml/BUILD +++ b/java/google/registry/xml/BUILD @@ -20,5 +20,6 @@ java_library( "//java/com/google/common/io", "//third_party/java/joda_time", "//third_party/java/jsr305_annotations", + "//third_party/java/re2j", ], ) diff --git a/java/google/registry/xml/XmlFragmentMarshaller.java b/java/google/registry/xml/XmlFragmentMarshaller.java index 788db7abc..5235ca3c6 100644 --- a/java/google/registry/xml/XmlFragmentMarshaller.java +++ b/java/google/registry/xml/XmlFragmentMarshaller.java @@ -18,8 +18,9 @@ import static com.google.common.base.Throwables.propagateIfInstanceOf; import static com.google.common.base.Verify.verify; import static java.nio.charset.StandardCharsets.UTF_8; +import com.google.re2j.Pattern; + import java.io.ByteArrayOutputStream; -import java.util.regex.Pattern; import javax.annotation.concurrent.NotThreadSafe; import javax.xml.bind.JAXBContext; diff --git a/javatests/google/registry/flows/BUILD b/javatests/google/registry/flows/BUILD index 251460ce9..ab253abe8 100644 --- a/javatests/google/registry/flows/BUILD +++ b/javatests/google/registry/flows/BUILD @@ -37,6 +37,7 @@ java_library( "//third_party/java/junit", "//third_party/java/mockito", "//third_party/java/objectify:objectify-v4_1", + "//third_party/java/re2j", "//third_party/java/servlet/servlet_api", "//third_party/java/truth", "//java/google/registry/config", diff --git a/javatests/google/registry/flows/EppTlsServletTest.java b/javatests/google/registry/flows/EppTlsServletTest.java index 5e30a01de..c80ce1aa9 100644 --- a/javatests/google/registry/flows/EppTlsServletTest.java +++ b/javatests/google/registry/flows/EppTlsServletTest.java @@ -19,6 +19,8 @@ import static java.nio.charset.StandardCharsets.UTF_8; import static org.mockito.Mockito.when; import com.google.common.collect.ImmutableMap; +import com.google.re2j.Matcher; +import com.google.re2j.Pattern; import google.registry.model.registrar.Registrar; import google.registry.testing.AppEngineRule; @@ -31,9 +33,6 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.runners.MockitoJUnitRunner; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - /** Test setup for EppServletTest subclasses. */ @RunWith(MockitoJUnitRunner.class) public class EppTlsServletTest extends EppServletXmlLoginTestCase { diff --git a/javatests/google/registry/tools/BUILD b/javatests/google/registry/tools/BUILD index 71cde4e68..abc144f02 100644 --- a/javatests/google/registry/tools/BUILD +++ b/javatests/google/registry/tools/BUILD @@ -32,6 +32,7 @@ java_library( "//third_party/java/junit", "//third_party/java/mockito", "//third_party/java/objectify:objectify-v4_1", + "//third_party/java/re2j", "//third_party/java/truth", "//java/google/registry/config", "//java/google/registry/flows", diff --git a/javatests/google/registry/tools/CommandTestCase.java b/javatests/google/registry/tools/CommandTestCase.java index c79af6b26..246a95366 100644 --- a/javatests/google/registry/tools/CommandTestCase.java +++ b/javatests/google/registry/tools/CommandTestCase.java @@ -44,7 +44,6 @@ import java.io.File; import java.io.IOException; import java.io.PrintStream; import java.util.List; -import java.util.regex.Pattern; /** * Base class for all command tests. @@ -154,10 +153,6 @@ public abstract class CommandTestCase { assertThat(stdout.toString(UTF_8.toString())).contains(expected); } - void assertInStdout(Pattern expected) throws Exception { - assertThat(stdout.toString(UTF_8.toString())).containsMatch(expected); - } - void assertNotInStdout(String expected) throws Exception { assertThat(stdout.toString(UTF_8.toString())).doesNotContain(expected); } diff --git a/javatests/google/registry/tools/server/BUILD b/javatests/google/registry/tools/server/BUILD index 0e34c2b07..691e9cff7 100644 --- a/javatests/google/registry/tools/server/BUILD +++ b/javatests/google/registry/tools/server/BUILD @@ -23,6 +23,7 @@ java_library( "//third_party/java/junit", "//third_party/java/mockito", "//third_party/java/objectify:objectify-v4_1", + "//third_party/java/re2j", "//third_party/java/servlet/servlet_api", "//third_party/java/truth", "//java/google/registry/groups", diff --git a/javatests/google/registry/ui/forms/BUILD b/javatests/google/registry/ui/forms/BUILD index 2572b529b..d799edcfc 100644 --- a/javatests/google/registry/ui/forms/BUILD +++ b/javatests/google/registry/ui/forms/BUILD @@ -18,6 +18,7 @@ java_library( "//third_party/java/hamcrest", "//third_party/java/junit", "//third_party/java/mockito", + "//third_party/java/re2j", "//third_party/java/truth", "//java/google/registry/ui/forms", ], diff --git a/javatests/google/registry/ui/forms/FormFieldTest.java b/javatests/google/registry/ui/forms/FormFieldTest.java index 7cef987df..a53be3215 100644 --- a/javatests/google/registry/ui/forms/FormFieldTest.java +++ b/javatests/google/registry/ui/forms/FormFieldTest.java @@ -30,6 +30,7 @@ import com.google.common.collect.ImmutableSet; import com.google.common.collect.Lists; import com.google.common.collect.Range; import com.google.common.testing.NullPointerTester; +import com.google.re2j.Pattern; import org.junit.Rule; import org.junit.Test; @@ -40,7 +41,6 @@ import org.junit.runners.JUnit4; import java.util.List; import java.util.Map; import java.util.Set; -import java.util.regex.Pattern; /** Unit tests for {@link FormField}. */ @RunWith(JUnit4.class) diff --git a/javatests/google/registry/util/BUILD b/javatests/google/registry/util/BUILD index c3d1f1b9e..80f3bc98e 100644 --- a/javatests/google/registry/util/BUILD +++ b/javatests/google/registry/util/BUILD @@ -23,6 +23,7 @@ java_library( "//third_party/java/jsr305_annotations", "//third_party/java/junit", "//third_party/java/mockito", + "//third_party/java/re2j", "//third_party/java/truth", "//java/google/registry/util", "//javatests/google/registry/testing", diff --git a/javatests/google/registry/xjc/BUILD b/javatests/google/registry/xjc/BUILD index dd46d1225..203331bac 100644 --- a/javatests/google/registry/xjc/BUILD +++ b/javatests/google/registry/xjc/BUILD @@ -16,6 +16,7 @@ java_library( "//third_party/java/hamcrest", "//third_party/java/jsr305_annotations", "//third_party/java/junit", + "//third_party/java/re2j", "//third_party/java/truth", "//java/google/registry/util", "//java/google/registry/xjc", diff --git a/javatests/google/registry/xjc/XjcObjectTest.java b/javatests/google/registry/xjc/XjcObjectTest.java index 4e1d48d99..d67d15fe0 100644 --- a/javatests/google/registry/xjc/XjcObjectTest.java +++ b/javatests/google/registry/xjc/XjcObjectTest.java @@ -21,6 +21,8 @@ import static google.registry.xjc.XjcXmlTransformer.unmarshal; import static java.nio.charset.StandardCharsets.UTF_16; import static java.nio.charset.StandardCharsets.UTF_8; +import com.google.re2j.Pattern; + import google.registry.testing.ExceptionRule; import google.registry.xjc.rde.XjcRdeDeposit; import google.registry.xjc.rde.XjcRdeDepositTypeType; @@ -33,7 +35,6 @@ import org.junit.runners.JUnit4; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; -import java.util.regex.Pattern; /** Unit tests for {@code XjcObject}. */ @RunWith(JUnit4.class) diff --git a/third_party/java/re2j/BUILD b/third_party/java/re2j/BUILD new file mode 100644 index 000000000..1918251b0 --- /dev/null +++ b/third_party/java/re2j/BUILD @@ -0,0 +1,8 @@ +package(default_visibility = ["//visibility:public"]) + +licenses(["notice"]) # BSD + +java_library( + name = "re2j", + exports = ["@re2j//jar"], +)