mirror of
https://github.com/github/codeql.git
synced 2026-04-30 03:05:15 +02:00
Java: Replace '.prefix'/'.suffix' with '.matches'.
This commit is contained in:
@@ -37,7 +37,7 @@ predicate isGigaSpacesEventMethod(Method eventMethod) {
|
||||
class GigaSpacesSpaceIdGetterMethod extends Method {
|
||||
GigaSpacesSpaceIdGetterMethod() {
|
||||
getAnAnnotation().getType().hasQualifiedName("com.gigaspaces.annotation.pojo", "SpaceId") and
|
||||
getName().prefix(3) = "get"
|
||||
getName().matches("get%")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ class GigaSpacesSpaceIdSetterMethod extends Method {
|
||||
GigaSpacesSpaceIdSetterMethod() {
|
||||
exists(GigaSpacesSpaceIdGetterMethod getterMethod |
|
||||
getterMethod.getDeclaringType() = getDeclaringType() and
|
||||
getName().prefix(3) = "set"
|
||||
getName().matches("set%")
|
||||
|
|
||||
getterMethod.getName().suffix(3) = getName().suffix(3)
|
||||
)
|
||||
@@ -62,6 +62,6 @@ class GigaSpacesSpaceIdSetterMethod extends Method {
|
||||
class GigaSpacesSpaceRoutingMethod extends Method {
|
||||
GigaSpacesSpaceRoutingMethod() {
|
||||
getAnAnnotation().getType().hasQualifiedName("com.gigaspaces.annotation.pojo", "SpaceRouting") and
|
||||
getName().prefix(3) = "get"
|
||||
getName().matches("get%")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ class SpringProfileExpr extends string {
|
||||
* A Spring profile expression that begins with "!", indicating a negated expression.
|
||||
*/
|
||||
class NotSpringProfileExpr extends SpringProfileExpr {
|
||||
NotSpringProfileExpr() { this.prefix(1) = "!" }
|
||||
NotSpringProfileExpr() { this.matches("!%") }
|
||||
|
||||
/**
|
||||
* Gets the profile described in this profile expression.
|
||||
|
||||
@@ -129,7 +129,7 @@ class Pom extends ProtoPom {
|
||||
* occurs by considering the properties defined by this project or an ancestor project.
|
||||
*/
|
||||
string resolvePlaceholder(string name) {
|
||||
if name.prefix(8) = "project."
|
||||
if name.matches("project.%")
|
||||
then
|
||||
exists(PomElement p |
|
||||
p = getProjectProperty() and
|
||||
|
||||
Reference in New Issue
Block a user