diff --git a/java/ql/src/Violations of Best Practice/Naming Conventions/ConfusingOverloading.ql b/java/ql/src/Violations of Best Practice/Naming Conventions/ConfusingOverloading.ql index 6034d35bff3..f355cd5f219 100644 --- a/java/ql/src/Violations of Best Practice/Naming Conventions/ConfusingOverloading.ql +++ b/java/ql/src/Violations of Best Practice/Naming Conventions/ConfusingOverloading.ql @@ -57,6 +57,8 @@ private predicate candidateMethod(RefType t, Method m, string name, int numParam m.getNumberOfParameters() = numParam and m = m.getSourceDeclaration() and not m.getAnAnnotation() instanceof DeprecatedAnnotation and + // Exclude compiler generated methods, such as Kotlin `$default` methods: + not m.isCompilerGenerated() and not whitelist(name) } @@ -137,8 +139,6 @@ private predicate delegate(Method caller, Method callee) { from Method m, Method n, string messageQualifier where - // Exclude compiler generated methods, such as Kotlin `$default` methods: - not m.isCompilerGenerated() and confusinglyOverloaded(m, n) and ( if m.getDeclaringType() = n.getDeclaringType()