Use set literals

This commit is contained in:
Owen Mansel-Chan
2025-11-28 03:34:17 +00:00
parent 62238fcbd7
commit 22b614ac48
2 changed files with 3 additions and 19 deletions

View File

@@ -321,12 +321,7 @@ class WriteObjectMethod extends Method {
class ReadObjectMethod extends Method {
ReadObjectMethod() {
this.getDeclaringType() instanceof TypeObjectInputStream and
(
this.hasName("readObject") or
this.hasName("readObjectOverride") or
this.hasName("readUnshared") or
this.hasName("resolveObject")
)
this.hasName(["readObject", "readObjectOverride", "readUnshared", "resolveObject"])
}
}

View File

@@ -40,12 +40,7 @@ class Struts2ActionClass extends Class {
getStrutsMapperClass(this) = "org.apache.struts2.dispatcher.mapper.RestfulActionMapper"
then
// The "Restful" action mapper maps rest APIs to specific methods
result.hasName("index") or
result.hasName("create") or
result.hasName("editNew") or
result.hasName("view") or
result.hasName("remove") or
result.hasName("update")
result.hasName(["index", "create", "editNew", "view", "remove", "update"])
else
if
getStrutsMapperClass(this) = "org.apache.struts2.rest.RestActionMapper" or
@@ -53,13 +48,7 @@ class Struts2ActionClass extends Class {
then
// The "Rest" action mapper is provided with the rest plugin, and maps rest APIs to specific
// methods based on a "ruby-on-rails" style.
result.hasName("index") or
result.hasName("show") or
result.hasName("edit") or
result.hasName("editNew") or
result.hasName("create") or
result.hasName("update") or
result.hasName("destroy")
result.hasName(["index", "show", "edit", "editNew", "create", "update", "destroy"])
else
if exists(getStrutsMapperClass(this))
then