On Wed, 4 Aug 2021 10:54:10 GMT, Daniel Fuchs <dfu...@openjdk.org> wrote:

>> This is a minor change that updates 
>> `sun.net.httpserver.HttpConnection::toString` to never return null.
>> 
>> Testing: tier 1-3 all clear
>
> src/jdk.httpserver/share/classes/sun/net/httpserver/HttpConnection.java line 
> 69:
> 
>> 67: 
>> 68:     public String toString() {
>> 69:         final var sb = new 
>> StringBuilder(HttpConnection.class.getSimpleName());
> 
> Why not simplify into `new StringBuilder(getClass().getSimpleName());` ?

Have a marginal preference for HttpConnection.class.getSimpleName(), since it 
is a constant, but don't object to getClass().

-------------

PR: https://git.openjdk.java.net/jdk/pull/4928

Reply via email to