From 1d16561502304680b08396e211b3ed2da4f3620a Mon Sep 17 00:00:00 2001 From: Martin Wittlinger Date: Sun, 16 Jul 2023 16:38:36 +0200 Subject: [PATCH] fix(spoon): Handle implicit ctors correct --- .../NonProtectedConstructorInAbstractClassAnalyzer.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spoon-analyzer/src/main/java/io/github/martinwitt/spoon_analyzer/badsmells/non_protected_constructor_In_abstract_class/NonProtectedConstructorInAbstractClassAnalyzer.java b/spoon-analyzer/src/main/java/io/github/martinwitt/spoon_analyzer/badsmells/non_protected_constructor_In_abstract_class/NonProtectedConstructorInAbstractClassAnalyzer.java index a038fde0b..1c8a38a42 100644 --- a/spoon-analyzer/src/main/java/io/github/martinwitt/spoon_analyzer/badsmells/non_protected_constructor_In_abstract_class/NonProtectedConstructorInAbstractClassAnalyzer.java +++ b/spoon-analyzer/src/main/java/io/github/martinwitt/spoon_analyzer/badsmells/non_protected_constructor_In_abstract_class/NonProtectedConstructorInAbstractClassAnalyzer.java @@ -21,7 +21,7 @@ public List analyze(CtType clazz) { } List> elements = clazz.getElements(new TypeFilter<>(CtConstructor.class)); for (CtConstructor ctConstructor : elements) { - if (!ctConstructor.isProtected() && ctConstructor.isPublic()) { + if (!ctConstructor.isProtected() && ctConstructor.isPublic() && !ctConstructor.isImplicit()) { badSmells.add(new NonProtectedConstructorInAbstractClass(clazz, ctConstructor)); } }