From: Manolo Carrasco Date: Mon, 26 Dec 2011 12:14:25 +0000 (+0000) Subject: these checks are not needed and could break nested collections X-Git-Tag: release-1.3.2~136 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=be181a7792797c68c1eb1f573a9a9b855d43082e;p=gwtquery.git these checks are not needed and could break nested collections --- diff --git a/gwtquery-core/src/main/java/com/google/gwt/query/client/builders/JsonBuilderBase.java b/gwtquery-core/src/main/java/com/google/gwt/query/client/builders/JsonBuilderBase.java index afd04eac..8620501a 100644 --- a/gwtquery-core/src/main/java/com/google/gwt/query/client/builders/JsonBuilderBase.java +++ b/gwtquery-core/src/main/java/com/google/gwt/query/client/builders/JsonBuilderBase.java @@ -40,24 +40,19 @@ public abstract class JsonBuilderBase> implements J public J load(Object prp) { assert prp == null || prp instanceof JavaScriptObject || prp instanceof String; if (prp != null && prp instanceof String) { - return parse((String)prp); - } - int i = -1; - p = prp == null ? Properties.create() : (Properties)prp; - while (p != null && i != p.hashCode() && JsUtils.isArray(p)) { - i = p.hashCode(); - p = p.get(0); + return parse((String)prp); } + p = (Properties)prp; return (J)this; } protected void setArrayBase(String n, T[] r) { if (r.length > 0 && r[0] instanceof JsonBuilder) { - JsArray a = JavaScriptObject.createArray().cast(); - for (T o : r) { - a.push(((JsonBuilder)o).getProperties()); - } - p.set(n, a); + JsArray a = JavaScriptObject.createArray().cast(); + for (T o : r) { + a.push(((JsonBuilder)o).getProperties()); + } + p.set(n, a); } else { JsObjectArray a = JsObjectArray.create(); a.add(r);