From 4215780e0d096e72a9c00eca5e55f5367fc7cb19 Mon Sep 17 00:00:00 2001 From: zaaarf Date: Tue, 28 Mar 2023 17:37:13 +0200 Subject: [PATCH] fix: do not override non-abstract stubs --- .../java/ftbsc/lll/processor/tools/JavaPoetUtils.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/main/java/ftbsc/lll/processor/tools/JavaPoetUtils.java b/src/main/java/ftbsc/lll/processor/tools/JavaPoetUtils.java index 6ae867b..e2c8f2e 100644 --- a/src/main/java/ftbsc/lll/processor/tools/JavaPoetUtils.java +++ b/src/main/java/ftbsc/lll/processor/tools/JavaPoetUtils.java @@ -192,10 +192,11 @@ public class JavaPoetUtils { public static HashSet generateDummies(Collection dummies) { HashSet specs = new HashSet<>(); for(ExecutableElement d : dummies) - specs.add(MethodSpec.overriding(d) - .addStatement("throw new $T($S)", RuntimeException.class, "This is a stub and should not have been called") - .build() - ); + if(d.getModifiers().contains(Modifier.ABSTRACT)) + specs.add(MethodSpec.overriding(d) + .addStatement("throw new $T($S)", RuntimeException.class, "This is a stub and should not have been called") + .build() + ); return specs; } }