@@ -24,7 +24,7 @@ class JvmOptions {
2424 final String [] PROCFS_CMDLINE = readProcFsCmdLine ();
2525 final List <String > VM_OPTIONS = findVmOptions ();
2626
27- @ SuppressForbidden // split on single-character uses fast path
27+ @ SuppressForbidden // split on single-character uses a fast path
2828 private String [] readProcFsCmdLine () {
2929 if (isLinux ()) {
3030 try {
@@ -85,7 +85,7 @@ private List<String> findVmOptions() {
8585 return ManagementFactory .getRuntimeMXBean ().getInputArguments ();
8686 } catch (final Throwable t ) {
8787 // Throws InvocationTargetException on modularized applications
88- // with non-opened java.management module
88+ // with a non-opened java.management module
8989 System .err .println ("WARNING: Unable to get VM args using managed beans" );
9090 }
9191 return emptyList ();
@@ -95,9 +95,9 @@ private List<String> findVmOptions() {
9595 // executable
9696 // Visible for testing
9797 List <String > findVmOptionsFromProcFs (String [] procfsCmdline ) {
98- // Create list of VM options
98+ // Create the list of VM options
9999 List <String > vmOptions = new ArrayList <>();
100- // Look for first self-standing argument that is not prefixed with "-" or end of VM options
100+ // Look for the first self-standing argument that is not prefixed with "-" or end of VM options
101101 // while simultaneously, collect all arguments in the VM options
102102 // Starts from 1 as 0 is the java command itself (or native-image)
103103 for (int index = 1 ; index < procfsCmdline .length ; index ++) {
@@ -115,7 +115,7 @@ else if ("-jar".equals(argument) || !argument.startsWith("-")) {
115115 // End of VM options
116116 break ;
117117 }
118- // Otherwise add as VM option
118+ // Otherwise add as a VM option
119119 else {
120120 vmOptions .add (argument );
121121 }
@@ -142,7 +142,7 @@ private static List<String> getArgumentsFromFile(String argFile) {
142142 List <String > args = new ArrayList <>();
143143 try {
144144 for (String line : Files .readAllLines (path )) {
145- // Use default delimiters that matches argfiles separator specification
145+ // Use default delimiters that match argfiles separator specification
146146 StringTokenizer tokenizer = new StringTokenizer (line );
147147 while (tokenizer .hasMoreTokens ()) {
148148 args .add (tokenizer .nextToken ());
@@ -207,13 +207,4 @@ static List<String> parseOptions(String javaToolOptions) {
207207 }
208208 return options ;
209209 }
210-
211- private static List <String > split (String str , String delimiter ) {
212- List <String > parts = new ArrayList <>();
213- StringTokenizer tokenizer = new StringTokenizer (str , delimiter );
214- while (tokenizer .hasMoreTokens ()) {
215- parts .add (tokenizer .nextToken ());
216- }
217- return parts ;
218- }
219210}
0 commit comments