mirror of
https://github.com/github/codeql.git
synced 2026-04-30 19:26:02 +02:00
Java: Autoformat QL
This commit is contained in:
@@ -415,8 +415,7 @@ class EnableReplaceObjectMethod extends Method {
|
||||
this.hasName("enableReplaceObject") and
|
||||
this.getNumberOfParameters() = 1 and
|
||||
this.getParameter(0).getType().(PrimitiveType).hasName("boolean") and
|
||||
this.getDeclaringType().getAnAncestor().getSourceDeclaration() instanceof
|
||||
TypeObjectOutputStream
|
||||
this.getDeclaringType().getAnAncestor().getSourceDeclaration() instanceof TypeObjectOutputStream
|
||||
}
|
||||
}
|
||||
|
||||
@@ -429,8 +428,7 @@ class ReplaceObjectMethod extends Method {
|
||||
this.hasName("replaceObject") and
|
||||
this.getNumberOfParameters() = 1 and
|
||||
this.getParameter(0).getType() instanceof TypeObject and
|
||||
this.getDeclaringType().getAnAncestor().getSourceDeclaration() instanceof
|
||||
TypeObjectOutputStream
|
||||
this.getDeclaringType().getAnAncestor().getSourceDeclaration() instanceof TypeObjectOutputStream
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -23,7 +23,8 @@ where
|
||||
// completely to distinguish grammatical punctuation after which a space is
|
||||
// needed, and intra-identifier punctuation in, for example, a fully
|
||||
// qualified java class name.
|
||||
pragma[only_bind_into](s).getLiteral()
|
||||
pragma[only_bind_into](s)
|
||||
.getLiteral()
|
||||
.regexpCapture(".* (([-A-Za-z/'\\.:,]*[a-zA-Z]|[0-9]+)[\\.:,;!?']*)\"[^\"]*\\+[^\"]*\"[a-zA-Z].*",
|
||||
1) = word and
|
||||
not word.regexpMatch(".*[,\\.:].*[a-zA-Z].*[^a-zA-Z]")
|
||||
|
||||
@@ -18,9 +18,8 @@ import semmle.code.java.Reflection
|
||||
* Gets a transitive superType avoiding magic optimisation
|
||||
*/
|
||||
pragma[nomagic]
|
||||
cached private RefType getASuperTypePlus(RefType t) {
|
||||
hasDescendant(result, t) and result != t
|
||||
}
|
||||
cached
|
||||
private RefType getASuperTypePlus(RefType t) { hasDescendant(result, t) and result != t }
|
||||
|
||||
/**
|
||||
* A class or interface that is not used anywhere.
|
||||
|
||||
@@ -37,9 +37,7 @@ class WebComponentMainMethod extends Method {
|
||||
this.getDeclaringType() instanceof ServletClass or
|
||||
this.getDeclaringType() instanceof ServletFilterClass or
|
||||
this.getDeclaringType() instanceof ServletListenerClass or
|
||||
this.getDeclaringType()
|
||||
.getAnAncestor()
|
||||
.hasQualifiedName("org.apache.struts.action", "Action") or // Struts actions
|
||||
this.getDeclaringType().getAnAncestor().hasQualifiedName("org.apache.struts.action", "Action") or // Struts actions
|
||||
this.getDeclaringType()
|
||||
.getAStrictAncestor()
|
||||
.hasQualifiedName("com.opensymphony.xwork2", "ActionSupport") or // Struts 2 actions
|
||||
|
||||
Reference in New Issue
Block a user