Skip to content

Commit ae38d5d

Browse files
authored
Merge pull request github#11303 from tamasvajk/kotlin-one-stmt-line
Kotlin: Exclude .kt files from one stmt in line query
2 parents 2796c46 + c9241cc commit ae38d5d

File tree

4 files changed

+9
-0
lines changed

4 files changed

+9
-0
lines changed

java/ql/src/Advisory/Statements/OneStatementPerLine.ql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ predicate oneLineStatement(Stmt s, File f, int line, int col) {
3737
from Stmt s, Stmt s2
3838
where
3939
exists(File f, int line, int col, int col2 |
40+
f.isJavaSourceFile() and
4041
oneLineStatement(s, f, line, col) and
4142
oneLineStatement(s2, f, line, col2) and
4243
col < col2 and

java/ql/test/kotlin/query-tests/OneStatementPerLine/OneStatementPerLine.expected

Whitespace-only changes.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Advisory/Statements/OneStatementPerLine.ql
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
class Foo {
2+
fun foo(): Foo { return this }
3+
4+
fun bar(x: Foo?): Foo? {
5+
return x?.foo()
6+
}
7+
}

0 commit comments

Comments
 (0)