From 56bd21b9aa0c35928c99d2bd97f112c73815ae4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Fri, 17 Aug 2018 10:38:31 +0200 Subject: [PATCH] Deprecate methods in JSON RPC support References #378, #391 (cherry picked from commit 3f079cf54c6960d759c32e0859760a5a7900adfd) --- .../rabbitmq/tools/jsonrpc/JsonRpcClient.java | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/rabbitmq/tools/jsonrpc/JsonRpcClient.java b/src/main/java/com/rabbitmq/tools/jsonrpc/JsonRpcClient.java index f64b9f47f0..913cdc34b8 100644 --- a/src/main/java/com/rabbitmq/tools/jsonrpc/JsonRpcClient.java +++ b/src/main/java/com/rabbitmq/tools/jsonrpc/JsonRpcClient.java @@ -55,7 +55,6 @@ * a {@link JsonRpcMapper}. * * @see #call(String, Object[]) - * @see #call(String[]) * @see JsonRpcMapper * @see JacksonJsonRpcMapper */ @@ -102,7 +101,15 @@ public JsonRpcClient(Channel channel, String exchange, String routingKey) /** * Private API - used by {@link #call(String[])} to ad-hoc convert * strings into the required data types for a call. + * + * This method is deprecated because it uses homegrown JSON utilities + * that don't deal correctly with complex types. The {@link JacksonJsonRpcMapper} + * has been introduced to handle primitive and complex types, as well + * as primitive wrappers correctly. + * + * @deprecated This method will be removed in the next major version */ + @Deprecated public static Object coerce(String val, String type) throws NumberFormatException { if ("bit".equals(type)) { @@ -204,12 +211,19 @@ public T createProxy(Class klass) * passed through coerce() to attempt to make them the types the * server is expecting. * + * This method is deprecated because it uses homegrown JSON utilities + * that don't deal correctly with complex types. The {@link JacksonJsonRpcMapper} + * has been introduced to handle primitive and complex types, as well + * as primitive wrappers correctly. + * * @return the result contained within the reply, if no exception is found * @throws JsonRpcException if the reply object contained an exception * @throws NumberFormatException if a coercion failed * @throws TimeoutException if a response is not received within the timeout specified, if any * @see #coerce + * @deprecated This method will be removed in the next major version */ + @Deprecated public Object call(String[] args) throws NumberFormatException, IOException, JsonRpcException, TimeoutException { if (args.length == 0) {