Java: Rename ReturnStmt.getResult to getExpr.

This commit is contained in:
Anders Schack-Mulligen
2026-02-04 13:56:50 +01:00
parent 36fa0a22f9
commit 6f40ac15b4
51 changed files with 75 additions and 70 deletions

View File

@@ -41,7 +41,7 @@ private class VulnerableJHipsterRandomUtilMethod extends Method {
this.getReturnType() instanceof TypeString and
exists(ReturnStmt s |
s = this.getBody().(SingletonBlock).getStmt() and
s.getResult() instanceof PredictableApacheRandomStringUtilsMethodCall
s.getExpr() instanceof PredictableApacheRandomStringUtilsMethodCall
)
}
}

View File

@@ -96,7 +96,7 @@ predicate probablyNeverEscapes(LocalVariableDecl v) {
// Not assigned directly to another variable.
not exists(Assignment a | a.getSource() = v.getAnAccess()) and
// Not returned.
not exists(ReturnStmt r | r.getResult() = v.getAnAccess()) and
not exists(ReturnStmt r | r.getExpr() = v.getAnAccess()) and
// All assignments are to new instances of a class.
forex(Expr e | e = v.getAnAssignedValue() | e instanceof ClassInstanceExpr)
}