Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions src/java.base/share/classes/sun/launcher/LauncherHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,6 @@
*
*/

/**
* A utility package for the java(1), javaw(1) launchers.
* The following are helper methods that the native launcher uses
* to perform checks etc. using JNI, see src/share/bin/java.c
*/
import java.io.File;
import java.io.IOException;
import java.io.PrintStream;
Expand Down Expand Up @@ -88,7 +83,11 @@
import jdk.internal.platform.Container;
import jdk.internal.platform.Metrics;


/**
* A utility package for the java(1), javaw(1) launchers.
* The following are helper methods that the native launcher uses
* to perform checks etc. using JNI, see src/share/bin/java.c
*/
public final class LauncherHelper {

// No instantiation
Expand Down Expand Up @@ -154,8 +153,8 @@ static void showSettings(boolean printToStderr, String optionFlag,
long initialHeapSize, long maxHeapSize, long stackSize) {

initOutput(printToStderr);
String opts[] = optionFlag.split(":");
String optStr = (opts.length > 1 && opts[1] != null)
String[] opts = optionFlag.split(":");
String optStr = opts.length > 1
? opts[1].trim()
: "all";
switch (optStr) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 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
Expand Down Expand Up @@ -47,7 +47,7 @@ private static Set<String> decomposeImpl(String algorithm) {
String[] transTokens = algorithm.split("/");

for (String transToken : transTokens) {
if (transToken == null || transToken.isEmpty()) {
if (transToken.isEmpty()) {
continue;
}

Expand All @@ -60,7 +60,7 @@ private static Set<String> decomposeImpl(String algorithm) {
String[] tokens = PATTERN.split(transToken);

for (String token : tokens) {
if (token == null || token.isEmpty()) {
if (token.isEmpty()) {
continue;
}

Expand Down