From 7409d2346d97c26492c6bba2646d723cb789b551 Mon Sep 17 00:00:00 2001 From: Thomas Meyer Date: Thu, 9 Apr 2020 22:43:11 +0200 Subject: [PATCH] JerseyInvocation should override toString() Override toString() with a sensible implementation. So if you log a given JerseyInvocation object at least the request method and URI of the contained requestContext is printed. See issue #4270 Signed-off-by: Thomas Meyer --- .../java/org/glassfish/jersey/client/JerseyInvocation.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core-client/src/main/java/org/glassfish/jersey/client/JerseyInvocation.java b/core-client/src/main/java/org/glassfish/jersey/client/JerseyInvocation.java index 474b600d996..29bb299fc12 100644 --- a/core-client/src/main/java/org/glassfish/jersey/client/JerseyInvocation.java +++ b/core-client/src/main/java/org/glassfish/jersey/client/JerseyInvocation.java @@ -994,4 +994,9 @@ private WebApplicationException createExceptionForFamily(final Response response ClientRequest request() { return requestContext; } + + @Override + public String toString() { + return "JerseyInvocation [" + request().getMethod() + ' ' + request().getUri() + "]"; + } }