RFR: 8123: Use StandardCharsets where possible

Marcus Hirt hirt at openjdk.org
Fri Oct 6 19:59:20 UTC 2023


On Tue, 3 Oct 2023 18:56:44 GMT, Christoph Dreis <duke at openjdk.org> wrote:

> Hi,
> 
> this PR replaces `UTF-8` String usages with `StandardCharsets.UTF_8` where possible.
> 
> I'd appreciate if this is sponsored including a ticket etc.
> 
> Cheers,
> Christoph

Aside from a few copyright nits, it looks good. Thanks for your contribution!

application/org.openjdk.jmc.flightrecorder.controlpanel.ui.configuration/src/main/java/org/openjdk/jmc/flightrecorder/controlpanel/ui/configuration/model/xml/XMLModel.java line 45:

> 43: import java.io.Writer;
> 44: import java.nio.charset.Charset;
> 45: import java.nio.charset.StandardCharsets;

Got to update the copyright year to 2023.

core/org.openjdk.jmc.common/src/main/java/org/openjdk/jmc/common/util/StringToolkit.java line 40:

> 38: import java.io.InputStream;
> 39: import java.net.URLEncoder;
> 40: import java.nio.charset.Charset;

Got to update the copyright year to 2023 here as well, i.e.: 
 Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved.

core/org.openjdk.jmc.common/src/main/java/org/openjdk/jmc/common/util/XmlToolkit.java line 44:

> 42: import java.io.StringWriter;
> 43: import java.io.Writer;
> 44: import java.nio.charset.StandardCharsets;

For this file the copyright needs to be updated as well.

core/org.openjdk.jmc.flightrecorder/src/main/java/org/openjdk/jmc/flightrecorder/internal/parser/v0/UTFStringParser.java line 36:

> 34: 
> 35: import java.io.UnsupportedEncodingException;
> 36: import java.nio.charset.Charset;

Copyright.

core/org.openjdk.jmc.jdp/src/main/java/org/openjdk/jmc/jdp/common/JDPPacket.java line 41:

> 39: import java.io.EOFException;
> 40: import java.io.IOException;
> 41: import java.nio.charset.StandardCharsets;

Copyright.

core/org.openjdk.jmc.testlib/src/main/java/org/openjdk/jmc/test/TestToolkit.java line 43:

> 41: import java.net.URISyntaxException;
> 42: import java.net.URL;
> 43: import java.nio.charset.StandardCharsets;

Copyright.

core/tests/org.openjdk.jmc.jdp.test/src/main/java/org/openjdk/jmc/jdp/client/TestToolkit.java line 41:

> 39: import java.net.MulticastSocket;
> 40: import java.net.UnknownHostException;
> 41: import java.nio.charset.StandardCharsets;

And copyright. :)

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

Changes requested by hirt (Lead).

PR Review: https://git.openjdk.org/jmc/pull/518#pullrequestreview-1662706279
PR Review Comment: https://git.openjdk.org/jmc/pull/518#discussion_r1349257404
PR Review Comment: https://git.openjdk.org/jmc/pull/518#discussion_r1349258086
PR Review Comment: https://git.openjdk.org/jmc/pull/518#discussion_r1349258532
PR Review Comment: https://git.openjdk.org/jmc/pull/518#discussion_r1349258706
PR Review Comment: https://git.openjdk.org/jmc/pull/518#discussion_r1349258942
PR Review Comment: https://git.openjdk.org/jmc/pull/518#discussion_r1349259080
PR Review Comment: https://git.openjdk.org/jmc/pull/518#discussion_r1349259490


More information about the jmc-dev mailing list