File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
java/ql/lib/semmle/code/java Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -76,7 +76,7 @@ class CollectionSizeMethod extends CollectionMethod {
7676
7777/** A method that mutates the collection it belongs to. */
7878class CollectionMutator extends CollectionMethod {
79- CollectionMutator ( ) { this .getName ( ) .regexpMatch ( "add.*|remove.*|push|pop|clear" ) }
79+ CollectionMutator ( ) { pragma [ only_bind_into ] ( this ) .getName ( ) .regexpMatch ( "add.*|remove.*|push|pop|clear" ) }
8080}
8181
8282/** A method call that mutates a collection. */
@@ -89,7 +89,7 @@ class CollectionMutation extends MethodAccess {
8989
9090/** A method that queries the contents of a collection without mutating it. */
9191class CollectionQueryMethod extends CollectionMethod {
92- CollectionQueryMethod ( ) { this .getName ( ) .regexpMatch ( "contains|containsAll|get|size|peek" ) }
92+ CollectionQueryMethod ( ) { pragma [ only_bind_into ] ( this ) .getName ( ) .regexpMatch ( "contains|containsAll|get|size|peek" ) }
9393}
9494
9595/** A `new` expression that allocates a fresh, empty collection. */
Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ class MapMethod extends Method {
4040
4141/** A method that mutates the map it belongs to. */
4242class MapMutator extends MapMethod {
43- MapMutator ( ) { this .getName ( ) .regexpMatch ( "(put.*|remove|clear)" ) }
43+ MapMutator ( ) { pragma [ only_bind_into ] ( this ) .getName ( ) .regexpMatch ( "(put.*|remove|clear)" ) }
4444}
4545
4646/** The `size` method of `java.util.Map`. */
@@ -59,7 +59,7 @@ class MapMutation extends MethodAccess {
5959/** A method that queries the contents of the map it belongs to without mutating it. */
6060class MapQueryMethod extends MapMethod {
6161 MapQueryMethod ( ) {
62- this .getName ( ) .regexpMatch ( "get|containsKey|containsValue|entrySet|keySet|values|isEmpty|size" )
62+ pragma [ only_bind_into ] ( this ) .getName ( ) .regexpMatch ( "get|containsKey|containsValue|entrySet|keySet|values|isEmpty|size" )
6363 }
6464}
6565
You can’t perform that action at this time.
0 commit comments