From 91deb4db86b7e09a84fec8b433e506ba81995d03 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 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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 474b600d99..0d5a0ff767 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 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2020 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -994,4 +994,9 @@ private WebApplicationException createExceptionForFamily(final Response response ClientRequest request() { return requestContext; } + + @Override + public String toString() { + return "JerseyInvocation [" + request().getMethod() + ' ' + request().getUri() + "]"; + } }