changeset 149:9b447ea48fa3

Prune OutputFormatType interface.
author shade
date Tue, 27 Aug 2013 14:39:52 +0400
parents ca8d6876f031
children a3aef9af97ce
files jmh-core/src/main/java/org/openjdk/jmh/output/OutputFormatType.java jmh-core/src/main/java/org/openjdk/jmh/runner/options/DefaultBuilder.java jmh-core/src/main/java/org/openjdk/jmh/runner/options/HarnessOptions.java jmh-core/src/main/java/org/openjdk/jmh/runner/options/Options.java
diffstat 4 files changed, 12 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/jmh-core/src/main/java/org/openjdk/jmh/output/OutputFormatType.java	Tue Aug 27 14:35:35 2013 +0400
+++ b/jmh-core/src/main/java/org/openjdk/jmh/output/OutputFormatType.java	Tue Aug 27 14:39:52 2013 +0400
@@ -26,5 +26,13 @@
 
 /** Format enum */
 public enum OutputFormatType {
-    Pretty, CSV, Silent, TextReport
+    Pretty,
+    CSV,
+    Silent,
+    TextReport,
+    ;
+
+    public static OutputFormatType defaultType() {
+        return TextReport;
+    }
 }
--- a/jmh-core/src/main/java/org/openjdk/jmh/runner/options/DefaultBuilder.java	Tue Aug 27 14:35:35 2013 +0400
+++ b/jmh-core/src/main/java/org/openjdk/jmh/runner/options/DefaultBuilder.java	Tue Aug 27 14:39:52 2013 +0400
@@ -89,7 +89,7 @@
 
     // ---------------------------------------------------------------------------
 
-    private OutputFormatType ofType = OutputFormatType.Pretty;
+    private OutputFormatType ofType = OutputFormatType.defaultType();
 
     @Override
     public OptionsBuilder outputFormat(OutputFormatType type) {
@@ -254,7 +254,7 @@
 
     // ---------------------------------------------------------------------------
 
-    private WarmupMode warmupMode = WarmupMode.BEFOREEACH;
+    private WarmupMode warmupMode = WarmupMode.defaultMode();
 
     @Override
     public OptionsBuilder warmupMode(WarmupMode mode) {
--- a/jmh-core/src/main/java/org/openjdk/jmh/runner/options/HarnessOptions.java	Tue Aug 27 14:35:35 2013 +0400
+++ b/jmh-core/src/main/java/org/openjdk/jmh/runner/options/HarnessOptions.java	Tue Aug 27 14:39:52 2013 +0400
@@ -62,7 +62,7 @@
     protected String output = null;
 
     @Option(name = "-of", aliases = {"--outputformat"}, metaVar = "FORMAT", usage = "Format to use for output, use --listformats to list available formats")
-    protected OutputFormatType outputFormat = OutputFormatType.TextReport;
+    protected OutputFormatType outputFormat = OutputFormatType.defaultType();
 
     @Option(name = "--jvm", metaVar = "JVM", usage = "Custom JVM to use with fork.")
     protected String jvm = null;
--- a/jmh-core/src/main/java/org/openjdk/jmh/runner/options/Options.java	Tue Aug 27 14:35:35 2013 +0400
+++ b/jmh-core/src/main/java/org/openjdk/jmh/runner/options/Options.java	Tue Aug 27 14:39:52 2013 +0400
@@ -49,7 +49,6 @@
 
     /**
      * Output format to use
-     * TODO: Rework for null => default
      * @return format type
      */
     OutputFormatType getOutputFormat();