From: Manuel Carrasco MoƱino Date: Sat, 7 Dec 2013 16:09:05 +0000 (+0100) Subject: LazyGenerator was failing if we were calling the f() signature of the implemented... X-Git-Tag: release-1.4.0~17^2~3 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=7d5891d27a22cb40b0464dd8d92177dd20e3ee46;p=gwtquery.git LazyGenerator was failing if we were calling the f() signature of the implemented function --- diff --git a/gwtquery-core/src/main/java/com/google/gwt/query/rebind/LazyGenerator.java b/gwtquery-core/src/main/java/com/google/gwt/query/rebind/LazyGenerator.java index 8063b79e..1ad4c850 100644 --- a/gwtquery-core/src/main/java/com/google/gwt/query/rebind/LazyGenerator.java +++ b/gwtquery-core/src/main/java/com/google/gwt/query/rebind/LazyGenerator.java @@ -194,10 +194,11 @@ public class LazyGenerator extends Generator { TreeLogger treeLogger) { sw.indent(); sw.println("public Function done() {"); + sw.indent(); sw.println("return new Function() {"); sw.indent(); - sw.println("public void f(Element e) {"); + sw.println("public void f() {"); sw.indent(); String classID = nonLazyType.getSimpleSourceName(); if ("GQuery".equals(classID)) { @@ -205,25 +206,14 @@ public class LazyGenerator extends Generator { } sw.println( - "ctx = GQuery.$(e).as(" + nonLazyType.getQualifiedSourceName() + "." - + classID + ");"); - sw.println("for (int i = 0; i < closures.length(); i++) {"); - sw.indent(); - sw.println("closures.get(i).invoke();"); - sw.outdent(); - sw.println("}"); - sw.outdent(); - sw.println("}"); - sw.println("public boolean f(Event e, Object data) {"); - sw.indent(); - sw.println("ctx = GQuery.$(e.getCurrentTarget());"); + "ctx = GQuery.$(getElement()).as(" + nonLazyType.getQualifiedSourceName() + "." + + classID + ");"); sw.println("for (int i = 0; i < closures.length(); i++) {"); sw.indent(); sw.println("closures.get(i).invoke();"); sw.outdent(); sw.println("}"); sw.outdent(); - sw.println("return false;"); sw.println("}"); sw.outdent(); sw.println("};");