From 773880f3233140c8a1b717ca7b717726c5803f95 Mon Sep 17 00:00:00 2001 From: zaaarf Date: Fri, 25 Aug 2023 09:19:44 +0200 Subject: fix: fixed the generator being called repeatedly --- src/main/java/ftbsc/geb/processor/GEBProcessor.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/main/java/ftbsc/geb/processor/GEBProcessor.java b/src/main/java/ftbsc/geb/processor/GEBProcessor.java index f05bef4..965ce91 100644 --- a/src/main/java/ftbsc/geb/processor/GEBProcessor.java +++ b/src/main/java/ftbsc/geb/processor/GEBProcessor.java @@ -92,12 +92,11 @@ 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(); - this.generateServiceProvider(); - } + if(!this.listenerMap.isEmpty()) { + this.generateClasses(); + this.generateServiceProvider(); } } } @@ -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"); -- cgit v1.2.3-56-ga3b1