Files
codeql/java/ql/lib/upgrades/e7706df98aaefcf055f35f50582f2686f41c23bb/annotValue.ql
Dave Bartolomeo 83ceb822aa Move upgrades into standard library packs
Move upgrade to new location

Remove incorrectly merged files

Fix upgrades section
2022-01-04 11:30:25 -08:00

28 lines
676 B
Plaintext

class Annotation extends @annotation {
string toString() { result = "annotation" }
}
class Method extends @method {
string toString() { result = "method" }
}
class Expr extends @expr {
string toString() { result = "expr" }
}
class ParExpr extends Expr, @parexpr {
override string toString() { result = "(...)" }
}
predicate parExprGetExpr(ParExpr pe, Expr e) { exprs(e, _, _, pe, _) }
from Annotation parentid, Method id2, Expr oldvalue, Expr value
where
annotValue(parentid, id2, oldvalue) and
if oldvalue instanceof ParExpr
then
parExprGetExpr+(oldvalue, value) and
not value instanceof ParExpr
else value = oldvalue
select parentid, id2, value