From c25ba851df8274c1bd0191630e69e923d20c2f39 Mon Sep 17 00:00:00 2001 From: Manolo Carrasco Date: Wed, 23 Jun 2010 15:57:27 +0000 Subject: [PATCH] removed some warning --- .../com/google/gwt/query/client/GQuery.java | 18 ++++++++++-------- .../google/gwt/query/client/LazyGQuery.java | 6 +++--- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/gwtquery-core/src/main/java/com/google/gwt/query/client/GQuery.java b/gwtquery-core/src/main/java/com/google/gwt/query/client/GQuery.java index 6e7e505b..b30a1ee6 100644 --- a/gwtquery-core/src/main/java/com/google/gwt/query/client/GQuery.java +++ b/gwtquery-core/src/main/java/com/google/gwt/query/client/GQuery.java @@ -70,7 +70,7 @@ public class GQuery implements Lazy { } /** - * A class to store data in an element + * A class to store data in an element. */ protected static final class DataCache extends JavaScriptObject { @@ -245,6 +245,7 @@ public class GQuery implements Lazy { * element containing those elements. The second parameter is the context to * use for the selector. The third parameter is the class plugin to use. */ + @SuppressWarnings("unchecked") public static T $(String selector, Node context, Class plugin) { try { @@ -269,6 +270,7 @@ public class GQuery implements Lazy { return Properties.create(properties); } + @SuppressWarnings("unchecked") public static T[] asArray(NodeList nl) { if (GWT.isScript()) { return reinterpretCast(nl); @@ -286,7 +288,7 @@ public class GQuery implements Lazy { * simply queued up and not executed immediately. */ public static LazyGQuery lazy() { - return GQuery.$().createLazy(); + return $().createLazy(); } public static void registerPlugin(Class plugin, @@ -297,6 +299,7 @@ public class GQuery implements Lazy { plugins.put(plugin, pluginFactory); } + @SuppressWarnings("unchecked") protected static GQuery clean(String elem) { String tags = elem.trim().toLowerCase(); String preWrap = "", postWrap = ""; @@ -371,7 +374,7 @@ public class GQuery implements Lazy { } } - private static JSArray copyNodeList(NodeList n) { + private static JSArray copyNodeList(NodeList n) { JSArray res = JSArray.create(); for (int i = 0; i < n.getLength(); i++) { res.addNode(n.getItem(i)); @@ -1265,7 +1268,7 @@ public class GQuery implements Lazy { } /** - * Trigger a keydown event passing the key pushed + * Trigger a keydown event passing the key pushed. */ public GQuery keydown(int key) { return trigger(Event.ONKEYDOWN, key); @@ -1280,7 +1283,7 @@ public class GQuery implements Lazy { } /** - * Trigger a keypress event passing the key pushed + * Trigger a keypress event passing the key pushed. */ public GQuery keypress(int key) { return trigger(Event.ONKEYPRESS, key); @@ -1295,7 +1298,7 @@ public class GQuery implements Lazy { } /** - * Trigger a keyup event passing the key pushed + * Trigger a keyup event passing the key pushed. */ public GQuery keyup(int key) { return trigger(Event.ONKEYUP, key); @@ -1728,7 +1731,6 @@ public class GQuery implements Lazy { return replaceAll($(html)); } - /** * Replaces all matched elements with the specified HTML or DOM elements. This * returns the GQuery element that was just replaced, which has been removed @@ -2050,7 +2052,7 @@ public class GQuery implements Lazy { public String toString(boolean pretty) { String r = ""; for (Element e : elements()) { - if (e == window || e == (Node)document) { + if (window.equals(e) || document.equals(e)) { continue; } r += (pretty && r.length() > 0 ? "\n " : "") + e.getString(); diff --git a/gwtquery-core/src/main/java/com/google/gwt/query/client/LazyGQuery.java b/gwtquery-core/src/main/java/com/google/gwt/query/client/LazyGQuery.java index 4a2f01fc..8800c8f3 100644 --- a/gwtquery-core/src/main/java/com/google/gwt/query/client/LazyGQuery.java +++ b/gwtquery-core/src/main/java/com/google/gwt/query/client/LazyGQuery.java @@ -565,7 +565,7 @@ public interface LazyGQuery extends LazyBase{ LazyGQuery keydown(Function...f); /** - * Trigger a keydown event passing the key pushed + * Trigger a keydown event passing the key pushed. */ LazyGQuery keydown(int key); @@ -576,7 +576,7 @@ public interface LazyGQuery extends LazyBase{ LazyGQuery keypress(Function...f); /** - * Trigger a keypress event passing the key pushed + * Trigger a keypress event passing the key pushed. */ LazyGQuery keypress(int key); @@ -587,7 +587,7 @@ public interface LazyGQuery extends LazyBase{ LazyGQuery keyup(Function...f); /** - * Trigger a keyup event passing the key pushed + * Trigger a keyup event passing the key pushed. */ LazyGQuery keyup(int key); -- 2.39.5