Skip to content

Commit d8b8422

Browse files
committed
Java: Autoformat.
1 parent 843fd37 commit d8b8422

File tree

4 files changed

+5
-15
lines changed

4 files changed

+5
-15
lines changed

java/ql/src/Language Abuse/UselessUpcast.ql

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,7 @@ predicate usefulUpcast(CastExpr e) {
3636
)
3737
or
3838
// Upcasts that are performed on an operand of a ternary expression.
39-
exists(ConditionalExpr ce |
40-
e = ce.getTrueExpr() or e = ce.getFalseExpr()
41-
)
39+
exists(ConditionalExpr ce | e = ce.getTrueExpr() or e = ce.getFalseExpr())
4240
or
4341
// Upcasts to raw types.
4442
e.getType() instanceof RawType

java/ql/src/Likely Bugs/Arithmetic/ConstantExpAppearsNonConstant.ql

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,9 @@ predicate isConstantExp(Expr e) {
4343
or
4444
exists(AndBitwiseExpr a | a = e | eval(a.getAnOperand()) = 0)
4545
or
46-
exists(AndLogicalExpr a | a = e |
47-
a.getAnOperand().(BooleanLiteral).getBooleanValue() = false
48-
)
46+
exists(AndLogicalExpr a | a = e | a.getAnOperand().(BooleanLiteral).getBooleanValue() = false)
4947
or
50-
exists(OrLogicalExpr o | o = e |
51-
o.getAnOperand().(BooleanLiteral).getBooleanValue() = true
52-
)
48+
exists(OrLogicalExpr o | o = e | o.getAnOperand().(BooleanLiteral).getBooleanValue() = true)
5349
}
5450

5551
from Expr e

java/ql/src/Likely Bugs/Concurrency/SynchSetUnsynchGet.ql

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,7 @@ import java
2222
* (for static methods) or a `synchronized(this){...}` block (for instance methods).
2323
*/
2424
predicate isSynchronizedByBlock(Method m) {
25-
exists(SynchronizedStmt sync, Expr on |
26-
sync = m.getBody().getAChild*() and on = sync.getExpr()
27-
|
25+
exists(SynchronizedStmt sync, Expr on | sync = m.getBody().getAChild*() and on = sync.getExpr() |
2826
if m.isStatic()
2927
then on.(TypeLiteral).getTypeName().getType() = m.getDeclaringType()
3028
else on.(ThisAccess).getType().(RefType).getSourceDeclaration() = m.getDeclaringType()

java/ql/src/semmle/code/java/Variable.qll

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,7 @@ class Variable extends @variable, Annotatable, Element, Modifiable {
1616
Expr getAnAssignedValue() {
1717
exists(LocalVariableDeclExpr e | e.getVariable() = this and result = e.getInit())
1818
or
19-
exists(AssignExpr e |
20-
e.getDest() = this.getAnAccess() and result = e.getSource()
21-
)
19+
exists(AssignExpr e | e.getDest() = this.getAnAccess() and result = e.getSource())
2220
}
2321

2422
/** Gets the initializer expression of this variable. */

0 commit comments

Comments
 (0)