From a7cc8fced5ddc0953e53bc1eeff93250d69a722f Mon Sep 17 00:00:00 2001 From: Tamas Vajk Date: Wed, 2 Nov 2022 09:46:46 +0100 Subject: [PATCH] Adjust code based on review --- .../Naming Conventions/ConfusingOverloading.ql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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()