From 7d5891d27a22cb40b0464dd8d92177dd20e3ee46 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Manuel=20Carrasco=20Mo=C3=B1ino?= Date: Sat, 7 Dec 2013 17:09:05 +0100 Subject: [PATCH] LazyGenerator was failing if we were calling the f() signature of the implemented function --- .../google/gwt/query/rebind/LazyGenerator.java | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) 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("};"); -- 2.39.5