mirror of
https://github.com/github/codeql.git
synced 2025-12-20 18:56:32 +01:00
Kotlin: Exclude .kt files from missing instanceof in equals query
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user