diff --git a/fusion-processor/src/main/java/io/yupiik/fusion/framework/processor/internal/generator/SubclassGenerator.java b/fusion-processor/src/main/java/io/yupiik/fusion/framework/processor/internal/generator/SubclassGenerator.java index 1b96b9d..9ae567c 100644 --- a/fusion-processor/src/main/java/io/yupiik/fusion/framework/processor/internal/generator/SubclassGenerator.java +++ b/fusion-processor/src/main/java/io/yupiik/fusion/framework/processor/internal/generator/SubclassGenerator.java @@ -123,7 +123,10 @@ public GeneratedClass get() { !modifiers.contains(ABSTRACT) && !modifiers.contains(DEFAULT) /*more for later for interfaces*/ && // other methods can't be subclasses/overriden like this - (modifiers.contains(PUBLIC) || modifiers.contains(PROTECTED)); + (modifiers.contains(PUBLIC) || + (modifiers.contains(PROTECTED) && + m.getEnclosingElement() instanceof TypeElement te && + te.getQualifiedName().contentEquals(typeElement.getQualifiedName()))); }) .map(m -> { // note: if we start supporting interceptors,