Skip to content

Commit

Permalink
Remove field only used in characteristic predicate
Browse files Browse the repository at this point in the history
  • Loading branch information
egregius313 committed Aug 16, 2023
1 parent 42036ac commit 24eb98b
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions java/ql/lib/semmle/code/java/security/RandomDataSource.qll
Original file line number Diff line number Diff line change
Expand Up @@ -157,12 +157,11 @@ class ApacheCommonsRandomSource extends RandomDataSource {
* A method access calling a method declared on `org.apache.commons.lang3.RandomStringUtils`
*/
class ApacheCommonsRandomStringSource extends RandomDataSource {
Method m;

ApacheCommonsRandomStringSource() {
m = this.getMethod() and
m.getName().matches("random%") and
m.getDeclaringType().hasQualifiedName("org.apache.commons.lang3", "RandomStringUtils")
exists(Method m | m = this.getMethod() |
m.getName().matches("random%") and
m.getDeclaringType().hasQualifiedName("org.apache.commons.lang3", "RandomStringUtils")
)
}

override Expr getOutput() { result = this }
Expand Down

0 comments on commit 24eb98b

Please sign in to comment.