mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 15:24:43 +02:00
8274333: Redundant null comparison after Pattern.split
Reviewed-by: mullan, weijun, rriggs, iris
This commit is contained in:
parent
6677554374
commit
36b59f3814
2 changed files with 9 additions and 10 deletions
|
@ -34,11 +34,6 @@ package sun.launcher;
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
|
||||||
* 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.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.PrintStream;
|
import java.io.PrintStream;
|
||||||
|
@ -88,7 +83,11 @@ import jdk.internal.module.Modules;
|
||||||
import jdk.internal.platform.Container;
|
import jdk.internal.platform.Container;
|
||||||
import jdk.internal.platform.Metrics;
|
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 {
|
public final class LauncherHelper {
|
||||||
|
|
||||||
// No instantiation
|
// No instantiation
|
||||||
|
@ -154,8 +153,8 @@ public final class LauncherHelper {
|
||||||
long initialHeapSize, long maxHeapSize, long stackSize) {
|
long initialHeapSize, long maxHeapSize, long stackSize) {
|
||||||
|
|
||||||
initOutput(printToStderr);
|
initOutput(printToStderr);
|
||||||
String opts[] = optionFlag.split(":");
|
String[] opts = optionFlag.split(":");
|
||||||
String optStr = (opts.length > 1 && opts[1] != null)
|
String optStr = opts.length > 1
|
||||||
? opts[1].trim()
|
? opts[1].trim()
|
||||||
: "all";
|
: "all";
|
||||||
switch (optStr) {
|
switch (optStr) {
|
||||||
|
|
|
@ -57,7 +57,7 @@ public class AlgorithmDecomposer {
|
||||||
String[] transTokens = algorithm.split("/");
|
String[] transTokens = algorithm.split("/");
|
||||||
|
|
||||||
for (String transToken : transTokens) {
|
for (String transToken : transTokens) {
|
||||||
if (transToken == null || transToken.isEmpty()) {
|
if (transToken.isEmpty()) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -70,7 +70,7 @@ public class AlgorithmDecomposer {
|
||||||
String[] tokens = PATTERN.split(transToken);
|
String[] tokens = PATTERN.split(transToken);
|
||||||
|
|
||||||
for (String token : tokens) {
|
for (String token : tokens) {
|
||||||
if (token == null || token.isEmpty()) {
|
if (token.isEmpty()) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue