diff options
author | Manolo Carrasco <manolo@apache.org> | 2011-12-26 12:14:25 +0000 |
---|---|---|
committer | Manolo Carrasco <manolo@apache.org> | 2011-12-26 12:14:25 +0000 |
commit | be181a7792797c68c1eb1f573a9a9b855d43082e (patch) | |
tree | e1cbdcec6926eaeff5e3a1e31896272b9ce053e5 /gwtquery-core/src | |
parent | 0bd183b95d18981a3ce83028f87e3a928ec70dbe (diff) | |
download | gwtquery-be181a7792797c68c1eb1f573a9a9b855d43082e.tar.gz gwtquery-be181a7792797c68c1eb1f573a9a9b855d43082e.zip |
these checks are not needed and could break nested collections
Diffstat (limited to 'gwtquery-core/src')
-rw-r--r-- | gwtquery-core/src/main/java/com/google/gwt/query/client/builders/JsonBuilderBase.java | 19 |
1 files changed, 7 insertions, 12 deletions
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<J extends 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 <T> void setArrayBase(String n, T[] r) { if (r.length > 0 && r[0] instanceof JsonBuilder) { - JsArray<JavaScriptObject> a = JavaScriptObject.createArray().cast(); - for (T o : r) { - a.push(((JsonBuilder)o).getProperties()); - } - p.set(n, a); + JsArray<JavaScriptObject> a = JavaScriptObject.createArray().cast(); + for (T o : r) { + a.push(((JsonBuilder)o).getProperties()); + } + p.set(n, a); } else { JsObjectArray<Object> a = JsObjectArray.create(); a.add(r); |