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

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

View file

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

View file

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