Skip to content

Commit 56bd21b

Browse files
committed
Deprecate methods in JSON RPC support
References #378, #391 (cherry picked from commit 3f079cf)
1 parent 5239b2c commit 56bd21b

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

src/main/java/com/rabbitmq/tools/jsonrpc/JsonRpcClient.java

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@
5555
* a {@link JsonRpcMapper}.
5656
*
5757
* @see #call(String, Object[])
58-
* @see #call(String[])
5958
* @see JsonRpcMapper
6059
* @see JacksonJsonRpcMapper
6160
*/
@@ -102,7 +101,15 @@ public JsonRpcClient(Channel channel, String exchange, String routingKey)
102101
/**
103102
* Private API - used by {@link #call(String[])} to ad-hoc convert
104103
* strings into the required data types for a call.
104+
*
105+
* This method is deprecated because it uses homegrown JSON utilities
106+
* that don't deal correctly with complex types. The {@link JacksonJsonRpcMapper}
107+
* has been introduced to handle primitive and complex types, as well
108+
* as primitive wrappers correctly.
109+
*
110+
* @deprecated This method will be removed in the next major version
105111
*/
112+
@Deprecated
106113
public static Object coerce(String val, String type)
107114
throws NumberFormatException {
108115
if ("bit".equals(type)) {
@@ -204,12 +211,19 @@ public <T> T createProxy(Class<T> klass)
204211
* passed through coerce() to attempt to make them the types the
205212
* server is expecting.
206213
*
214+
* This method is deprecated because it uses homegrown JSON utilities
215+
* that don't deal correctly with complex types. The {@link JacksonJsonRpcMapper}
216+
* has been introduced to handle primitive and complex types, as well
217+
* as primitive wrappers correctly.
218+
*
207219
* @return the result contained within the reply, if no exception is found
208220
* @throws JsonRpcException if the reply object contained an exception
209221
* @throws NumberFormatException if a coercion failed
210222
* @throws TimeoutException if a response is not received within the timeout specified, if any
211223
* @see #coerce
224+
* @deprecated This method will be removed in the next major version
212225
*/
226+
@Deprecated
213227
public Object call(String[] args)
214228
throws NumberFormatException, IOException, JsonRpcException, TimeoutException {
215229
if (args.length == 0) {

0 commit comments

Comments
 (0)