diff --git a/gerrit-gwtui-common/src/main/java/com/google/gerrit/client/rpc/Natives.java b/gerrit-gwtui-common/src/main/java/com/google/gerrit/client/rpc/Natives.java index 564e95a7d3..70878887b7 100644 --- a/gerrit-gwtui-common/src/main/java/com/google/gerrit/client/rpc/Natives.java +++ b/gerrit-gwtui-common/src/main/java/com/google/gerrit/client/rpc/Natives.java @@ -91,34 +91,6 @@ public class Natives { return arr; } - @SuppressWarnings("unchecked") - public static T parseJSON(String json) { - if (json.startsWith("\"")) { - return (T) NativeString.wrap(parseString(parser, json)); - } - return Natives. parseObject(parser, json); // javac generics bug - } - - private static native - T parseObject(JavaScriptObject p, String s) - /*-{ return p(s); }-*/; - - private static native - String parseString(JavaScriptObject p, String s) - /*-{ return p(s); }-*/; - - private static JavaScriptObject parser; - private static native JavaScriptObject bestJsonParser() - /*-{ - if ($wnd.JSON && typeof $wnd.JSON.parse === 'function') - return $wnd.JSON.parse; - return function(s) { return eval('(' + s + ')'); }; - }-*/; - - static { - parser = bestJsonParser(); - } - private Natives() { } }