mirror of
https://github.com/zaaarf/lillero-processor.git
synced 2024-11-22 16:04:50 +01:00
fix: do not override non-abstract stubs
This commit is contained in:
parent
8229a7b455
commit
4215780e0d
1 changed files with 5 additions and 4 deletions
|
@ -192,6 +192,7 @@ public class JavaPoetUtils {
|
||||||
public static HashSet<MethodSpec> generateDummies(Collection<ExecutableElement> dummies) {
|
public static HashSet<MethodSpec> generateDummies(Collection<ExecutableElement> dummies) {
|
||||||
HashSet<MethodSpec> specs = new HashSet<>();
|
HashSet<MethodSpec> specs = new HashSet<>();
|
||||||
for(ExecutableElement d : dummies)
|
for(ExecutableElement d : dummies)
|
||||||
|
if(d.getModifiers().contains(Modifier.ABSTRACT))
|
||||||
specs.add(MethodSpec.overriding(d)
|
specs.add(MethodSpec.overriding(d)
|
||||||
.addStatement("throw new $T($S)", RuntimeException.class, "This is a stub and should not have been called")
|
.addStatement("throw new $T($S)", RuntimeException.class, "This is a stub and should not have been called")
|
||||||
.build()
|
.build()
|
||||||
|
|
Loading…
Reference in a new issue