mirror of
https://github.com/github/codeql.git
synced 2026-04-30 11:15:13 +02:00
Java: Autoformat.
This commit is contained in:
@@ -36,9 +36,7 @@ predicate usefulUpcast(CastExpr e) {
|
||||
)
|
||||
or
|
||||
// Upcasts that are performed on an operand of a ternary expression.
|
||||
exists(ConditionalExpr ce |
|
||||
e = ce.getTrueExpr() or e = ce.getFalseExpr()
|
||||
)
|
||||
exists(ConditionalExpr ce | e = ce.getTrueExpr() or e = ce.getFalseExpr())
|
||||
or
|
||||
// Upcasts to raw types.
|
||||
e.getType() instanceof RawType
|
||||
|
||||
@@ -43,13 +43,9 @@ predicate isConstantExp(Expr e) {
|
||||
or
|
||||
exists(AndBitwiseExpr a | a = e | eval(a.getAnOperand()) = 0)
|
||||
or
|
||||
exists(AndLogicalExpr a | a = e |
|
||||
a.getAnOperand().(BooleanLiteral).getBooleanValue() = false
|
||||
)
|
||||
exists(AndLogicalExpr a | a = e | a.getAnOperand().(BooleanLiteral).getBooleanValue() = false)
|
||||
or
|
||||
exists(OrLogicalExpr o | o = e |
|
||||
o.getAnOperand().(BooleanLiteral).getBooleanValue() = true
|
||||
)
|
||||
exists(OrLogicalExpr o | o = e | o.getAnOperand().(BooleanLiteral).getBooleanValue() = true)
|
||||
}
|
||||
|
||||
from Expr e
|
||||
|
||||
@@ -22,9 +22,7 @@ import java
|
||||
* (for static methods) or a `synchronized(this){...}` block (for instance methods).
|
||||
*/
|
||||
predicate isSynchronizedByBlock(Method m) {
|
||||
exists(SynchronizedStmt sync, Expr on |
|
||||
sync = m.getBody().getAChild*() and on = sync.getExpr()
|
||||
|
|
||||
exists(SynchronizedStmt sync, Expr on | sync = m.getBody().getAChild*() and on = sync.getExpr() |
|
||||
if m.isStatic()
|
||||
then on.(TypeLiteral).getTypeName().getType() = m.getDeclaringType()
|
||||
else on.(ThisAccess).getType().(RefType).getSourceDeclaration() = m.getDeclaringType()
|
||||
|
||||
@@ -16,9 +16,7 @@ class Variable extends @variable, Annotatable, Element, Modifiable {
|
||||
Expr getAnAssignedValue() {
|
||||
exists(LocalVariableDeclExpr e | e.getVariable() = this and result = e.getInit())
|
||||
or
|
||||
exists(AssignExpr e |
|
||||
e.getDest() = this.getAnAccess() and result = e.getSource()
|
||||
)
|
||||
exists(AssignExpr e | e.getDest() = this.getAnAccess() and result = e.getSource())
|
||||
}
|
||||
|
||||
/** Gets the initializer expression of this variable. */
|
||||
|
||||
Reference in New Issue
Block a user