diff --git a/java/ql/consistency-queries/UnaryExpr.ql b/java/ql/consistency-queries/UnaryExpr.ql index 29a895eca6a..f71d51f19d1 100644 --- a/java/ql/consistency-queries/UnaryExpr.ql +++ b/java/ql/consistency-queries/UnaryExpr.ql @@ -2,7 +2,7 @@ import java from UnaryExpr ue where - not exists(ue.getExpr()) + not exists(ue.getOperand()) or exists(Expr e, int i | e.isNthChildOf(ue, i) and i != 0) select ue diff --git a/java/ql/lib/semmle/code/java/Constants.qll b/java/ql/lib/semmle/code/java/Constants.qll index 0cad92b7fc6..b515eaefb28 100644 --- a/java/ql/lib/semmle/code/java/Constants.qll +++ b/java/ql/lib/semmle/code/java/Constants.qll @@ -22,7 +22,7 @@ module CalculateConstants boolean calculateBooleanValue(Expr e) { // No casts relevant to booleans. // `!` is the only unary operator that evaluates to a boolean. - result = getBoolVal(e.(LogNotExpr).getExpr()).booleanNot() + result = getBoolVal(e.(LogNotExpr).getOperand()).booleanNot() or // Handle binary expressions that have integer operands and a boolean result. exists(BinaryExpr b, int left, int right | @@ -115,11 +115,11 @@ module CalculateConstants else result = val ) or - result = getIntVal(e.(PlusExpr).getExpr()) + result = getIntVal(e.(PlusExpr).getOperand()) or - result = -getIntVal(e.(MinusExpr).getExpr()) + result = -getIntVal(e.(MinusExpr).getOperand()) or - result = getIntVal(e.(BitNotExpr).getExpr()).bitNot() + result = getIntVal(e.(BitNotExpr).getOperand()).bitNot() or // No `int` value for `LogNotExpr`. exists(BinaryExpr b, int v1, int v2 | diff --git a/java/ql/lib/semmle/code/java/ControlFlowGraph.qll b/java/ql/lib/semmle/code/java/ControlFlowGraph.qll index a31101888da..2987a8ae2b1 100644 --- a/java/ql/lib/semmle/code/java/ControlFlowGraph.qll +++ b/java/ql/lib/semmle/code/java/ControlFlowGraph.qll @@ -827,7 +827,7 @@ private module ControlFlowGraphImpl { index = 1 and result = e.getRightOperand() ) or - index = 0 and result = this.(UnaryExpr).getExpr() + index = 0 and result = this.(UnaryExpr).getOperand() or index = 0 and result = this.(CastingExpr).getExpr() or @@ -1044,7 +1044,7 @@ private module ControlFlowGraphImpl { or // The last node of a `LogNotExpr` is in its sub-expression with an inverted boolean completion // (or a `normalCompletion`). - exists(Completion subcompletion | last(n.(LogNotExpr).getExpr(), last, subcompletion) | + exists(Completion subcompletion | last(n.(LogNotExpr).getOperand(), last, subcompletion) | subcompletion = NormalCompletion() and completion = NormalCompletion() and not inBooleanContext(n) @@ -1356,7 +1356,7 @@ private module ControlFlowGraphImpl { ( result = first(n.asExpr().(AndLogicalExpr).getLeftOperand()) or result = first(n.asExpr().(OrLogicalExpr).getLeftOperand()) or - result = first(n.asExpr().(LogNotExpr).getExpr()) or + result = first(n.asExpr().(LogNotExpr).getOperand()) or result = first(n.asExpr().(ConditionalExpr).getCondition()) ) or diff --git a/java/ql/lib/semmle/code/java/Expr.qll b/java/ql/lib/semmle/code/java/Expr.qll index 4b03375c69e..9e958b36471 100644 --- a/java/ql/lib/semmle/code/java/Expr.qll +++ b/java/ql/lib/semmle/code/java/Expr.qll @@ -113,7 +113,7 @@ class Expr extends ExprParent, @expr { if this instanceof CastingExpr or this instanceof NotNullExpr then result = this.(CastingExpr).getExpr().getUnderlyingExpr() or - result = this.(NotNullExpr).getExpr().getUnderlyingExpr() + result = this.(NotNullExpr).getOperand().getUnderlyingExpr() else result = this } } @@ -144,13 +144,13 @@ class CompileTimeConstantExpr extends Expr { this.(CastingExpr).getExpr().isCompileTimeConstant() or // The unary operators `+`, `-`, `~`, and `!` (but not `++` or `--`). - this.(PlusExpr).getExpr().isCompileTimeConstant() + this.(PlusExpr).getOperand().isCompileTimeConstant() or - this.(MinusExpr).getExpr().isCompileTimeConstant() + this.(MinusExpr).getOperand().isCompileTimeConstant() or - this.(BitNotExpr).getExpr().isCompileTimeConstant() + this.(BitNotExpr).getOperand().isCompileTimeConstant() or - this.(LogNotExpr).getExpr().isCompileTimeConstant() + this.(LogNotExpr).getOperand().isCompileTimeConstant() or // The multiplicative operators `*`, `/`, and `%`, // the additive operators `+` and `-`, @@ -943,7 +943,7 @@ class LogicExpr extends Expr { /** Gets an operand of this logical expression. */ Expr getAnOperand() { this.(BinaryExpr).getAnOperand() = result or - this.(UnaryExpr).getExpr() = result + this.(UnaryExpr).getOperand() = result } } @@ -1039,8 +1039,15 @@ class ReferenceEqualityTest extends EqualityTest { /** A common super-class that represents unary operator expressions. */ class UnaryExpr extends Expr, @unaryexpr { + /** + * DEPRECATED: Use getOperand() instead. + * + * Gets the operand expression. + */ + deprecated Expr getExpr() { result.getParent() = this } + /** Gets the operand expression. */ - Expr getExpr() { result.getParent() = this } + Expr getOperand() { result.getParent() = this } } /** @@ -1773,14 +1780,14 @@ class VariableUpdate extends Expr { VariableUpdate() { this.(Assignment).getDest() instanceof VarAccess or this instanceof LocalVariableDeclExpr or - this.(UnaryAssignExpr).getExpr() instanceof VarAccess + this.(UnaryAssignExpr).getOperand() instanceof VarAccess } /** Gets the destination of this variable update. */ Variable getDestVar() { result.getAnAccess() = this.(Assignment).getDest() or result = this.(LocalVariableDeclExpr).getVariable() or - result.getAnAccess() = this.(UnaryAssignExpr).getExpr() + result.getAnAccess() = this.(UnaryAssignExpr).getOperand() } } @@ -1970,7 +1977,7 @@ class VarAccess extends Expr, @varaccess { */ predicate isVarWrite() { exists(Assignment a | a.getDest() = this) or - exists(UnaryAssignExpr e | e.getExpr() = this) + exists(UnaryAssignExpr e | e.getOperand() = this) } /** diff --git a/java/ql/lib/semmle/code/java/PrettyPrintAst.qll b/java/ql/lib/semmle/code/java/PrettyPrintAst.qll index 3d907a5a099..4538b817266 100644 --- a/java/ql/lib/semmle/code/java/PrettyPrintAst.qll +++ b/java/ql/lib/semmle/code/java/PrettyPrintAst.qll @@ -257,7 +257,7 @@ private class PpUnaryExpr extends PpAst, UnaryExpr { i = 2 and result = "--" and this instanceof PostDecExpr } - override PpAst getChild(int i) { i = 1 and result = this.getExpr() } + override PpAst getChild(int i) { i = 1 and result = this.getOperand() } } private class PpCastExpr extends PpAst, CastExpr { diff --git a/java/ql/lib/semmle/code/java/Statement.qll b/java/ql/lib/semmle/code/java/Statement.qll index 2aea8b006ae..8db9d5e6628 100644 --- a/java/ql/lib/semmle/code/java/Statement.qll +++ b/java/ql/lib/semmle/code/java/Statement.qll @@ -184,7 +184,7 @@ class ForStmt extends ConditionalStmt, @forstmt { Variable getAnIterationVariable() { // Check that the variable is assigned to, incremented or decremented in the update expression, and... exists(Expr update | update = this.getAnUpdate().getAChildExpr*() | - update.(UnaryAssignExpr).getExpr() = result.getAnAccess() or + update.(UnaryAssignExpr).getOperand() = result.getAnAccess() or update = result.getAnAssignedValue() ) and // ...that it is checked or used in the condition. diff --git a/java/ql/lib/semmle/code/java/arithmetic/Overflow.qll b/java/ql/lib/semmle/code/java/arithmetic/Overflow.qll index 471f271eb86..e82192b0fba 100644 --- a/java/ql/lib/semmle/code/java/arithmetic/Overflow.qll +++ b/java/ql/lib/semmle/code/java/arithmetic/Overflow.qll @@ -93,7 +93,7 @@ class ArithExpr extends Expr { ) and forall(Expr e | e = this.(BinaryExpr).getAnOperand() or - e = this.(UnaryAssignExpr).getExpr() or + e = this.(UnaryAssignExpr).getOperand() or e = this.(AssignOp).getSource() | e.getType() instanceof NumType @@ -114,7 +114,7 @@ class ArithExpr extends Expr { */ Expr getLeftOperand() { result = this.(BinaryExpr).getLeftOperand() or - result = this.(UnaryAssignExpr).getExpr() or + result = this.(UnaryAssignExpr).getOperand() or result = this.(AssignOp).getDest() } @@ -128,7 +128,7 @@ class ArithExpr extends Expr { /** Gets an operand of this arithmetic expression. */ Expr getAnOperand() { result = this.(BinaryExpr).getAnOperand() or - result = this.(UnaryAssignExpr).getExpr() or + result = this.(UnaryAssignExpr).getOperand() or result = this.(AssignOp).getSource() } } diff --git a/java/ql/lib/semmle/code/java/comparison/Comparison.qll b/java/ql/lib/semmle/code/java/comparison/Comparison.qll index 7aea0f6fb25..4a2601678e2 100644 --- a/java/ql/lib/semmle/code/java/comparison/Comparison.qll +++ b/java/ql/lib/semmle/code/java/comparison/Comparison.qll @@ -9,7 +9,7 @@ import java * Used as basis for the transitive closure in `exprImplies`. */ private predicate exprImpliesStep(Expr e1, boolean b1, Expr e2, boolean b2) { - e1.(LogNotExpr).getExpr() = e2 and + e1.(LogNotExpr).getOperand() = e2 and b2 = b1.booleanNot() and (b1 = true or b1 = false) or diff --git a/java/ql/lib/semmle/code/java/controlflow/Guards.qll b/java/ql/lib/semmle/code/java/controlflow/Guards.qll index 0e1db160094..95465849701 100644 --- a/java/ql/lib/semmle/code/java/controlflow/Guards.qll +++ b/java/ql/lib/semmle/code/java/controlflow/Guards.qll @@ -279,9 +279,7 @@ private module GuardsInput implements SharedGuards::InputSig { } class NegateExpr extends UnaryExpr instanceof MinusExpr { - override Expr getOperand() { result = super.getExpr() } + override Expr getOperand() { result = MinusExpr.super.getOperand() } } class PreIncExpr extends UnaryExpr instanceof J::PreIncExpr { - override Expr getOperand() { result = super.getExpr() } + override Expr getOperand() { result = J::PreIncExpr.super.getOperand() } } class PreDecExpr extends UnaryExpr instanceof J::PreDecExpr { - override Expr getOperand() { result = super.getExpr() } + override Expr getOperand() { result = J::PreDecExpr.super.getOperand() } } class PostIncExpr extends UnaryExpr instanceof J::PostIncExpr { - override Expr getOperand() { result = super.getExpr() } + override Expr getOperand() { result = J::PostIncExpr.super.getOperand() } } class PostDecExpr extends UnaryExpr instanceof J::PostDecExpr { - override Expr getOperand() { result = super.getExpr() } + override Expr getOperand() { result = J::PostDecExpr.super.getOperand() } } class CopyValueExpr extends UnaryExpr { @@ -200,7 +200,7 @@ module Sem implements Semantic { } override Expr getOperand() { - result = this.(J::PlusExpr).getExpr() or + result = this.(J::PlusExpr).getOperand() or result = this.(J::AssignExpr).getSource() or result = this.(J::LocalVariableDeclExpr).getInit() } diff --git a/java/ql/lib/semmle/code/java/dataflow/TypeFlow.qll b/java/ql/lib/semmle/code/java/dataflow/TypeFlow.qll index 361b4feb54a..10e5c754c61 100644 --- a/java/ql/lib/semmle/code/java/dataflow/TypeFlow.qll +++ b/java/ql/lib/semmle/code/java/dataflow/TypeFlow.qll @@ -137,7 +137,7 @@ module FlowStepsInput implements UniversalFlow::UniversalFlowInput { or n2.asSsa().(Base::SsaCapturedDefinition).captures(n1.asSsa()) or - n2.asExpr().(NotNullExpr).getExpr() = n1.asExpr() + n2.asExpr().(NotNullExpr).getOperand() = n1.asExpr() } /** diff --git a/java/ql/lib/semmle/code/java/dataflow/internal/BaseSSA.qll b/java/ql/lib/semmle/code/java/dataflow/internal/BaseSSA.qll index e373340d7d7..5e3a8550e3c 100644 --- a/java/ql/lib/semmle/code/java/dataflow/internal/BaseSSA.qll +++ b/java/ql/lib/semmle/code/java/dataflow/internal/BaseSSA.qll @@ -87,7 +87,7 @@ private module BaseSsaImpl { result = TLocalVar(v.getCallable(), v) ) or - result.getAnAccess() = upd.(UnaryAssignExpr).getExpr() + result.getAnAccess() = upd.(UnaryAssignExpr).getOperand() } /** Holds if `n` updates the local variable `v`. */ diff --git a/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowUtil.qll b/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowUtil.qll index e2e80c293ef..9c2bb13a09f 100644 --- a/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowUtil.qll +++ b/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowUtil.qll @@ -201,7 +201,7 @@ predicate simpleAstFlowStep(Expr e1, Expr e2) { or e2 = any(StmtExpr stmtExpr | e1 = stmtExpr.getResultExpr()) or - e2 = any(NotNullExpr nne | e1 = nne.getExpr()) + e2 = any(NotNullExpr nne | e1 = nne.getOperand()) or e2.(WhenExpr).getBranch(_).getAResult() = e1 or diff --git a/java/ql/lib/semmle/code/java/dataflow/internal/SsaImpl.qll b/java/ql/lib/semmle/code/java/dataflow/internal/SsaImpl.qll index bafb16d6ab5..409cf586363 100644 --- a/java/ql/lib/semmle/code/java/dataflow/internal/SsaImpl.qll +++ b/java/ql/lib/semmle/code/java/dataflow/internal/SsaImpl.qll @@ -302,7 +302,7 @@ private module Cached { result = TLocalVar(v.getCallable(), v) ) or - result.getAnAccess() = upd.(UnaryAssignExpr).getExpr() + result.getAnAccess() = upd.(UnaryAssignExpr).getOperand() } /* diff --git a/java/ql/lib/semmle/code/java/dataflow/internal/rangeanalysis/SignAnalysisSpecific.qll b/java/ql/lib/semmle/code/java/dataflow/internal/rangeanalysis/SignAnalysisSpecific.qll index 4a418160477..e4525ed36ea 100644 --- a/java/ql/lib/semmle/code/java/dataflow/internal/rangeanalysis/SignAnalysisSpecific.qll +++ b/java/ql/lib/semmle/code/java/dataflow/internal/rangeanalysis/SignAnalysisSpecific.qll @@ -69,10 +69,10 @@ module Private { /** Returns the operand of this expression. */ Expr getOperand() { - result = this.(J::PreIncExpr).getExpr() or - result = this.(J::PreDecExpr).getExpr() or - result = this.(J::MinusExpr).getExpr() or - result = this.(J::BitNotExpr).getExpr() + result = this.(J::PreIncExpr).getOperand() or + result = this.(J::PreDecExpr).getOperand() or + result = this.(J::MinusExpr).getOperand() or + result = this.(J::BitNotExpr).getOperand() } /** Returns the operation representing this expression. */ @@ -258,12 +258,12 @@ private module Impl { /** Returns the operand of the operation if `e` is a decrement. */ Expr getDecrementOperand(Element e) { - result = e.(PostDecExpr).getExpr() or result = e.(PreDecExpr).getExpr() + result = e.(PostDecExpr).getOperand() or result = e.(PreDecExpr).getOperand() } /** Returns the operand of the operation if `e` is an increment. */ Expr getIncrementOperand(Element e) { - result = e.(PostIncExpr).getExpr() or result = e.(PreIncExpr).getExpr() + result = e.(PostIncExpr).getOperand() or result = e.(PreIncExpr).getOperand() } /** Gets the variable underlying the implicit SSA variable `v`. */ @@ -287,14 +287,14 @@ private module Impl { /** Holds if `f` is accessed in an increment operation. */ predicate fieldIncrementOperationOperand(Field f) { - any(PostIncExpr inc).getExpr() = f.getAnAccess() or - any(PreIncExpr inc).getExpr() = f.getAnAccess() + any(PostIncExpr inc).getOperand() = f.getAnAccess() or + any(PreIncExpr inc).getOperand() = f.getAnAccess() } /** Holds if `f` is accessed in a decrement operation. */ predicate fieldDecrementOperationOperand(Field f) { - any(PostDecExpr dec).getExpr() = f.getAnAccess() or - any(PreDecExpr dec).getExpr() = f.getAnAccess() + any(PostDecExpr dec).getOperand() = f.getAnAccess() or + any(PreDecExpr dec).getOperand() = f.getAnAccess() } /** Returns possible signs of `f` based on the declaration. */ @@ -316,9 +316,9 @@ private module Impl { /** Returns a sub expression of `e` for expression types where the sign depends on the child. */ Expr getASubExprWithSameSign(Expr e) { result = e.(AssignExpr).getSource() or - result = e.(PlusExpr).getExpr() or - result = e.(PostIncExpr).getExpr() or - result = e.(PostDecExpr).getExpr() or + result = e.(PlusExpr).getOperand() or + result = e.(PostIncExpr).getOperand() or + result = e.(PostDecExpr).getOperand() or result = e.(ChooseExpr).getAResultExpr() or result = e.(CastingExpr).getExpr() } diff --git a/java/ql/lib/semmle/code/java/frameworks/android/Intent.qll b/java/ql/lib/semmle/code/java/frameworks/android/Intent.qll index 3df890c95f4..b11e4e5d4ef 100644 --- a/java/ql/lib/semmle/code/java/frameworks/android/Intent.qll +++ b/java/ql/lib/semmle/code/java/frameworks/android/Intent.qll @@ -279,7 +279,7 @@ private predicate reaches(Expr src, Argument arg) { or exists(StmtExpr e | e.getResultExpr() = src | reaches(e, arg)) or - exists(NotNullExpr e | e.getExpr() = src | reaches(e, arg)) + exists(NotNullExpr e | e.getOperand() = src | reaches(e, arg)) or exists(WhenExpr e | e.getBranch(_).getAResult() = src | reaches(e, arg)) } diff --git a/java/ql/lib/semmle/code/java/security/InsecureRandomnessQuery.qll b/java/ql/lib/semmle/code/java/security/InsecureRandomnessQuery.qll index 77da25d3586..7474c977fe6 100644 --- a/java/ql/lib/semmle/code/java/security/InsecureRandomnessQuery.qll +++ b/java/ql/lib/semmle/code/java/security/InsecureRandomnessQuery.qll @@ -75,7 +75,7 @@ module InsecureRandomnessConfig implements DataFlow::ConfigSig { predicate isAdditionalFlowStep(DataFlow::Node n1, DataFlow::Node n2) { n1.asExpr() = n2.asExpr().(BinaryExpr).getAnOperand() or - n1.asExpr() = n2.asExpr().(UnaryExpr).getExpr() + n1.asExpr() = n2.asExpr().(UnaryExpr).getOperand() or exists(MethodCall mc, string methodName | mc.getMethod().hasQualifiedName("org.owasp.esapi", "Encoder", methodName) and diff --git a/java/ql/src/Advisory/Declarations/NonFinalImmutableField.ql b/java/ql/src/Advisory/Declarations/NonFinalImmutableField.ql index 1ca836ab231..a94d54a9204 100644 --- a/java/ql/src/Advisory/Declarations/NonFinalImmutableField.ql +++ b/java/ql/src/Advisory/Declarations/NonFinalImmutableField.ql @@ -32,7 +32,7 @@ class AnyAssignment extends Expr { /** The expression modified by this assignment. */ Expr getDest() { this.(Assignment).getDest() = result or - this.(UnaryAssignExpr).getExpr() = result + this.(UnaryAssignExpr).getOperand() = result } } diff --git a/java/ql/src/Security/CWE/CWE-835/InfiniteLoop.ql b/java/ql/src/Security/CWE/CWE-835/InfiniteLoop.ql index a04cfd6ac43..ef167189ebf 100644 --- a/java/ql/src/Security/CWE/CWE-835/InfiniteLoop.ql +++ b/java/ql/src/Security/CWE/CWE-835/InfiniteLoop.ql @@ -49,7 +49,7 @@ predicate subCondition(Expr cond, Expr subcond, boolean negated) { or subCondition(cond.(OrLogicalExpr).getAnOperand(), subcond, negated) or - subCondition(cond.(LogNotExpr).getExpr(), subcond, negated.booleanNot()) + subCondition(cond.(LogNotExpr).getOperand(), subcond, negated.booleanNot()) } from diff --git a/java/ql/src/Violations of Best Practice/Boolean Logic/SimplifyBoolExpr.ql b/java/ql/src/Violations of Best Practice/Boolean Logic/SimplifyBoolExpr.ql index 9b87a358905..eabd4fe1e1f 100644 --- a/java/ql/src/Violations of Best Practice/Boolean Logic/SimplifyBoolExpr.ql +++ b/java/ql/src/Violations of Best Practice/Boolean Logic/SimplifyBoolExpr.ql @@ -98,9 +98,9 @@ where or conditionalWithBool(e, pattern, rewrite) or - e.(LogNotExpr).getExpr().(ComparisonOrEquality).negate(pattern, rewrite) + e.(LogNotExpr).getOperand().(ComparisonOrEquality).negate(pattern, rewrite) or - e.(LogNotExpr).getExpr() instanceof LogNotExpr and + e.(LogNotExpr).getOperand() instanceof LogNotExpr and pattern = "!!A" and rewrite = "A" ) diff --git a/java/ql/src/Violations of Best Practice/Dead Code/DeadStoreOfLocal.ql b/java/ql/src/Violations of Best Practice/Dead Code/DeadStoreOfLocal.ql index 3f96f43bc24..0f45b9cae53 100644 --- a/java/ql/src/Violations of Best Practice/Dead Code/DeadStoreOfLocal.ql +++ b/java/ql/src/Violations of Best Practice/Dead Code/DeadStoreOfLocal.ql @@ -15,7 +15,7 @@ import java import DeadLocals -predicate minusOne(MinusExpr e) { e.getExpr().(Literal).getValue() = "1" } +predicate minusOne(MinusExpr e) { e.getOperand().(Literal).getValue() = "1" } predicate flowStep(Expr decl, Expr init) { decl = init diff --git a/java/ql/src/Violations of Best Practice/Dead Code/NonAssignedFields.ql b/java/ql/src/Violations of Best Practice/Dead Code/NonAssignedFields.ql index 28f06c4edfc..fd2cac88901 100644 --- a/java/ql/src/Violations of Best Practice/Dead Code/NonAssignedFields.ql +++ b/java/ql/src/Violations of Best Practice/Dead Code/NonAssignedFields.ql @@ -66,7 +66,7 @@ where fr.getField() = f and not f.getDeclaringType() instanceof EnumType and forall(Assignment ae | ae.getDest() = f.getAnAccess() | ae.getSource() instanceof NullLiteral) and - not exists(UnaryAssignExpr ua | ua.getExpr() = f.getAnAccess()) and + not exists(UnaryAssignExpr ua | ua.getOperand() = f.getAnAccess()) and not f.isFinal() and // Exclude fields that may be accessed reflectively. not reflectivelyWritten(f) and diff --git a/java/ql/test-kotlin1/library-tests/exprs/unaryOp.ql b/java/ql/test-kotlin1/library-tests/exprs/unaryOp.ql index 9e7359e1e07..bce290e4afc 100644 --- a/java/ql/test-kotlin1/library-tests/exprs/unaryOp.ql +++ b/java/ql/test-kotlin1/library-tests/exprs/unaryOp.ql @@ -29,7 +29,7 @@ class NoMaybeElement extends MaybeElement { } MaybeElement op(UnaryExpr e) { - if exists(e.getExpr()) then result = TElement(e.getExpr()) else result = TNoElement() + if exists(e.getOperand()) then result = TElement(e.getOperand()) else result = TNoElement() } from Expr e diff --git a/java/ql/test-kotlin2/library-tests/exprs/unaryOp.ql b/java/ql/test-kotlin2/library-tests/exprs/unaryOp.ql index 9e7359e1e07..bce290e4afc 100644 --- a/java/ql/test-kotlin2/library-tests/exprs/unaryOp.ql +++ b/java/ql/test-kotlin2/library-tests/exprs/unaryOp.ql @@ -29,7 +29,7 @@ class NoMaybeElement extends MaybeElement { } MaybeElement op(UnaryExpr e) { - if exists(e.getExpr()) then result = TElement(e.getExpr()) else result = TNoElement() + if exists(e.getOperand()) then result = TElement(e.getOperand()) else result = TNoElement() } from Expr e diff --git a/java/ql/test/library-tests/locations/NegativeLiteralLocation.ql b/java/ql/test/library-tests/locations/NegativeLiteralLocation.ql index c91c0263994..a5e9054cd75 100644 --- a/java/ql/test/library-tests/locations/NegativeLiteralLocation.ql +++ b/java/ql/test/library-tests/locations/NegativeLiteralLocation.ql @@ -1,5 +1,5 @@ import default from MinusExpr me, Literal l -where l = me.getExpr() +where l = me.getOperand() select me, l