Kotlin: Fix external location in integration test

This commit is contained in:
Tamas Vajk
2022-10-28 10:24:14 +02:00
parent ca279f4073
commit 99880c980c
2 changed files with 11 additions and 1 deletions

View File

@@ -1,2 +1,2 @@
| Test.java:4:22:4:36 | needlessExtends | file:///modules/java.base/java/lang/Iterable.class:0:0:0:0 | Iterable<? extends String> |
| Test.java:4:22:4:36 | needlessExtends | file://<external>/Iterable.class:0:0:0:0 | Iterable<? extends String> |
| Test.java:7:22:7:34 | needlessSuper | build1/KotlinConsumer.class:0:0:0:0 | KotlinConsumer<? super Object> |

View File

@@ -1,5 +1,15 @@
import java
class ClassOrInterfaceLocation extends ClassOrInterface {
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
where m.fromSource()
select m, m.getAParamType()