Skip to content

Commit 0bf1370

Browse files
committed
Java: Autoformat QL
1 parent 691473b commit 0bf1370

File tree

4 files changed

+7
-11
lines changed

4 files changed

+7
-11
lines changed

java/ql/lib/semmle/code/java/frameworks/javaee/ejb/EJBRestrictions.qll

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -415,8 +415,7 @@ class EnableReplaceObjectMethod extends Method {
415415
this.hasName("enableReplaceObject") and
416416
this.getNumberOfParameters() = 1 and
417417
this.getParameter(0).getType().(PrimitiveType).hasName("boolean") and
418-
this.getDeclaringType().getAnAncestor().getSourceDeclaration() instanceof
419-
TypeObjectOutputStream
418+
this.getDeclaringType().getAnAncestor().getSourceDeclaration() instanceof TypeObjectOutputStream
420419
}
421420
}
422421

@@ -429,8 +428,7 @@ class ReplaceObjectMethod extends Method {
429428
this.hasName("replaceObject") and
430429
this.getNumberOfParameters() = 1 and
431430
this.getParameter(0).getType() instanceof TypeObject and
432-
this.getDeclaringType().getAnAncestor().getSourceDeclaration() instanceof
433-
TypeObjectOutputStream
431+
this.getDeclaringType().getAnAncestor().getSourceDeclaration() instanceof TypeObjectOutputStream
434432
}
435433
}
436434

java/ql/src/Likely Bugs/Likely Typos/MissingSpaceTypo.ql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ where
2323
// completely to distinguish grammatical punctuation after which a space is
2424
// needed, and intra-identifier punctuation in, for example, a fully
2525
// qualified java class name.
26-
pragma[only_bind_into](s).getLiteral()
26+
pragma[only_bind_into](s)
27+
.getLiteral()
2728
.regexpCapture(".* (([-A-Za-z/'\\.:,]*[a-zA-Z]|[0-9]+)[\\.:,;!?']*)\"[^\"]*\\+[^\"]*\"[a-zA-Z].*",
2829
1) = word and
2930
not word.regexpMatch(".*[,\\.:].*[a-zA-Z].*[^a-zA-Z]")

java/ql/src/Violations of Best Practice/Dead Code/DeadRefTypes.ql

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,8 @@ import semmle.code.java.Reflection
1818
* Gets a transitive superType avoiding magic optimisation
1919
*/
2020
pragma[nomagic]
21-
cached private RefType getASuperTypePlus(RefType t) {
22-
hasDescendant(result, t) and result != t
23-
}
21+
cached
22+
private RefType getASuperTypePlus(RefType t) { hasDescendant(result, t) and result != t }
2423

2524
/**
2625
* A class or interface that is not used anywhere.

java/ql/src/experimental/Security/CWE/CWE-489/WebComponentMain.ql

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,7 @@ class WebComponentMainMethod extends Method {
3737
this.getDeclaringType() instanceof ServletClass or
3838
this.getDeclaringType() instanceof ServletFilterClass or
3939
this.getDeclaringType() instanceof ServletListenerClass or
40-
this.getDeclaringType()
41-
.getAnAncestor()
42-
.hasQualifiedName("org.apache.struts.action", "Action") or // Struts actions
40+
this.getDeclaringType().getAnAncestor().hasQualifiedName("org.apache.struts.action", "Action") or // Struts actions
4341
this.getDeclaringType()
4442
.getAStrictAncestor()
4543
.hasQualifiedName("com.opensymphony.xwork2", "ActionSupport") or // Struts 2 actions

0 commit comments

Comments
 (0)