Fix validation timing

This commit is contained in:
Michael Pfaff 2022-09-08 13:40:36 -04:00
parent 0001c5897e
commit 7148fe1ec7
Signed by: michael
GPG Key ID: CF402C4A012AA9D4
1 changed files with 2 additions and 3 deletions

View File

@ -345,7 +345,6 @@ public class GeneratorVisitor extends ElementKindVisitor6<Void, Void> {
@Override
public Void visitTypeAsInterface(TypeElement e, Void p) {
long startTime = System.currentTimeMillis();
final Collection<ExecutableElement> methods = Utils.getMethods(e);
final Collection<VariableElement> fields = Utils.getFields(e);
if (methods.isEmpty() && fields.isEmpty()) {
@ -354,11 +353,11 @@ public class GeneratorVisitor extends ElementKindVisitor6<Void, Void> {
//env.getMessager().printMessage(Kind.NOTE, "methods count : " + Utils.getMethods(e).size() + " fields count : " + Utils.getFields(e).size(), e);
if (this.validate) {
long startTime = System.currentTimeMillis();
methods.parallelStream().forEach(method -> validateMethod(method));
printTiming(env.getMessager(), "Validated " + e, startTime);
}
printTiming(env.getMessager(), "Validated " + e, startTime);
if (methods.size() > 0 && this.gen_native_path != null) {
if (this.gen_java_path != null) {
Future<Void> javaGenThread = spawn(() -> {