changeset 359:94b4749f5bc1

UX: "VM Options" prints "<none>" instead of empty string.
author shade
date Tue, 21 Jan 2014 13:40:21 +0400
parents 3e0110b67f47
children 1846fe42b40b
files jmh-core/src/main/java/org/openjdk/jmh/runner/Runner.java
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/jmh-core/src/main/java/org/openjdk/jmh/runner/Runner.java	Tue Jan 21 12:39:32 2014 +0400
+++ b/jmh-core/src/main/java/org/openjdk/jmh/runner/Runner.java	Tue Jan 21 13:40:21 2014 +0400
@@ -322,6 +322,10 @@
             BenchmarkRecord benchmark = actionPlan.getMeasurementActions().get(0).getBenchmark();
 
             String[] commandString = getSeparateExecutionCommand(benchmark, server.getHost(), server.getPort());
+            String opts = merge(options.getJvmArgs().orElse(benchmark.getJvmArgs().orElse(getDefaultJvmArgs(benchmark))));
+            if (opts.trim().isEmpty()) {
+                opts = "<none>";
+            }
 
             BenchmarkParams params = new BenchmarkParams(options, benchmark, ActionMode.UNDEF);
 
@@ -331,7 +335,7 @@
                 out.verbosePrintln("Warmup forking " + warmupForkCount + " times using command: " + Arrays.toString(commandString));
                 for (int i = 0; i < warmupForkCount; i++) {
                     out.println("# Warmup Fork: " + (i + 1) + " of " + forkCount);
-                    out.println("# VM options: " + merge(options.getJvmArgs().orElse(benchmark.getJvmArgs().orElse(getDefaultJvmArgs(benchmark)))));
+                    out.println("# VM options: " + opts);
                     doFork(server, commandString);
                 }
             }
@@ -339,7 +343,7 @@
             out.verbosePrintln("Forking " + forkCount + " times using command: " + Arrays.toString(commandString));
             for (int i = 0; i < forkCount; i++) {
                 out.println("# Fork: " + (i + 1) + " of " + forkCount);
-                out.println("# VM options: " + merge(options.getJvmArgs().orElse(benchmark.getJvmArgs().orElse(getDefaultJvmArgs(benchmark)))));
+                out.println("# VM options: " + opts);
                 Multimap<BenchmarkRecord, BenchResult> result = doFork(server, commandString);
                 results.merge(result);
             }