mirror of
https://github.com/google/nomulus.git
synced 2025-05-15 17:07:15 +02:00
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:
parent
3291eb8b70
commit
6082146d55
42 changed files with 64 additions and 39 deletions
|
@ -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 = " =")
|
||||
|
|
|
@ -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",
|
||||
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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",
|
||||
],
|
||||
|
|
|
@ -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<Path> {
|
||||
|
|
|
@ -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<String> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue