diff options
author | zaaarf <zaaarf@proton.me> | 2023-03-28 17:37:13 +0200 |
---|---|---|
committer | zaaarf <zaaarf@proton.me> | 2023-03-28 17:37:13 +0200 |
commit | 4215780e0d096e72a9c00eca5e55f5367fc7cb19 (patch) | |
tree | 738aa2b33be4f4c01642b3d691f0d62bf4a46521 /src/main/java | |
parent | 8229a7b45514b6dccb65d1c219221ba4756720bf (diff) |
fix: do not override non-abstract stubs
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/ftbsc/lll/processor/tools/JavaPoetUtils.java | 9 |
1 files 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<MethodSpec> generateDummies(Collection<ExecutableElement> dummies) { HashSet<MethodSpec> 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; } } |