fix: fixed the generator being called repeatedly

This commit is contained in:
zaaarf 2023-08-25 09:19:44 +02:00
parent f5cf21050f
commit 773880f323
No known key found for this signature in database
GPG key ID: 6445A5CD15E5B40C

View file

@ -92,7 +92,7 @@ public class GEBProcessor extends AbstractProcessor {
for(TypeElement ann : annotations) {
if(ann.getQualifiedName().contentEquals(Listen.class.getName())) {
claimed = true;
for(Element e : env.getElementsAnnotatedWith(ann)) {
for(Element e : env.getElementsAnnotatedWith(ann))
this.processListener(e);
if(!this.listenerMap.isEmpty()) {
this.generateClasses();
@ -100,7 +100,6 @@ public class GEBProcessor extends AbstractProcessor {
}
}
}
}
return claimed;
}
@ -198,6 +197,7 @@ public class GEBProcessor extends AbstractProcessor {
listener.method.getSimpleName().toString(), event, eventParam);
if(cancelable) callListenersBuilder
.addStatement("if((($T) $N).isCanceled()) return true", this.cancelableEventInterface, eventParam);
counter++;
}
callListenersBuilder.addStatement("return false");