Prefer re2 over java.util.regex

Java's stock regex implementation doesn't guarantee linear time
complexity which makes it a security liability.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=121159875
This commit is contained in:
jart 2016-04-29 15:54:39 -07:00 committed by Justine Tunney
parent 3291eb8b70
commit 6082146d55
42 changed files with 64 additions and 39 deletions

View file

@ -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",

View file

@ -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;

View file

@ -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;
/**