mirror of
https://github.com/zaaarf/geb-processor.git
synced 2024-11-22 15:04:48 +01:00
fix: fixed the generator being called repeatedly
This commit is contained in:
parent
f5cf21050f
commit
773880f323
1 changed files with 5 additions and 5 deletions
|
@ -92,12 +92,11 @@ public class GEBProcessor extends AbstractProcessor {
|
||||||
for(TypeElement ann : annotations) {
|
for(TypeElement ann : annotations) {
|
||||||
if(ann.getQualifiedName().contentEquals(Listen.class.getName())) {
|
if(ann.getQualifiedName().contentEquals(Listen.class.getName())) {
|
||||||
claimed = true;
|
claimed = true;
|
||||||
for(Element e : env.getElementsAnnotatedWith(ann)) {
|
for(Element e : env.getElementsAnnotatedWith(ann))
|
||||||
this.processListener(e);
|
this.processListener(e);
|
||||||
if(!this.listenerMap.isEmpty()) {
|
if(!this.listenerMap.isEmpty()) {
|
||||||
this.generateClasses();
|
this.generateClasses();
|
||||||
this.generateServiceProvider();
|
this.generateServiceProvider();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -198,6 +197,7 @@ public class GEBProcessor extends AbstractProcessor {
|
||||||
listener.method.getSimpleName().toString(), event, eventParam);
|
listener.method.getSimpleName().toString(), event, eventParam);
|
||||||
if(cancelable) callListenersBuilder
|
if(cancelable) callListenersBuilder
|
||||||
.addStatement("if((($T) $N).isCanceled()) return true", this.cancelableEventInterface, eventParam);
|
.addStatement("if((($T) $N).isCanceled()) return true", this.cancelableEventInterface, eventParam);
|
||||||
|
counter++;
|
||||||
}
|
}
|
||||||
|
|
||||||
callListenersBuilder.addStatement("return false");
|
callListenersBuilder.addStatement("return false");
|
||||||
|
|
Loading…
Reference in a new issue