mirror of
https://github.com/github/codeql.git
synced 2026-05-05 13:45:19 +02:00
Merge pull request #15126 from egregius313/egregius313/java/minor/add-replace-to-mapmutator
Java: Add the `Map#replace` and `Map#replaceAll` methods to `MapMutator` in `Maps.qll`
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
---
|
||||
category: minorAnalysis
|
||||
---
|
||||
* Added the `Map#replace` and `Map#replaceAll` methods to the `MapMutator` class in `semmle.code.java.Maps`.
|
||||
@@ -40,7 +40,9 @@ class MapMethod extends Method {
|
||||
|
||||
/** A method that mutates the map it belongs to. */
|
||||
class MapMutator extends MapMethod {
|
||||
MapMutator() { pragma[only_bind_into](this).getName().regexpMatch("(put.*|remove|clear)") }
|
||||
MapMutator() {
|
||||
pragma[only_bind_into](this).getName().regexpMatch("(put.*|remove|clear|replace.*)")
|
||||
}
|
||||
}
|
||||
|
||||
/** The `size` method of `java.util.Map`. */
|
||||
|
||||
Reference in New Issue
Block a user