mirror of
https://github.com/openjdk/jdk.git
synced 2026-03-14 18:03:44 +00:00
8270903: sun.net.httpserver.HttpConnection: Improve toString
Reviewed-by: chegar, vtewari
This commit is contained in:
parent
4abe531140
commit
685fc3c677
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2005, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -66,11 +66,13 @@ class HttpConnection {
|
||||
volatile State state;
|
||||
|
||||
public String toString() {
|
||||
String s = null;
|
||||
final var sb = new StringBuilder(HttpConnection.class.getSimpleName());
|
||||
if (chan != null) {
|
||||
s = chan.toString();
|
||||
sb.append(" (");
|
||||
sb.append(chan);
|
||||
sb.append(")");
|
||||
}
|
||||
return s;
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
HttpConnection () {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user