mirror of
https://github.com/zaaarf/lillero-processor.git
synced 2024-11-13 01:39:22 +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,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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue