move Pattern.quote and Pattern.LITERAL models to Regex.qll

This commit is contained in:
Jami Cogswell
2022-11-01 11:23:55 -04:00
parent 81ad10bab5
commit eb30e8fe9e
2 changed files with 16 additions and 13 deletions

View File

@@ -7,6 +7,22 @@ class TypeRegexPattern extends Class {
TypeRegexPattern() { this.hasQualifiedName("java.util.regex", "Pattern") }
}
/** The `quote` method of the `java.util.regex.Pattern` class. */
class PatternQuoteMethod extends Method {
PatternQuoteMethod() {
this.getDeclaringType() instanceof TypeRegexPattern and
this.hasName(["quote"])
}
}
/** The `LITERAL` field of the `java.util.regex.Pattern` class. */
class PatternLiteral extends Field {
PatternLiteral() {
this.getDeclaringType() instanceof TypeRegexPattern and
this.hasName("LITERAL")
}
}
private class RegexModel extends SummaryModelCsv {
override predicate row(string s) {
s =

View File

@@ -92,19 +92,6 @@ private class PatternRegexMethod extends Method {
}
}
/** The `quote` method of the `java.util.regex.Pattern` class. */
private class PatternQuoteMethod extends Method {
PatternQuoteMethod() { this.hasName(["quote"]) }
}
/** The `LITERAL` field of the `java.util.regex.Pattern` class. */
private class PatternLiteral extends Field {
PatternLiteral() {
this.getDeclaringType() instanceof TypeRegexPattern and
this.hasName("LITERAL")
}
}
/**
* The methods of the class `org.apache.commons.lang3.RegExUtils` that take
* a regular expression of type `String` as a parameter.