mirror of
https://github.com/google/nomulus.git
synced 2025-08-04 08:52:12 +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
|
@ -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",
|
||||
|
|
|
@ -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<C extends Command> {
|
|||
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);
|
||||
}
|
||||
|
|
|
@ -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",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue