mirror of
https://github.com/github/codeql.git
synced 2026-04-26 17:25:19 +02:00
Kotlin: Avoid external locations appearing in type_equivalences test
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
| type_equivalences.kt:4:1:4:65 | fooUnit | file://:0:0:0:0 | void | 0 | type_equivalences.kt:4:13:4:19 | x | file:///snap/kotlin/62/lib/kotlin-stdlib.jar/kotlin/Unit.class:0:0:0:0 | Unit |
|
||||
| type_equivalences.kt:4:1:4:65 | fooUnit | file://:0:0:0:0 | void | 0 | type_equivalences.kt:4:13:4:19 | x | file://<external>/Unit.class:0:0:0:0 | Unit |
|
||||
| type_equivalences.kt:4:1:4:65 | fooUnit | file://:0:0:0:0 | void | 1 | type_equivalences.kt:4:22:4:33 | y | type_equivalences.kt:2:1:2:15 | Par<Unit> |
|
||||
| type_equivalences.kt:5:1:5:65 | fooVoid | file:///modules/java.base/java/lang/Void.class:0:0:0:0 | Void | 0 | type_equivalences.kt:5:13:5:19 | x | file:///modules/java.base/java/lang/Void.class:0:0:0:0 | Void |
|
||||
| type_equivalences.kt:5:1:5:65 | fooVoid | file:///modules/java.base/java/lang/Void.class:0:0:0:0 | Void | 1 | type_equivalences.kt:5:22:5:33 | y | type_equivalences.kt:2:1:2:15 | Par<Void> |
|
||||
| type_equivalences.kt:6:1:6:80 | fooNothing | file:///modules/java.base/java/lang/Void.class:0:0:0:0 | Void | 0 | type_equivalences.kt:6:16:6:25 | x | file:///modules/java.base/java/lang/Void.class:0:0:0:0 | Void |
|
||||
| type_equivalences.kt:6:1:6:80 | fooNothing | file:///modules/java.base/java/lang/Void.class:0:0:0:0 | Void | 1 | type_equivalences.kt:6:28:6:42 | y | type_equivalences.kt:2:1:2:15 | Par<Void> |
|
||||
| type_equivalences.kt:5:1:5:65 | fooVoid | file://<external>/Void.class:0:0:0:0 | Void | 0 | type_equivalences.kt:5:13:5:19 | x | file://<external>/Void.class:0:0:0:0 | Void |
|
||||
| type_equivalences.kt:5:1:5:65 | fooVoid | file://<external>/Void.class:0:0:0:0 | Void | 1 | type_equivalences.kt:5:22:5:33 | y | type_equivalences.kt:2:1:2:15 | Par<Void> |
|
||||
| type_equivalences.kt:6:1:6:80 | fooNothing | file://<external>/Void.class:0:0:0:0 | Void | 0 | type_equivalences.kt:6:16:6:25 | x | file://<external>/Void.class:0:0:0:0 | Void |
|
||||
| type_equivalences.kt:6:1:6:80 | fooNothing | file://<external>/Void.class:0:0:0:0 | Void | 1 | type_equivalences.kt:6:28:6:42 | y | type_equivalences.kt:2:1:2:15 | Par<Void> |
|
||||
| type_equivalences.kt:7:1:7:60 | fooInt | file://:0:0:0:0 | int | 0 | type_equivalences.kt:7:12:7:17 | x | file://:0:0:0:0 | int |
|
||||
| type_equivalences.kt:7:1:7:60 | fooInt | file://:0:0:0:0 | int | 1 | type_equivalences.kt:7:20:7:30 | y | type_equivalences.kt:2:1:2:15 | Par<Integer> |
|
||||
|
||||
@@ -1,5 +1,16 @@
|
||||
import java
|
||||
|
||||
// Stop external filepaths from appearing in the results
|
||||
class ClassLocation extends Class {
|
||||
override predicate hasLocationInfo(string path, int sl, int sc, int el, int ec) {
|
||||
exists(string fullPath |
|
||||
super.hasLocationInfo(fullPath, sl, sc, el, ec) |
|
||||
if exists(this.getFile().getRelativePath())
|
||||
then path = fullPath
|
||||
else path = fullPath.regexpReplaceAll(".*/", "<external>/"))
|
||||
}
|
||||
}
|
||||
|
||||
from Method m, int i, Parameter p
|
||||
where m.getName().matches("foo%")
|
||||
and p = m.getParameter(i)
|
||||
|
||||
Reference in New Issue
Block a user