On Wed, 22 Sep 2021 19:20:35 GMT, Andrey Turbanov 
<github.com+741251+turban...@openjdk.org> wrote:

> In several places, String.compareTo was _compared_ with 0 ( via `== 0` or `!= 
> 0`).
> Instead of this, we can use String.equals calls. `String.equals` is faster 
> and shorter.

Marked as reviewed by sspitsyn (Reviewer).

Looks good.
Also, it would be nice to fix formatting nits I inlined in files.

src/jdk.internal.jvmstat/share/classes/sun/jvmstat/monitor/HostIdentifier.java 
line 109:

> 107:      */
> 108:     private URI canonicalize(String uriString) throws URISyntaxException 
> {
> 109:         if ((uriString == null) || (uriString.equals("localhost"))) {

Nit: Not your issue but you can also get rid of unneeded brackets `()`.

src/jdk.internal.jvmstat/share/classes/sun/jvmstat/monitor/HostIdentifier.java 
line 346:

> 344:         String authority = vmid.getAuthority();
> 345: 
> 346:         if ("file".equals(scheme)) {

Nit: Not your issue but you can also get rid of unneeded brackets ().

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

PR: https://git.openjdk.java.net/jdk/pull/5638Marked as reviewed by sspitsyn 
(Reviewer).

Reply via email to