File tree Expand file tree Collapse file tree
dcache-xrootd/src/main/java/org/dcache/xrootd/door
dcache/src/main/java/org/dcache/pool Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11package org .dcache .xrootd .door ;
22
3+ import static com .google .common .net .InetAddresses .toUriString ;
34import static java .util .Objects .requireNonNull ;
45
56import diskCacheV111 .util .FsPath ;
@@ -107,9 +108,10 @@ private String formatAddress(InetSocketAddress address) {
107108 return "-" ;
108109 }
109110
110- return address .getAddress () == null
111+ var inetAddress = address .getAddress ();
112+ return inetAddress == null
111113 ? address .getHostString ()
112- : address . getAddress (). getHostAddress ( );
114+ : toUriString ( inetAddress );
113115 }
114116
115117 @ Override
Original file line number Diff line number Diff line change @@ -230,10 +230,9 @@ private String transferTag() {
230230 }
231231
232232 private String formatError (Throwable t ) {
233- String message = t .getMessage ();
234- return message == null || message .isEmpty ()
235- ? t .getClass ().getSimpleName ()
236- : t .getClass ().getSimpleName () + ':' + message ;
233+ return t instanceof Exception
234+ ? Exceptions .messageOrClassName ((Exception ) t )
235+ : t .getClass ().getName ();
237236 }
238237
239238 private synchronized void setThread () throws InterruptedException {
Original file line number Diff line number Diff line change 1717 */
1818package org .dcache .pool .classic ;
1919
20+ import static com .google .common .net .InetAddresses .toUriString ;
2021import static org .dcache .util .Exceptions .messageOrClassName ;
2122
2223import com .google .common .base .Throwables ;
@@ -342,8 +343,9 @@ private String formatEndpoint(InetSocketAddress endpoint) {
342343 return "-" ;
343344 }
344345
345- if (endpoint .getAddress () != null ) {
346- return endpoint .getAddress ().getHostAddress () + ":" + endpoint .getPort ();
346+ InetAddress endpointAddress = endpoint .getAddress ();
347+ if (endpointAddress != null ) {
348+ return toUriString (endpointAddress ) + ":" + endpoint .getPort ();
347349 }
348350
349351 return endpoint .getHostString () + ":" + endpoint .getPort ();
Original file line number Diff line number Diff line change 1919
2020import static com .google .common .base .Preconditions .checkArgument ;
2121import static com .google .common .net .InetAddresses .forString ;
22+ import static com .google .common .net .InetAddresses .toUriString ;
2223
2324import com .google .common .base .Splitter ;
2425import com .google .common .net .HostAndPort ;
@@ -447,7 +448,7 @@ private String formatAddress(InetSocketAddress address) {
447448 }
448449
449450 InetAddress inetAddress = address .getAddress ();
450- return inetAddress == null ? address .getHostString () : inetAddress . getHostAddress ( );
451+ return inetAddress == null ? address .getHostString () : toUriString ( inetAddress );
451452 }
452453
453454 private String formatPort (InetSocketAddress address ) {
You can’t perform that action at this time.
0 commit comments