Skip to content

Commit 1a36b1a

Browse files
committed
Kotlin: Format queries
1 parent efe3c0d commit 1a36b1a

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

java/ql/lib/semmle/code/java/Collections.qll

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,9 @@ class CollectionSizeMethod extends CollectionMethod {
7676

7777
/** A method that mutates the collection it belongs to. */
7878
class CollectionMutator extends CollectionMethod {
79-
CollectionMutator() { pragma[only_bind_into](this).getName().regexpMatch("add.*|remove.*|push|pop|clear") }
79+
CollectionMutator() {
80+
pragma[only_bind_into](this).getName().regexpMatch("add.*|remove.*|push|pop|clear")
81+
}
8082
}
8183

8284
/** A method call that mutates a collection. */
@@ -89,7 +91,9 @@ class CollectionMutation extends MethodAccess {
8991

9092
/** A method that queries the contents of a collection without mutating it. */
9193
class CollectionQueryMethod extends CollectionMethod {
92-
CollectionQueryMethod() { pragma[only_bind_into](this).getName().regexpMatch("contains|containsAll|get|size|peek") }
94+
CollectionQueryMethod() {
95+
pragma[only_bind_into](this).getName().regexpMatch("contains|containsAll|get|size|peek")
96+
}
9397
}
9498

9599
/** A `new` expression that allocates a fresh, empty collection. */

java/ql/lib/semmle/code/java/GeneratedFiles.qll

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,7 @@ abstract class GeneratedFile extends File { }
4545
* A file detected as generated based on commonly-used marker comments.
4646
*/
4747
library class MarkerCommentGeneratedFile extends GeneratedFile {
48-
MarkerCommentGeneratedFile() {
49-
any(GeneratedFileMarker t).getFile() = this
50-
}
48+
MarkerCommentGeneratedFile() { any(GeneratedFileMarker t).getFile() = this }
5149
}
5250

5351
/**

java/ql/lib/semmle/code/java/Maps.qll

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,9 @@ class MapMutation extends MethodAccess {
5959
/** A method that queries the contents of the map it belongs to without mutating it. */
6060
class MapQueryMethod extends MapMethod {
6161
MapQueryMethod() {
62-
pragma[only_bind_into](this).getName().regexpMatch("get|containsKey|containsValue|entrySet|keySet|values|isEmpty|size")
62+
pragma[only_bind_into](this)
63+
.getName()
64+
.regexpMatch("get|containsKey|containsValue|entrySet|keySet|values|isEmpty|size")
6365
}
6466
}
6567

0 commit comments

Comments
 (0)