changeset 121:7a748398603b

Fix forked VM failure when -w 0 or -i 0 is supplied.
author shade
date Sat, 17 Aug 2013 17:51:22 +0400
parents 5719406459e9
children 6cc908c9ba44
files jmh-core/src/main/java/org/openjdk/jmh/runner/options/BaseOptions.java jmh-core/src/main/java/org/openjdk/jmh/runner/parameters/TimeValue.java
diffstat 2 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/jmh-core/src/main/java/org/openjdk/jmh/runner/options/BaseOptions.java	Sat Aug 17 17:06:50 2013 +0400
+++ b/jmh-core/src/main/java/org/openjdk/jmh/runner/options/BaseOptions.java	Sat Aug 17 17:51:22 2013 +0400
@@ -290,7 +290,7 @@
         try {
             Object value = f.get(this);
             if (value != null && value instanceof TimeValue) {
-                return f.getAnnotation(Option.class).name() + " " + value;
+                return f.getAnnotation(Option.class).name() + " " + ((TimeValue) value).toCommandLine();
             } else {
                 return null;
             }
--- a/jmh-core/src/main/java/org/openjdk/jmh/runner/parameters/TimeValue.java	Sat Aug 17 17:06:50 2013 +0400
+++ b/jmh-core/src/main/java/org/openjdk/jmh/runner/parameters/TimeValue.java	Sat Aug 17 17:51:22 2013 +0400
@@ -88,6 +88,10 @@
         }
     }
 
+    public String toCommandLine() {
+        return String.valueOf(time) + timeUnitString();
+    }
+
     private String timeUnitString() {
         switch(timeUnit) {
             case SECONDS: