Kotlin: Exclude .kt files from missing instanceof in equals query

This commit is contained in:
Tamas Vajk
2022-11-16 15:24:43 +01:00
parent c70f3d35d0
commit fc614ad4d0
2 changed files with 7 additions and 0 deletions

View File

@@ -64,6 +64,7 @@ class UnimplementedEquals extends EqualsMethod {
from EqualsMethod m
where
m.getFile().isJavaSourceFile() and
exists(m.getBody()) and
exists(Parameter p | p = m.getAParameter() |
// The parameter has no type test

View File

@@ -17,3 +17,9 @@ data class G(val x: Int) {
return other != null && other.javaClass == this.javaClass
}
}
data class H(val x: Int) {
override fun equals(other: Any?): Boolean {
return other != null
}
}