From 34ddd6fd7dd603f1fd6ade473bef213be9895d0e Mon Sep 17 00:00:00 2001 From: Gert Scholten Date: Mon, 14 Dec 2009 23:47:58 +0100 Subject: Upgrade GWT dependancy to version 2.0.0. Change-Id: I853696d3c034d14e32403967c3868c8c4fe69a4b Signed-off-by: Gert Scholten --- pom.xml | 50 +--------------------- .../gwtjsonrpc/client/impl/AbstractJsonProxy.java | 16 +++++++ .../gwtjsonrpc/client/impl/JsonSerializer.java | 17 ++++++-- 3 files changed, 31 insertions(+), 52 deletions(-) diff --git a/pom.xml b/pom.xml index f39f4b5..792dde5 100644 --- a/pom.xml +++ b/pom.xml @@ -253,7 +253,7 @@ limitations under the License. - 1.7.0 + 2.0.0 @@ -312,58 +312,10 @@ limitations under the License. com.google.gwt gwt-dev ${gwtVersion} - ${platform}-libs - zip - provided - - - com.google.gwt - gwt-dev - ${gwtVersion} - ${platform} provided - - - gwt-dev-windows - - windows - - - true - - windows - - - - - gwt-dev-mac - - mac - - - false - - mac - - - - - gwt-dev-linux - - linux - - - false - - linux - - - - - gson diff --git a/src/main/java/com/google/gwtjsonrpc/client/impl/AbstractJsonProxy.java b/src/main/java/com/google/gwtjsonrpc/client/impl/AbstractJsonProxy.java index 9f07675..f0628f3 100644 --- a/src/main/java/com/google/gwtjsonrpc/client/impl/AbstractJsonProxy.java +++ b/src/main/java/com/google/gwtjsonrpc/client/impl/AbstractJsonProxy.java @@ -17,6 +17,7 @@ package com.google.gwtjsonrpc.client.impl; import com.google.gwt.core.client.JavaScriptObject; import com.google.gwt.user.client.rpc.AsyncCallback; import com.google.gwt.user.client.rpc.InvocationException; +import com.google.gwt.user.client.rpc.RpcRequestBuilder; import com.google.gwtjsonrpc.client.JsonDefTarget; import com.google.gwtjsonrpc.client.JsonUtil; import com.google.gwtjsonrpc.client.RemoteJsonService; @@ -53,6 +54,21 @@ public abstract class AbstractJsonProxy implements JsonDefTarget { xsrfManager = m; } + @Override + public void setRpcRequestBuilder(RpcRequestBuilder builder) { + if (builder != null) + throw new UnsupportedOperationException( + "A RemoteJsonService does not use the RpcRequestBuilder, so this method is unsupported."); + /** + * From the gwt docs: + * + * Calling this method with a null value will reset any custom behavior to + * the default implementation. + * + * If builder == null, we just ignore this invocation. + */ + } + protected void doInvoke(final String methodName, final String reqData, final ResultDeserializer ser, final AsyncCallback cb) throws InvocationException { diff --git a/src/main/java/com/google/gwtjsonrpc/client/impl/JsonSerializer.java b/src/main/java/com/google/gwtjsonrpc/client/impl/JsonSerializer.java index 74ff69a..d55294b 100644 --- a/src/main/java/com/google/gwtjsonrpc/client/impl/JsonSerializer.java +++ b/src/main/java/com/google/gwtjsonrpc/client/impl/JsonSerializer.java @@ -14,6 +14,7 @@ package com.google.gwtjsonrpc.client.impl; +import com.google.gwt.core.client.JsonUtils; import com.google.gwtjsonrpc.client.impl.ser.JavaLangString_JsonSerializer; /** @@ -65,15 +66,25 @@ public abstract class JsonSerializer { * * @param val string text requiring escaping support. Must not be null. * @return a JSON literal text value, surrounded with double quotes. + * @deprecated Use {@link JsonUtils#escapeValue(String)} */ - public static final native String escapeString(String val)/*-{ return @com.google.gwt.json.client.JSONString::escapeValue(Ljava/lang/String;)(val); }-*/; + @Deprecated + public static final String escapeString(String val) { + return JsonUtils.escapeValue(val); + } - /** Escape a single character, without double quotes surrounding it. */ + /** + * Escape a single character, without double quotes surrounding it. + * + * @deprecated implementation depends on private method hack. Do not use. + */ + @Deprecated public static final String escapeChar(final char c) { return escapeCharImpl(String.valueOf(c)); } - private static final native String escapeCharImpl(String c)/*-{ return @com.google.gwt.json.client.JSONString::escapeChar(Ljava/lang/String;)(c); }-*/; + @Deprecated + private static final native String escapeCharImpl(String c) /*-{ return @com.google.gwt.core.client.JsonUtils::escapeChar(Ljava/lang/String;)(c); }-*/; /** Return the first character of a string, or '\0' if the string is empty. */ public static final char toChar(final String val) { -- cgit v1.2.3