Bug 481272 - Discovered a number of bugs in Performance "display"
functions
diff --git a/bundles/org.eclipse.test.performance.ui/.classpath b/bundles/org.eclipse.test.performance.ui/.classpath
index ad32c83..098194c 100644
--- a/bundles/org.eclipse.test.performance.ui/.classpath
+++ b/bundles/org.eclipse.test.performance.ui/.classpath
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <classpath>
-	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
 	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
 	<classpathentry kind="src" path="src"/>
 	<classpathentry kind="output" path="bin"/>
diff --git a/bundles/org.eclipse.test.performance.ui/.project b/bundles/org.eclipse.test.performance.ui/.project
index 47525f5..b608c59 100644
--- a/bundles/org.eclipse.test.performance.ui/.project
+++ b/bundles/org.eclipse.test.performance.ui/.project
@@ -20,6 +20,11 @@
 			<arguments>
 			</arguments>
 		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.wst.validation.validationbuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
 	</buildSpec>
 	<natures>
 		<nature>org.eclipse.pde.PluginNature</nature>
diff --git a/bundles/org.eclipse.test.performance.ui/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.test.performance.ui/.settings/org.eclipse.jdt.core.prefs
index 555ecc0..d4cf1ee 100644
--- a/bundles/org.eclipse.test.performance.ui/.settings/org.eclipse.jdt.core.prefs
+++ b/bundles/org.eclipse.test.performance.ui/.settings/org.eclipse.jdt.core.prefs
@@ -17,9 +17,9 @@
 org.eclipse.jdt.core.compiler.annotation.nullanalysis=enabled
 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
 org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
 org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.compliance=1.7
 org.eclipse.jdt.core.compiler.debug.lineNumber=generate
 org.eclipse.jdt.core.compiler.debug.localVariable=generate
 org.eclipse.jdt.core.compiler.debug.sourceFile=generate
@@ -107,7 +107,7 @@
 org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore
 org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
 org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.source=1.6
+org.eclipse.jdt.core.compiler.source=1.7
 org.eclipse.jdt.core.formatter.align_type_members_on_columns=true
 org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
 org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
diff --git a/bundles/org.eclipse.test.performance.ui/.settings/org.eclipse.wst.validation.prefs b/bundles/org.eclipse.test.performance.ui/.settings/org.eclipse.wst.validation.prefs
new file mode 100644
index 0000000..8ba670c
--- /dev/null
+++ b/bundles/org.eclipse.test.performance.ui/.settings/org.eclipse.wst.validation.prefs
@@ -0,0 +1,8 @@
+DELEGATES_PREFERENCE=delegateValidatorList
+USER_BUILD_PREFERENCE=enabledBuildValidatorList
+USER_MANUAL_PREFERENCE=enabledManualValidatorList
+USER_PREFERENCE=overrideGlobalPreferencestruedisableAllValidationfalseversion1.2.700.v201508251749
+eclipse.preferences.version=1
+override=true
+suspend=false
+vf.version=3
diff --git a/bundles/org.eclipse.test.performance.ui/META-INF/MANIFEST.MF b/bundles/org.eclipse.test.performance.ui/META-INF/MANIFEST.MF
index 4d66a51..285eacf 100644
--- a/bundles/org.eclipse.test.performance.ui/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.test.performance.ui/META-INF/MANIFEST.MF
@@ -2,8 +2,8 @@
 Bundle-ManifestVersion: 2
 Bundle-Name: %Bundle-Name
 Bundle-SymbolicName: org.eclipse.test.performance.ui; singleton:=true
-Bundle-Version: 3.8.0.qualifier
-Bundle-ClassPath: performanceui.jar
+Bundle-Version: 3.9.0.qualifier
+Bundle-ClassPath: .
 Bundle-Activator: org.eclipse.test.performance.ui.UiPlugin
 Bundle-ActivationPolicy: lazy
 Bundle-Vendor: %Bundle-Vendor
@@ -17,9 +17,9 @@
  org.eclipse.ui;bundle-version="3.5.0";resolution:=optional,
  org.eclipse.ui.ide;bundle-version="3.5.0";resolution:=optional,
  org.eclipse.core.resources;bundle-version="3.5.0"
-Bundle-RequiredExecutionEnvironment: JavaSE-1.6
-Export-Package: org.eclipse.test.internal.performance.results.db,
- org.eclipse.test.internal.performance.results.model,
- org.eclipse.test.internal.performance.results.ui,
- org.eclipse.test.internal.performance.results.utils,
+Bundle-RequiredExecutionEnvironment: JavaSE-1.7
+Export-Package: org.eclipse.test.internal.performance.results.db;x-internal:=true,
+ org.eclipse.test.internal.performance.results.model;x-internal:=true,
+ org.eclipse.test.internal.performance.results.ui;x-internal:=true,
+ org.eclipse.test.internal.performance.results.utils;x-internal:=true,
  org.eclipse.test.performance.ui
diff --git a/bundles/org.eclipse.test.performance.ui/build.properties b/bundles/org.eclipse.test.performance.ui/build.properties
index 5489437..f0b5824 100644
--- a/bundles/org.eclipse.test.performance.ui/build.properties
+++ b/bundles/org.eclipse.test.performance.ui/build.properties
@@ -17,13 +17,11 @@
                scripts/,\
                icons/,\
                html/,\
-               performanceui.jar,\
                toc.xml,\
                contexts.xml,\
                doc/,\
-               plugin.properties
-source.performanceui.jar = src/
-jars.compile.order = performanceui.jar
+               plugin.properties,\
+               .
 src.includes = about.html,\
                contexts.xml,\
                doc/,\
@@ -33,3 +31,4 @@
                readme.html,\
                toc.xml,\
                scripts/
+source.. = src/
diff --git a/bundles/org.eclipse.test.performance.ui/performanceui.jar b/bundles/org.eclipse.test.performance.ui/performanceui.jar
deleted file mode 100644
index 05f8f96..0000000
--- a/bundles/org.eclipse.test.performance.ui/performanceui.jar
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.test.performance.ui/performanceui.jardesc b/bundles/org.eclipse.test.performance.ui/performanceui.jardescORIG
similarity index 100%
rename from bundles/org.eclipse.test.performance.ui/performanceui.jardesc
rename to bundles/org.eclipse.test.performance.ui/performanceui.jardescORIG
diff --git a/bundles/org.eclipse.test.performance.ui/plugin.properties b/bundles/org.eclipse.test.performance.ui/plugin.properties
index 0bff5d4..428e63a 100644
--- a/bundles/org.eclipse.test.performance.ui/plugin.properties
+++ b/bundles/org.eclipse.test.performance.ui/plugin.properties
@@ -9,7 +9,7 @@
 #     IBM Corporation - initial API and implementation
 ###############################################################################
 Bundle-Name= Ui Performance Test Framework Plug-in
-Bundle-Vendor= Eclipse.org
+Bundle-Vendor= Eclipse Releng
 
 page.name = Performances
 category.name = Performances
diff --git a/bundles/org.eclipse.test.performance.ui/plugin.xml b/bundles/org.eclipse.test.performance.ui/plugin.xml
index 1f55401..b67bc04 100644
--- a/bundles/org.eclipse.test.performance.ui/plugin.xml
+++ b/bundles/org.eclipse.test.performance.ui/plugin.xml
@@ -30,21 +30,21 @@
       <view
             category="Performances"
             class="org.eclipse.test.internal.performance.results.ui.ComponentsView"
-            icon="icons/components.gif"
+            icon="$nl$/icons/components.gif"
             id="org.eclipse.test.internal.performance.results.ui.ComponentsView"
             name="%view.name">
       </view>
       <view
             category="Performances"
             class="org.eclipse.test.internal.performance.results.ui.BuildsView"
-            icon="icons/builds.gif"
+            icon="$nl$/icons/builds.gif"
             id="org.eclipse.test.internal.performance.results.ui.BuildsView"
             name="%view.name.0">
       </view>
       <view
             category="Performances"
             class="org.eclipse.test.internal.performance.results.ui.ComponentResultsView"
-            icon="icons/results.gif"
+            icon="$nl$/icons/results.gif"
             id="org.eclipse.test.internal.performance.results.ui.ComponentsResultsView"
             name="%view.name.1"
             restorable="true">
@@ -52,7 +52,7 @@
       <view
             category="Performances"
             class="org.eclipse.test.internal.performance.results.ui.BuildsComparisonView"
-            icon="icons/compare_view.gif"
+            icon="$nl$/icons/compare_view.gif"
             id="org.eclipse.test.internal.performance.results.ui.BuildsComparisonView"
             name="%view.name.2"
             restorable="true">
@@ -68,7 +68,7 @@
          point="org.eclipse.ui.perspectives">
       <perspective
             class="org.eclipse.test.internal.performance.results.ui.PerformanceResultsPerspective"
-            icon="icons/perfs.gif"
+            icon="$nl$/icons/perfs.gif"
             id="org.eclipse.test.performance.ui.perspectives.PerformanceResultsPerspective"
             name="%perspective.name">
          <description>
diff --git a/bundles/org.eclipse.test.performance.ui/pom.xml b/bundles/org.eclipse.test.performance.ui/pom.xml
index b39dec7..25b05f0 100644
--- a/bundles/org.eclipse.test.performance.ui/pom.xml
+++ b/bundles/org.eclipse.test.performance.ui/pom.xml
@@ -12,6 +12,6 @@
     </parent>
     <groupId>org.eclipse.platform</groupId>
     <artifactId>org.eclipse.test.performance.ui</artifactId>
-    <version>3.8.0-SNAPSHOT</version>
+    <version>3.9.0-SNAPSHOT</version>
     <packaging>eclipse-plugin</packaging>
 </project>
diff --git a/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/internal/performance/results/db/AbstractResults.java b/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/internal/performance/results/db/AbstractResults.java
index 679bf42..e0a65b6 100644
--- a/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/internal/performance/results/db/AbstractResults.java
+++ b/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/internal/performance/results/db/AbstractResults.java
@@ -35,12 +35,15 @@
 	public static final int BASELINE_ERROR_INDEX = 5;
 	public static final int NUMBERS_LENGTH = 6;
 
+	public static final boolean DO_NOT_WRITE_DATA = false;
+	
 	AbstractResults parent;
 	int id = -1;
 	String name;
 	List children;
 	private static boolean NEW_LINE = true;
 	PrintStream printStream = null;
+    protected String baselinePrefix;
 
 AbstractResults(AbstractResults parent, String name) {
 	this.parent = parent;
diff --git a/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/internal/performance/results/db/BuildResults.java b/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/internal/performance/results/db/BuildResults.java
index 21e3021..ff6788b 100644
--- a/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/internal/performance/results/db/BuildResults.java
+++ b/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/internal/performance/results/db/BuildResults.java
@@ -8,6 +8,7 @@
  * Contributors:
  *     IBM Corporation - initial API and implementation
  *******************************************************************************/
+
 package org.eclipse.test.internal.performance.results.db;
 
 import java.io.DataInputStream;
@@ -27,562 +28,574 @@
  */
 public class BuildResults extends AbstractResults {
 
-	private static final double IMPOSSIBLE_VALUE = -1E6;
+    private static final double IMPOSSIBLE_VALUE = -1E6;
 
-	// Build information
-	String date;
-	String comment;
-	int summaryKind = -1;
+    // Build information
+    String                      date;
+    String                      comment;
+    int                         summaryKind      = -1;
 
-	// Dimensions information
-	Dim[] dimensions;
-	double[] average, stddev;
-	long[] count;
-	double[][] values;
-	boolean hadValues = false;
-	private int defaultDimIndex = -1;
+    // Dimensions information
+    Dim[]                       dimensions;
+    double[]                    average, stddev;
+    long[]                      count;
+    double[][]                  values;
+    boolean                     hadValues        = false;
+    private int                 defaultDimIndex  = -1;
 
-	// Comparison information
-	boolean baseline;
-	String failure;
+    // Comparison information
+    boolean                     baseline;
+    String                      failure;
 
-BuildResults(AbstractResults parent) {
-	super(parent, -1);
-}
+    BuildResults(AbstractResults parent) {
+        super(parent, -1);
+    }
 
-BuildResults(AbstractResults parent, int id) {
-	super(parent, id);
-	this.name = DB_Results.getBuildName(id);
-	this.baseline = this.name.startsWith(DB_Results.getDbBaselinePrefix());
-}
+    BuildResults(AbstractResults parent, int id) {
+        super(parent, id);
+        this.name = DB_Results.getBuildName(id);
+        this.baseline = this.name.startsWith(DB_Results.getDbBaselinePrefix());
+    }
 
-/*
- * Clean values when several measures has been done for the same build.
- */
-void cleanValues() {
-	int length = this.values.length;
-	for (int dim_id=0; dim_id<length; dim_id++) {
-		int vLength = this.values[dim_id].length;
+    /*
+     * Clean values when several measures has been done for the same build.
+     */
+    void cleanValues() {
+        int length = this.values.length;
+        for (int dim_id = 0; dim_id < length; dim_id++) {
+            int vLength = this.values[dim_id].length;
 		/* Log clean operation
 		if (dim_id == 0) {
 			IStatus status = new Status(IStatus.WARNING, PerformanceTestPlugin.PLUGIN_ID, "Clean "+vLength+" values for "+this.parent+">"+this.name+" ("+this.count[dim_id]+" measures)...");    //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$//$NON-NLS-4$ //$NON-NLS-5$
 			PerformanceTestPlugin.log(status);
 		}
-		*/
-		this.average[dim_id] = 0;
-		for (int i=0; i<vLength; i++) {
-			this.average[dim_id] += this.values[dim_id][i];
-		}
-		this.average[dim_id] /= vLength;
-		double squaredDeviations= 0;
-		for (int i=0; i<vLength; i++) {
-		    double deviation= this.average[dim_id] - this.values[dim_id][i];
-		    squaredDeviations += deviation * deviation;
-		}
+             */
+            this.average[dim_id] = 0;
+            for (int i = 0; i < vLength; i++) {
+                this.average[dim_id] += this.values[dim_id][i];
+            }
+            this.average[dim_id] /= vLength;
+            double squaredDeviations = 0;
+            for (int i = 0; i < vLength; i++) {
+                double deviation = this.average[dim_id] - this.values[dim_id][i];
+                squaredDeviations += deviation * deviation;
+            }
 		this.stddev[dim_id] = Math.sqrt(squaredDeviations / (this.count[dim_id] - 1)); // unbiased sample stdev
-		this.values[dim_id] = null;
-	}
-	for (int i=0; i<length; i++) {
-		if (this.values[i] != null) {
-			return;
-		}
-	}
-	this.values = null;
-	this.hadValues = true;
-}
+            this.values[dim_id] = null;
+        }
+        for (int i = 0; i < length; i++) {
+            if (this.values[i] != null) {
+                return;
+            }
+        }
+        this.values = null;
+        this.hadValues = true;
+    }
 
-/**
- * Compare build results using the date of the build.
- *
- * @see Comparable#compareTo(Object)
- */
-public int compareTo(Object obj) {
-	if (obj instanceof BuildResults) {
-		BuildResults res = (BuildResults) obj;
-		return getDate().compareTo(res.getDate());
-	}
-	return -1;
-}
+    /**
+     * Compare build results using the date of the build.
+     *
+     * @see Comparable#compareTo(Object)
+     */
+    public int compareTo(Object obj) {
+        if (obj instanceof BuildResults) {
+            BuildResults res = (BuildResults) obj;
+            return getDate().compareTo(res.getDate());
+        }
+        return -1;
+    }
 
-/**
- * Returns the most recent baseline build results.
- *
- * @return The {@link BuildResults baseline build results}.
- * @see BuildResults
- */
-public BuildResults getBaselineBuildResults() {
-	return ((ConfigResults)this.parent).getBaselineBuildResults();
-}
+    /**
+     * Returns the most recent baseline build results.
+     *
+     * @return The {@link BuildResults baseline build results}.
+     * @see BuildResults
+     */
+    public BuildResults getBaselineBuildResults() {
+        return ((ConfigResults) this.parent).getBaselineBuildResults();
+    }
 
-/**
- * Returns the comment associated with the scenario for the current build.
- *
+    /**
+     * Returns the comment associated with the scenario for the current build.
+     *
  * @return The comment associated with the scenario for the current build
  * 	or <code>null</code> if no comment was stored for it.
- */
-public String getComment() {
-	return this.comment;
-}
+     */
+    public String getComment() {
+        return this.comment;
+    }
 
-/**
- * Return the number of stored values for the default dimension
- *
- * @return the number of stored values for the default dimension
- */
-public long getCount() {
-	if (this.defaultDimIndex < 0) {
-		this.defaultDimIndex = DB_Results.getDefaultDimensionIndex();
-	}
-	return this.count[this.defaultDimIndex];
-}
+    /**
+     * Return the number of stored values for the default dimension
+     *
+     * @return the number of stored values for the default dimension
+     */
+    public long getCount() {
+        if (this.defaultDimIndex < 0) {
+            this.defaultDimIndex = DB_Results.getDefaultDimensionIndex();
+        }
+        return this.count[this.defaultDimIndex];
+    }
 
-/**
- * Return the number of stored values for the given dimension.
- *
+    /**
+     * Return the number of stored values for the given dimension.
+     *
  * @param dim_id The id of the dimension (see {@link Dim#getId()})
- * @return the number of stored values for the given dimension
- *
- */
-public long getCount(int dim_id) {
-	return this.count[getDimIndex(dim_id)];
-}
+     * @return the number of stored values for the given dimension
+     *
+     */
+    public long getCount(int dim_id) {
+        return this.count[getDimIndex(dim_id)];
+    }
 
-/**
- * Returns the date of the build which is a part of its name.
- *
- * @return The date of the build as yyyyMMddHHmm
- */
-public String getDate() {
-	if (this.date == null) {
-		if (this.baseline) {
-			int length = this.name.length();
-			this.date = this.name.substring(length-12, length);
-		} else {
-			char first = this.name.charAt(0);
+    /**
+     * Returns the date of the build which is a part of its name.
+     *
+     * @return The date of the build as yyyyMMddHHmm
+     */
+    public String getDate() {
+        if (this.date == null) {
+            if (this.baseline) {
+                int length = this.name.length();
+                this.date = this.name.substring(length - 12, length);
+            } else {
+                char first = this.name.charAt(0);
 			if (first == 'N' || first == 'I' || first == 'M') { // TODO (frederic) should be buildIdPrefixes...
-				if (this.name.length() == 14) {
-					this.date = this.name.substring(1, 9)+this.name.substring(10, 14);
-				} else {
-					this.date = this.name.substring(1);
-				}
-			} else {
-				int length = this.name.length() - 12 /* length of date */;
-				for (int i=0; i<=length; i++) {
-					try {
-						String substring = i == 0 ? this.name : this.name.substring(i);
-						Util.DATE_FORMAT.parse(substring);
+                    if (this.name.length() == 14) {
+                        this.date = this.name.substring(1, 9) + this.name.substring(10, 14);
+                    } else {
+                        this.date = this.name.substring(1);
+                    }
+                } else {
+                    int length = this.name.length() - 12 /* length of date */;
+                    for (int i = 0; i <= length; i++) {
+                        try {
+                            String substring = i == 0 ? this.name : this.name.substring(i);
+                            Util.DATE_FORMAT.parse(substring);
 						this.date = substring; // if no exception is raised then the substring has a correct date format => store it
-						break;
+                            break;
 					} catch(ParseException ex) {
-						// skip
-					}
-				}
-			}
-		}
-	}
-	return this.date;
-}
+                            // skip
+                        }
+                    }
+                }
+            }
+        }
+        return this.date;
+    }
 
-/**
+    /**
  * Returns the standard deviation of the default dimension computed
  * while running the scenario for the current build.
- *
- * @return The value of the standard deviation
- */
-public double getDeviation() {
-	if (this.defaultDimIndex < 0) {
-		this.defaultDimIndex = DB_Results.getDefaultDimensionIndex();
-	}
-	return this.stddev[this.defaultDimIndex];
-}
+     *
+     * @return The value of the standard deviation
+     */
+    public double getDeviation() {
+        if (this.defaultDimIndex < 0) {
+            this.defaultDimIndex = DB_Results.getDefaultDimensionIndex();
+        }
+        return this.stddev[this.defaultDimIndex];
+    }
 
-/**
+    /**
  * Returns the standard deviation of the given dimension computed
  * while running the scenario for the current build.
- *
+     *
  * @param dim_id The id of the dimension (see {@link Dim#getId()})
- * @return The value of the standard deviation
- */
-public double getDeviation(int dim_id) {
-	final int dimIndex = getDimIndex(dim_id);
-	return dimIndex < 0 ? 0 : this.stddev[dimIndex];
-}
+     * @return The value of the standard deviation
+     */
+    public double getDeviation(int dim_id) {
+        final int dimIndex = getDimIndex(dim_id);
+        return dimIndex < 0 ? 0 : this.stddev[dimIndex];
+    }
 
-/**
- * Returns the dimensions supported for the current build.
- *
- * @return An array of dimensions.
- */
-public Dim[] getDimensions() {
-	return this.dimensions;
-}
+    /**
+     * Returns the dimensions supported for the current build.
+     *
+     * @return An array of dimensions.
+     */
+    public Dim[] getDimensions() {
+        return this.dimensions;
+    }
 
-/**
- * Returns the kind of summary for the scenario of the current build.
- *
+    /**
+     * Returns the kind of summary for the scenario of the current build.
+     *
  * @return -1 if the scenario has no summary, 1 if it's a global summary, 0 otherwise.
- */
-public int getSummaryKind() {
-	return this.summaryKind;
-}
+     */
+    public int getSummaryKind() {
+        return this.summaryKind;
+    }
 
-/**
- * Returns whether the current build had several values stored in database.
- *
- * @return <code>true</code> if the measure was committed several times,
- * <code>false</code> otherwise.
- */
-public boolean hadValues() {
-	return this.hadValues;
-}
+    /**
+     * Returns whether the current build had several values stored in database.
+     *
+     * @return <code>true</code> if the measure was committed several times,
+     *         <code>false</code> otherwise.
+     */
+    public boolean hadValues() {
+        return this.hadValues;
+    }
 
-/*
+    /*
  * Return the index of the dimension corresponding to the given
  * dimension id (see {@link Dim#getId()})
- */
-int getDimIndex(int dim_id) {
+     */
+    int getDimIndex(int dim_id) {
 	if (this.dimensions == null) return -1;
-	int length = this.dimensions.length;
-	for (int i=0; i<length; i++) {
+        int length = this.dimensions.length;
+        for (int i = 0; i < length; i++) {
 		if (this.dimensions[i] == null) break;
-		if (this.dimensions[i].getId() == dim_id) {
-			return i;
-		}
-	}
-	return -1;
-}
+            if (this.dimensions[i].getId() == dim_id) {
+                return i;
+            }
+        }
+        return -1;
+    }
 
-/**
- * Return the error computed while storing values for the default dimension
- *
- * @return the error of the measures stored for the default dimension
- */
-public double getError() {
-	long n = getCount();
+    /**
+     * Return the error computed while storing values for the default dimension
+     *
+     * @return the error of the measures stored for the default dimension
+     */
+    public double getError() {
+        long n = getCount();
 	if (n == 1) return Double.NaN;
-	return getDeviation() / Math.sqrt(n);
-}
+        return getDeviation() / Math.sqrt(n);
+    }
 
-/**
- * Return the error computed while storing values for the given dimension.
- *
+    /**
+     * Return the error computed while storing values for the given dimension.
+     *
  * @param dim_id The id of the dimension (see {@link Dim#getId()})
- * @return the error of the measures stored for the given dimension
- */
-public double getError(int dim_id) {
-	long n = getCount(dim_id);
+     * @return the error of the measures stored for the given dimension
+     */
+    public double getError(int dim_id) {
+        long n = getCount(dim_id);
 	if (n == 1) return Double.NaN;
-	return getDeviation(dim_id) / Math.sqrt(n);
-}
+        return getDeviation(dim_id) / Math.sqrt(n);
+    }
 
-/**
+    /**
  * Return the failure message which may happened on this scenario
  * while running the current build
- *
- * @return The failure message or <code>null</null> if the scenario passed.
- */
-public String getFailure() {
-	return this.failure;
-}
+     *
+     * @return The failure message or <code>null</null> if the scenario passed.
+     */
+    public String getFailure() {
+        return this.failure;
+    }
 
-/**
+    /**
  * Return the value of the performance result stored
  * for the given dimension of the current build.
- *
+     *
  * @param dim_id The id of the dimension (see {@link Dim#getId()})
- * @return The value of the performance result
- */
-public double getValue(int dim_id) {
-	int idx = getDimIndex(dim_id);
+     * @return The value of the performance result
+     */
+    public double getValue(int dim_id) {
+        int idx = getDimIndex(dim_id);
 	if (idx < 0) return Double.NaN;
-	return this.average[idx];
-}
+        return this.average[idx];
+    }
 
-/**
+    /**
  * Return the value of the performance result stored
  * for the default dimension of the current build.
- *
- * @return The value of the performance result
- */
-public double getValue() {
-	if (this.defaultDimIndex < 0) {
-		this.defaultDimIndex = DB_Results.getDefaultDimensionIndex();
-	}
-	return this.average[this.defaultDimIndex];
-}
+     *
+     * @return The value of the performance result
+     */
+    public double getValue() {
+        if (this.defaultDimIndex < 0) {
+            this.defaultDimIndex = DB_Results.getDefaultDimensionIndex();
+        }
+        return this.average[this.defaultDimIndex];
+    }
 
-/**
- * Returns whether the build is a baseline build or not.
- *
+    /**
+     * Returns whether the build is a baseline build or not.
+     *
  * @return <code>true</code> if the build name starts with the baseline prefix
  * 	(see {@link PerformanceResults#getBaselinePrefix()} or <code>false</code>
  * 	otherwise.
- */
-public boolean isBaseline() {
-	return this.baseline;
-}
+     */
+    public boolean isBaseline() {
+        return this.baseline;
+    }
 
-/**
+    /**
  * Returns whether the build has a summary or not. Note that the summary
  * may be global or not.
- *
- * @return <code>true</code> if the summary kind is equals to 0 or 1
- * 	<code>false</code> otherwise.
- */
-public boolean hasSummary() {
-	return this.summaryKind >= 0;
-}
-/**
- * Returns whether the build has a global summary or not.
- *
- * @return <code>true</code> if the summary kind is equals to 1
- * 	<code>false</code> otherwise.
- */
-public boolean hasGlobalSummary() {
-	return this.summaryKind == 1;
-}
+     *
+     * @return <code>true</code> if the summary kind is equals to 0 or 1
+     *         <code>false</code> otherwise.
+     */
+    public boolean hasSummary() {
+        return this.summaryKind >= 0;
+    }
 
-/*
- * Returns a given pattern match the build name or not.
- */
-boolean match(String pattern) {
+    /**
+     * Returns whether the build has a global summary or not.
+     *
+     * @return <code>true</code> if the summary kind is equals to 1
+     *         <code>false</code> otherwise.
+     */
+    public boolean hasGlobalSummary() {
+        return this.summaryKind == 1;
+    }
+
+    /*
+     * Returns a given pattern match the build name or not.
+     */
+    boolean match(String pattern) {
 	if (pattern.equals("*")) return true; //$NON-NLS-1$
-	if (pattern.indexOf('*') < 0 && pattern.indexOf('?') < 0) {
-		pattern += "*"; //$NON-NLS-1$
-	}
-	StringTokenizer tokenizer = new StringTokenizer(pattern, "*?", true); //$NON-NLS-1$
-	int start = 0;
-	String previous = ""; //$NON-NLS-1$
-	while (tokenizer.hasMoreTokens()) {
-		String token = tokenizer.nextToken();
-		if (!token.equals("*") && !token.equals("?")) { //$NON-NLS-1$ //$NON-NLS-2$
-			if (previous.equals("*")) { //$NON-NLS-1$
-				int idx = this.name.substring(start).indexOf(token);
+        if (pattern.indexOf('*') < 0 && pattern.indexOf('?') < 0) {
+            pattern += "*"; //$NON-NLS-1$
+        }
+        StringTokenizer tokenizer = new StringTokenizer(pattern, "*?", true); //$NON-NLS-1$
+        int start = 0;
+        String previous = ""; //$NON-NLS-1$
+        while (tokenizer.hasMoreTokens()) {
+            String token = tokenizer.nextToken();
+            if (!token.equals("*") && !token.equals("?")) { //$NON-NLS-1$ //$NON-NLS-2$
+                if (previous.equals("*")) { //$NON-NLS-1$
+                    int idx = this.name.substring(start).indexOf(token);
 				if (idx < 0) return false;
-				start += idx;
-			} else {
+                    start += idx;
+                } else {
 				if (previous.equals("?")) start++; //$NON-NLS-1$
 				if (!this.name.substring(start).startsWith(token)) return false;
-			}
-			start += token.length();
-		}
-		previous = token;
-	}
-	if (previous.equals("*")) { //$NON-NLS-1$
-		return true;
-	} else if (previous.equals("?")) { //$NON-NLS-1$
-		return this.name.length() == start;
-	}
-	return this.name.endsWith(previous);
-}
+                }
+                start += token.length();
+            }
+            previous = token;
+        }
+        if (previous.equals("*")) { //$NON-NLS-1$
+            return true;
+        } else if (previous.equals("?")) { //$NON-NLS-1$
+            return this.name.length() == start;
+        }
+        return this.name.endsWith(previous);
+    }
 
-/*
- * Read the build results data from the given stream.
- */
-void readData(DataInputStream stream) throws IOException {
-	long timeBuild = stream.readLong();
-	this.date = new Long(timeBuild).toString();
-	byte kind = stream.readByte();
-	this.baseline = kind == 0;
-	if (this.baseline) {
-		this.name = getPerformance().baselinePrefix + '_' + this.date;
-	} else {
-		String suffix = this.date.substring(0, 8) + '-' + this.date.substring(8);
-		switch (kind) {
-			case 1:
-				this.name = "N" + suffix; //$NON-NLS-1$
-				break;
-			case 2:
-				this.name = "I" + suffix; //$NON-NLS-1$
-				break;
-			case 3:
-				this.name = "M" + suffix; //$NON-NLS-1$
-				break;
-			default:
-				this.name = stream.readUTF();
-				break;
-		}
-	}
-	int length = stream.readInt();
-	this.dimensions = new Dim[length];
-	this.average = new double[length];
-	this.stddev = new double[length];
-	this.count = new long[length];
-	for (int i=0; i<length; i++) {
-		int dimId = stream.readInt();
-		DB_Results.storeDimension(dimId);
-		this.dimensions[i] = (Dim) PerformanceTestPlugin.getDimension(dimId);
-		this.average[i] = stream.readLong();
-		this.count[i] = stream.readLong();
-		this.stddev[i] = stream.readDouble();
-	}
-	this.id = DB_Results.getBuildId(this.name);
+    /*
+     * Read the build results data from the given stream.
+     */
+    void readData(DataInputStream stream) throws IOException {
+        long timeBuild = stream.readLong();
+        this.date = new Long(timeBuild).toString();
+        byte kind = stream.readByte();
+        this.baseline = kind == 0;
+        if (this.baseline) {
+		this.name = getPerformance().baselinePrefix + '-' + this.date;
+        } else {
+            String suffix = this.date.substring(0, 8) + '-' + this.date.substring(8);
+            switch (kind) {
+                case 1:
+                    this.name = "N" + suffix; //$NON-NLS-1$
+                    break;
+                case 2:
+                    this.name = "I" + suffix; //$NON-NLS-1$
+                    break;
+                case 3:
+                    this.name = "M" + suffix; //$NON-NLS-1$
+                    break;
+                default:
+                    this.name = stream.readUTF();
+                    break;
+            }
+        }
+        int length = stream.readInt();
+        this.dimensions = new Dim[length];
+        this.average = new double[length];
+        this.stddev = new double[length];
+        this.count = new long[length];
+        for (int i = 0; i < length; i++) {
+            int dimId = stream.readInt();
+            DB_Results.storeDimension(dimId);
+            this.dimensions[i] = (Dim) PerformanceTestPlugin.getDimension(dimId);
+            this.average[i] = stream.readLong();
+            this.count[i] = stream.readLong();
+            this.stddev[i] = stream.readDouble();
+        }
+        this.id = DB_Results.getBuildId(this.name);
 
-	// read summary
-	this.summaryKind = stream.readInt();
+        // read summary
+        this.summaryKind = stream.readInt();
 
-	// read comment
-	String str = stream.readUTF();
-	if (str.length() > 0) {
-		this.comment = str;
-	}
-}
+        // read comment
+        String str = stream.readUTF();
+        if (str.length() > 0) {
+            this.comment = str;
+        }
+    }
 
-/*
- * Set the build summary and its associated comment.
- */
-void setComment(String comment) {
-	if (comment != null && this.comment == null) {
-		this.comment = comment;
-	}
-}
+    /*
+     * Set the build summary and its associated comment.
+     */
+    void setComment(String comment) {
+        if (comment != null && this.comment == null) {
+            this.comment = comment;
+        }
+    }
 
-/*
- * Set the build summary and its associated comment.
- */
-void setSummary(int kind, String comment) {
-	this.comment = comment;
-	this.summaryKind = kind;
-}
+    /*
+     * Set the build summary and its associated comment.
+     */
+    void setSummary(int kind, String comment) {
+        this.comment = comment;
+        this.summaryKind = kind;
+    }
 
-/*
- * Set the build failure.
- */
-void setFailure(String failure) {
-	this.failure = failure;
-}
+    /*
+     * Set the build failure.
+     */
+    void setFailure(String failure) {
+        this.failure = failure;
+    }
 
-/*
- * Set the build value from database information.
- */
-void setValue(int dim_id, int step, long value) {
-	int length = DB_Results.getDimensions().length;
-	Dim dimension = (Dim) PerformanceTestPlugin.getDimension(dim_id);
-	int idx = 0;
-	if (this.dimensions == null){
-		this.dimensions = new Dim[length];
-		this.average = new double[length];
-		this.stddev = new double[length];
-		this.count = new long[length];
-		this.dimensions[0] = dimension;
-		for (int i=0; i<length; i++) {
-			// init average numbers with an impossible value
-			// to clearly identify whether it's already set or not
-			// when several measures are made for the same build
-			this.average[i] = IMPOSSIBLE_VALUE;
-		}
-	} else {
-		length = this.dimensions.length;
-		for (int i=0; i<length; i++) {
-			if (this.dimensions[i] == null) {
-				this.dimensions[i] = dimension;
-				idx = i;
-				break;
-			}
-			if (this.dimensions[i].getId() == dim_id) {
-				idx = i;
-				break;
-			}
-		}
-	}
-	switch (step) {
-		case InternalPerformanceMeter.AVERAGE:
-			if (this.average[idx] != IMPOSSIBLE_VALUE) {
-				if (this.values == null) {
-					this.values = new double[length][];
-					this.values[idx] = new double[2];
-					this.values[idx][0] = this.average[idx];
-					this.values[idx][1] = value;
-					this.average[idx] = IMPOSSIBLE_VALUE;
-				} else if (this.values[idx] == null) {
-					this.values[idx] = new double[2];
-					this.values[idx][0] = this.average[idx];
-					this.values[idx][1] = value;
-					this.average[idx] = IMPOSSIBLE_VALUE;
-				}
-			} else if (this.values != null && this.values[idx] != null) {
-				int vLength = this.values[idx].length;
-				System.arraycopy(this.values[idx], 0, this.values[idx] = new double[vLength+1], 0, vLength);
-				this.values[idx][vLength] = value;
-			} else {
-				this.average[idx] = value;
-			}
-			break;
-		case InternalPerformanceMeter.STDEV:
-			this.stddev[idx] += Double.longBitsToDouble(value);
-			break;
-		case InternalPerformanceMeter.SIZE:
-			this.count[idx] += value;
-			break;
-	}
-}
+    /*
+     * Set the build value from database information.
+     */
+    void setValue(int dim_id, int step, long value) {
+        int length = DB_Results.getDimensions().length;
+        Dim dimension = (Dim) PerformanceTestPlugin.getDimension(dim_id);
+        int idx = 0;
+        if (this.dimensions == null) {
+            this.dimensions = new Dim[length];
+            this.average = new double[length];
+            this.stddev = new double[length];
+            this.count = new long[length];
+            this.dimensions[0] = dimension;
+            for (int i = 0; i < length; i++) {
+                // init average numbers with an impossible value
+                // to clearly identify whether it's already set or not
+                // when several measures are made for the same build
+                this.average[i] = IMPOSSIBLE_VALUE;
+            }
+        } else {
+            length = this.dimensions.length;
+            for (int i = 0; i < length; i++) {
+                if (this.dimensions[i] == null) {
+                    this.dimensions[i] = dimension;
+                    idx = i;
+                    break;
+                }
+                if (this.dimensions[i].getId() == dim_id) {
+                    idx = i;
+                    break;
+                }
+            }
+        }
+        switch (step) {
+            case InternalPerformanceMeter.AVERAGE:
+                if (this.average[idx] != IMPOSSIBLE_VALUE) {
+                    if (this.values == null) {
+                        this.values = new double[length][];
+                        this.values[idx] = new double[2];
+                        this.values[idx][0] = this.average[idx];
+                        this.values[idx][1] = value;
+                        this.average[idx] = IMPOSSIBLE_VALUE;
+                    } else if (this.values[idx] == null) {
+                        this.values[idx] = new double[2];
+                        this.values[idx][0] = this.average[idx];
+                        this.values[idx][1] = value;
+                        this.average[idx] = IMPOSSIBLE_VALUE;
+                    }
+                } else if (this.values != null && this.values[idx] != null) {
+                    int vLength = this.values[idx].length;
+                    System.arraycopy(this.values[idx], 0, this.values[idx] = new double[vLength + 1], 0, vLength);
+                    this.values[idx][vLength] = value;
+                } else {
+                    this.average[idx] = value;
+                }
+                break;
+            case InternalPerformanceMeter.STDEV:
+                this.stddev[idx] += Double.longBitsToDouble(value);
+                break;
+            case InternalPerformanceMeter.SIZE:
+                this.count[idx] += value;
+                break;
+        }
+    }
 
 /* (non-Javadoc)
  * @see org.eclipse.test.internal.performance.results.AbstractResults#toString()
- */
-public String toString() {
-	StringBuffer buffer = new StringBuffer(this.name);
-	buffer.append(": "); //$NON-NLS-1$
-	int length = this.dimensions.length;
-	for (int i=0; i<length; i++) {
+     */
+    public String toString() {
+        StringBuffer buffer = new StringBuffer(this.name);
+        buffer.append(": "); //$NON-NLS-1$
+        int length = this.dimensions.length;
+        for (int i = 0; i < length; i++) {
 		if (i>0)	buffer.append(", "); //$NON-NLS-1$
-		buffer.append('[');
-		buffer.append(this.dimensions[i].getId());
-		buffer.append("]="); //$NON-NLS-1$
-		buffer.append(this.average[i]);
-		buffer.append('/');
-		buffer.append(this.count[i]);
-		buffer.append('/');
-		buffer.append(Math.round(this.stddev[i]*1000)/1000.0);
-	}
-	return buffer.toString();
-}
-
-/*
- * Write the build results data in the given stream.
- */
-void write(DataOutputStream stream) throws IOException {
-	long timeBuild = -1;
-    try {
-	    timeBuild = Long.parseLong(getDate());
-    } catch (NumberFormatException nfe) {
-	    // do nothing
-    	nfe.printStackTrace();
+            buffer.append('[');
+            buffer.append(this.dimensions[i].getId());
+            buffer.append("]="); //$NON-NLS-1$
+            buffer.append(this.average[i]);
+            buffer.append('/');
+            buffer.append(this.count[i]);
+            buffer.append('/');
+            buffer.append(Math.round(this.stddev[i] * 1000) / 1000.0);
+        }
+        return buffer.toString();
     }
-	stream.writeLong(timeBuild);
-	byte kind = 0; // baseline
-	if (!this.baseline) {
-		switch (this.name.charAt(0)) {
-			case 'N':
-				kind = 1;
-				break;
-			case 'I':
-				kind = 2;
-				break;
-			case 'M':
-				kind = 3;
-				break;
-			default:
-				kind = 4;
-				break;
-		}
-	}
-	stream.writeByte(kind);
-	if (kind == 4) {
-		stream.writeUTF(this.name);
-	}
-	int length = this.dimensions == null ? 0 : this.dimensions.length;
-	stream.writeInt(length);
-	for (int i=0; i<length; i++) {
-		stream.writeInt(this.dimensions[i].getId());
-		stream.writeLong((long)this.average[i]) ;
-		stream.writeLong(this.count[i]);
-		stream.writeDouble(this.stddev[i]);
-	}
 
-	// Write extra infos (summary, failure and comment)
-	stream.writeInt(this.summaryKind);
-	stream.writeUTF(this.comment == null ? "" : this.comment) ; //$NON-NLS-1$
-}
+    /*
+     * Write the build results data in the given stream.
+     */
+    void write(DataOutputStream stream) throws IOException {
+        if (DO_NOT_WRITE_DATA) {
+            return;
+        }
+        boolean okToWrite = true;
+        long timeBuild = -1;
+        String dateFound = null;
+        try {
+            dateFound = getDate();
+            timeBuild = Long.parseLong(dateFound);
+        }
+        catch (NumberFormatException nfe) {
+            // do nothing, but do not write bad data.
+            // nfe.printStackTrace();
+            System.out.println("ERROR: Found number format exception converting date. Date: >"+ dateFound +"<." + "Could be corrupt data in DB?");
+            okToWrite = false;
+        }
+        if (okToWrite) {
+            stream.writeLong(timeBuild);
+            byte kind = 0; // baseline
+            if (!this.baseline) {
+                switch (this.name.charAt(0)) {
+                    case 'N':
+                        kind = 1;
+                        break;
+                    case 'I':
+                        kind = 2;
+                        break;
+                    case 'M':
+                        kind = 3;
+                        break;
+                    default:
+                        kind = 4;
+                        break;
+                }
+            }
+            stream.writeByte(kind);
+            if (kind == 4) {
+                stream.writeUTF(this.name);
+            }
+            int length = this.dimensions == null ? 0 : this.dimensions.length;
+            stream.writeInt(length);
+            for (int i = 0; i < length; i++) {
+                stream.writeInt(this.dimensions[i].getId());
+                stream.writeLong((long) this.average[i]);
+                stream.writeLong(this.count[i]);
+                stream.writeDouble(this.stddev[i]);
+            }
+
+            // Write extra infos (summary, failure and comment)
+            stream.writeInt(this.summaryKind);
+            stream.writeUTF(this.comment == null ? "" : this.comment); //$NON-NLS-1$
+        }
+    }
 
 }
diff --git a/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/internal/performance/results/db/ComponentResults.java b/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/internal/performance/results/db/ComponentResults.java
index 4e0bc19..8754b76 100644
--- a/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/internal/performance/results/db/ComponentResults.java
+++ b/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/internal/performance/results/db/ComponentResults.java
@@ -39,7 +39,7 @@
  */
 public class ComponentResults extends AbstractResults {
 
-public ComponentResults(AbstractResults parent, String name) {
+    public ComponentResults(AbstractResults parent, String name) {
 	super(parent, name);
 	this.printStream = parent.printStream;
 }
@@ -402,6 +402,9 @@
  * Write the component results data to the file '<component name>.dat' in the given directory.
  */
 void writeData(String buildName, File dir, boolean temp, boolean dirty) {
+    if (DO_NOT_WRITE_DATA) {
+        return;
+    }
 //	if (!dir.exists() && !dir.mkdirs()) {
 //		System.err.println("can't create directory "+dir); //$NON-NLS-1$
 //	}
diff --git a/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/internal/performance/results/db/ConfigResults.java b/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/internal/performance/results/db/ConfigResults.java
index 46225a0..a3de5ea 100644
--- a/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/internal/performance/results/db/ConfigResults.java
+++ b/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/internal/performance/results/db/ConfigResults.java
@@ -651,6 +651,9 @@
  * Write all configuration builds results data into the given stream.
  */
 void write(DataOutputStream stream) throws IOException {
+    if (DO_NOT_WRITE_DATA) {
+        return;
+    }
 	int size = size();
 	stream.writeInt(this.id);
 	stream.writeInt(size);
diff --git a/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/internal/performance/results/db/DB_Results.java b/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/internal/performance/results/db/DB_Results.java
index 8a7d9b5..101c2bb 100644
--- a/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/internal/performance/results/db/DB_Results.java
+++ b/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/internal/performance/results/db/DB_Results.java
@@ -41,11 +41,13 @@
 public class DB_Results {
 
 
-	private static final String DEFAULT_DB_BASELINE_PREFIX = "R-";
+    // This doesn't seem good (was just R-, instead of using what we pass in)
+	private static final String DEFAULT_DB_BASELINE_PREFIX = "R-4.5";
+	
 	private static final Dim[] NO_DIMENSION = new Dim[0];
 	private static final String[] EMPTY_LIST = new String[0];
-	static final boolean DEBUG = false;
-    static final boolean LOG = false;
+	static final boolean DEBUG = true;
+    static final boolean LOG = true;
 
     // the two supported DB types
     private static final String DERBY= "derby"; //$NON-NLS-1$
@@ -170,12 +172,13 @@
 			((databaseLocation == null && !DB_LOCATION.equals(IPerformancesConstants.NETWORK_DATABASE_LOCATION)) ||
 					!DB_LOCATION.equals(databaseLocation)) ||
 			!DB_NAME.equals(IPerformancesConstants.DATABASE_NAME_PREFIX + eclipseVersion)) {
+		    // TODO: rename shutdown to disconnect?
 			shutdown();
 			DB_CONNECTION = connected;
 			DB_LOCATION = databaseLocation == null ? IPerformancesConstants.NETWORK_DATABASE_LOCATION : databaseLocation;
 			DB_NAME = IPerformancesConstants.DATABASE_NAME_PREFIX + eclipseVersion;
-			DB_VERSION = "v44"; // + eclipseVersion;
-			DB_VERSION_REF = "R-4.4"; //" + (eclipseVersion % 10 - 1);
+			DB_VERSION = "v45"; // + eclipseVersion;
+			DB_VERSION_REF = "R-4.5"; //" + (eclipseVersion % 10 - 1);
 			if (connected) {
 				return getDefault().fSQL != null;
 			}
@@ -658,7 +661,7 @@
 	for (int i=0; i<BUILDS_LENGTH; i++) {
 		String build = BUILDS[i];
 		if (build.startsWith(DB_VERSION_REF)) {
-			String buildDate = build.substring(build.indexOf('_')+1);
+			String buildDate = build.substring(build.indexOf('-')+1);
 			if (buildDate.compareTo(date) < 0) {
 				if (lastBaselineBuild == null || build.compareTo(lastBaselineBuild) > 0) {
 					lastBaselineBuild = build;
@@ -711,8 +714,8 @@
 		}
 	}
 	if (DB_VERSION == null) {
-		DB_VERSION = "v44"; // + DB_NAME.substring(DB_NAME.length()-2);
-		DB_VERSION_REF = "R-4.4"; //+(Character.digit(DB_NAME.charAt(DB_NAME.length()-1), 10)-1);
+		DB_VERSION = "v45"; // + DB_NAME.substring(DB_NAME.length()-2);
+		DB_VERSION_REF = "R-4.5"; //+(Character.digit(DB_NAME.charAt(DB_NAME.length()-1), 10)-1);
 	}
 }
 
@@ -1087,6 +1090,7 @@
 		DEBUG_WRITER.print("	- DB query all data points for config pattern: "+configPattern+" for scenario: " + scenarioResults.getShortName()); //$NON-NLS-1$ //$NON-NLS-2$
 		if (buildName != null) DEBUG_WRITER.print(" for build: "+buildName); //$NON-NLS-1$
 	}
+	if (LOG) LOG_WRITER.starts("     -> configPattern: " + configPattern + "    buildName (if any): " + buildName);
 	internalQueryAllVariations(configPattern); // need to read all variations to have all build names
 	ResultSet result = null;
 	try {
@@ -1207,7 +1211,7 @@
 			LAST_BASELINE_BUILD = build;
 		} else {
 			String buildDate = LAST_CURRENT_BUILD.substring(1, 9)+LAST_CURRENT_BUILD.substring(10, LAST_CURRENT_BUILD.length());
-			String baselineDate = LAST_BASELINE_BUILD.substring(LAST_BASELINE_BUILD.indexOf('_')+1);
+			String baselineDate = LAST_BASELINE_BUILD.substring(LAST_BASELINE_BUILD.indexOf('-')+1);
 			if (build.compareTo(LAST_BASELINE_BUILD) > 0 && baselineDate.compareTo(buildDate) < 0) {
 				LAST_BASELINE_BUILD = build;
 			}
diff --git a/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/internal/performance/results/db/PerformanceResults.java b/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/internal/performance/results/db/PerformanceResults.java
index 281eb66..f689257 100644
--- a/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/internal/performance/results/db/PerformanceResults.java
+++ b/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/internal/performance/results/db/PerformanceResults.java
@@ -44,7 +44,6 @@
 	Map allScenarios;
 	String lastBuildName; // Name of the last used build
 	String baselineName; // Name of the baseline build used for comparison
-	String baselinePrefix;
 	private String scenarioPattern = "%"; //$NON-NLS-1$
 	private String[] components;
 	String[] configNames, sortedConfigNames;
@@ -114,6 +113,7 @@
  * @return The names list of all currently known builds
  */
 public String[] getAllBuildNames() {
+    
 	if (this.allBuildNames == null) {
 		setAllBuildNames();
 	}
@@ -424,8 +424,14 @@
 				componentResults.readLocalFile(dataDir, scenarios);
 			}
 			catch (FileNotFoundException ex) {
+			    subMonitor.worked(1);
 				return null;
 			}
+	         catch (StringIndexOutOfBoundsException ex) {
+	             System.err.println("ERROR: Found StringIndexOutOfBoundsException fournd. Possible corruption in DB?");
+	             subMonitor.worked(1);
+	            return null;
+	        }
 			subMonitor.worked(1);
 		} else {
 			if (timeGuess == null) {
@@ -738,14 +744,15 @@
  */
 public void setBaselineName(String buildName) {
 	this.baselineName = buildName;
-	if (this.baselinePrefix == null || !this.baselineName.startsWith(this.baselinePrefix)) {
+	if (this.baselinePrefix == null) { // || !this.baselineName.startsWith(this.baselinePrefix)) {
 		// Usually hat baseline name format is *always* x.y_yyyyMMddhhmm_yyyyMMddhhmm
-		int index = this.baselineName.lastIndexOf('_');
+	    // Currently, 10/2015, R-4.5-yyyyMMddhhmm
+		int index = this.baselineName.lastIndexOf('-');
 		if (index > 0) {
 			this.baselinePrefix = this.baselineName.substring(0, index);
-		} else {
-//				this.baselinePrefix = DB_Results.getDbBaselinePrefix();
-			this.baselinePrefix = this.baselineName;
+		} else { 
+		    // use hard coded value (currently R-4.5)
+		    this.baselinePrefix = DB_Results.getDbBaselinePrefix();
 		}
 	}
 }
@@ -793,9 +800,9 @@
 
 	// Init baseline prefix if not set
 	if (this.baselineName != null) {
-		if (this.baselinePrefix == null || !this.baselineName.startsWith(this.baselinePrefix)) {
+		if (this.baselinePrefix == null) { // || !this.baselineName.startsWith(this.baselinePrefix)) {
 			// Usually hat baseline name format is *always* x.y_yyyyMMddhhmm_yyyyMMddhhmm
-			int index = this.baselineName.lastIndexOf('_');
+			int index = this.baselineName.lastIndexOf('-');
 			if (index > 0) {
 				this.baselinePrefix = this.baselineName.substring(0, index);
 			} else {
@@ -922,6 +929,9 @@
  * Write general information.
  */
 void writeData(File dir) {
+    if (DO_NOT_WRITE_DATA) {
+        return;
+    }
 	if (!DB_Results.DB_CONNECTION) {
 		// Only write new local file if there's a database connection
 		// otherwise contents may not be complete...
diff --git a/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/internal/performance/results/db/SQL_Results.java b/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/internal/performance/results/db/SQL_Results.java
index 095d139..a108ae8 100644
--- a/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/internal/performance/results/db/SQL_Results.java
+++ b/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/internal/performance/results/db/SQL_Results.java
@@ -183,7 +183,11 @@
 		this.queryScenarioTimestampDataPoints = this.fConnection.prepareStatement(statement);
 	}
 	this.queryScenarioTimestampDataPoints.setInt(1, scenarioID);
-	Timestamp timestamp = new Timestamp(lastBuildTime+(5*3600L*1000)); // create a time-stamp 5h after the given build time
+	// 10/29/2015, dw. Not sure why this timestamp was set 5 hours in future. 
+	// UTC? Location of previous performance machines? 
+	// But, should not be required, AFAIK. 
+	// Timestamp timestamp = new Timestamp(lastBuildTime+(5*3600L*1000)); // create a time-stamp 5h after the given build time
+	Timestamp timestamp = new Timestamp(lastBuildTime - (5*3600L*1000)); 
 	this.queryScenarioTimestampDataPoints.setTimestamp(2, timestamp);
 	ResultSet resultSet =  this.queryScenarioTimestampDataPoints.executeQuery();
 	if (DB_Results.LOG) DB_Results.LOG_WRITER.ends(")"); //$NON-NLS-1$
diff --git a/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/internal/performance/results/db/ScenarioResults.java b/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/internal/performance/results/db/ScenarioResults.java
index fb6dfe0..63e1072 100644
--- a/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/internal/performance/results/db/ScenarioResults.java
+++ b/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/internal/performance/results/db/ScenarioResults.java
@@ -395,6 +395,9 @@
 }
 
 void write(DataOutputStream stream) throws IOException {
+    if (DO_NOT_WRITE_DATA) {
+        return;
+    }
 	int size = size();
 	stream.writeInt(this.id);
 	stream.writeInt(size);
diff --git a/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/internal/performance/results/model/PerformanceResultsElement.java b/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/internal/performance/results/model/PerformanceResultsElement.java
index 467bb86..f70cc84 100644
--- a/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/internal/performance/results/model/PerformanceResultsElement.java
+++ b/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/internal/performance/results/model/PerformanceResultsElement.java
@@ -347,11 +347,11 @@
 		stream.print("<h2>Performance comparison of ");
 		stream.print(build);
 		stream.print(" relative to ");
-		int index = reference.indexOf('_');
+		int index = reference.indexOf('-');
 		if (index > 0) {
 			stream.print(reference.substring(0, index));
 			stream.print(" (");
-			index = reference.lastIndexOf('_');
+			index = reference.lastIndexOf('-');
 			stream.print(reference.substring(index+1, reference.length()));
 			stream.print(')');
 		} else {
diff --git a/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/internal/performance/results/utils/Util.java b/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/internal/performance/results/utils/Util.java
index b2317a0..8eb62eb 100644
--- a/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/internal/performance/results/utils/Util.java
+++ b/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/internal/performance/results/utils/Util.java
@@ -8,6 +8,7 @@
  * Contributors:
  *     IBM Corporation - initial API and implementation
  *******************************************************************************/
+
 package org.eclipse.test.internal.performance.results.utils;
 
 import java.io.File;
@@ -39,130 +40,131 @@
  */
 public final class Util implements IPerformancesConstants {
 
-	// Percentages
-	public static final NumberFormat PERCENTAGE_FORMAT = NumberFormat.getPercentInstance(Locale.US);
-	static {
-		PERCENTAGE_FORMAT.setMaximumFractionDigits(2);
-	}
-	public static final NumberFormat DOUBLE_FORMAT = NumberFormat.getNumberInstance(Locale.US);
-	static {
-		DOUBLE_FORMAT.setMaximumFractionDigits(2);
-	}
+    // Percentages
+    public static final NumberFormat PERCENTAGE_FORMAT = NumberFormat.getPercentInstance(Locale.US);
+    static {
+        PERCENTAGE_FORMAT.setMaximumFractionDigits(2);
+    }
+    public static final NumberFormat DOUBLE_FORMAT = NumberFormat.getNumberInstance(Locale.US);
+    static {
+        DOUBLE_FORMAT.setMaximumFractionDigits(2);
+    }
 
-	// Strings
-	public static final String LINE_SEPARATOR = System.getProperty("line.separator");
+    // Strings
+    public static final String LINE_SEPARATOR     = System.getProperty("line.separator");
 
-	// Build prefixes
-	public static final List ALL_BUILD_PREFIXES = new ArrayList(3);
-	static {
-		ALL_BUILD_PREFIXES.add("I");
-		ALL_BUILD_PREFIXES.add("N");
-		ALL_BUILD_PREFIXES.add("M");
-	}
-	public static final List BUILD_PREFIXES = new ArrayList(2);
-	static {
-		BUILD_PREFIXES.add("I");
-		BUILD_PREFIXES.add("N");
-	}
-	public static final List MAINTENANCE_BUILD_PREFIXES = new ArrayList(2);
-	static {
-		MAINTENANCE_BUILD_PREFIXES.add("I");
-		MAINTENANCE_BUILD_PREFIXES.add("M");
-	}
-	public static final List BASELINE_BUILD_PREFIXES = new ArrayList(1);
-	static {
-		BASELINE_BUILD_PREFIXES.add(DB_Results.getDbBaselinePrefix());
-	}
+    // Build prefixes
+    public static final List   ALL_BUILD_PREFIXES = new ArrayList(3);
+    static {
+        ALL_BUILD_PREFIXES.add("I");
+        ALL_BUILD_PREFIXES.add("N");
+        ALL_BUILD_PREFIXES.add("M");
+    }
+    public static final List BUILD_PREFIXES = new ArrayList(2);
+    static {
+        BUILD_PREFIXES.add("I");
+        BUILD_PREFIXES.add("N");
+    }
+    public static final List MAINTENANCE_BUILD_PREFIXES = new ArrayList(2);
+    static {
+        MAINTENANCE_BUILD_PREFIXES.add("I");
+        MAINTENANCE_BUILD_PREFIXES.add("M");
+    }
+    public static final List BASELINE_BUILD_PREFIXES = new ArrayList(1);
+    static {
+        BASELINE_BUILD_PREFIXES.add(DB_Results.getDbBaselinePrefix());
+    }
 
-	// Milestones constants
-	private static String[] MILESTONES;
-	public static final BuildDateComparator BUILD_DATE_COMPARATOR = new BuildDateComparator();
+    // Milestones constants
+    private static String[]                 MILESTONES;
+    public static final BuildDateComparator BUILD_DATE_COMPARATOR = new BuildDateComparator();
 
-	// Components constants
-	public static final String ORG_ECLIPSE = "org.eclipse.";
+    // Components constants
+    public static final String              ORG_ECLIPSE           = "org.eclipse.";
 
-static class BuildDateComparator implements Comparator {
-	public int compare(Object o1, Object o2) {
-		String s1 = (String) o1;
-		String s2 = (String) o2;
-		String buildDate1 = getBuildDate(s1);
-		String buildDate2 = getBuildDate(s2);
+    static class BuildDateComparator implements Comparator {
+
+        public int compare(Object o1, Object o2) {
+            String s1 = (String) o1;
+            String s2 = (String) o2;
+            String buildDate1 = getBuildDate(s1);
+            String buildDate2 = getBuildDate(s2);
 		// Not the greatest sanity check, found some cases, when "getting started" 
 		// where buildname was "4.1.1" or "${buildid}, which would cause a NPE. 
-		// So, simple attempt to provide a more helpful message.
-		if (buildDate1 == null) {
-		    throw new IllegalArgumentException("Buildname did not have a date, as expected: " + s1);
-		}
-	    if (buildDate2 == null) {
-	            throw new IllegalArgumentException("Buildname did not have a date, as expected: " + s2);
-	    }
-		return buildDate1.compareTo(buildDate2);
-	}
-}
+            // So, simple attempt to provide a more helpful message.
+            if (buildDate1 == null) {
+                throw new IllegalArgumentException("Buildname did not have a date, as expected: " + s1);
+            }
+            if (buildDate2 == null) {
+                throw new IllegalArgumentException("Buildname did not have a date, as expected: " + s2);
+            }
+            return buildDate1.compareTo(buildDate2);
+        }
+    }
 
-private static void initMilestones() {
-	String version = DB_Results.getDbVersion();
+    private static void initMilestones() {
+        String version = DB_Results.getDbVersion();
 
-	// Initialize reference version and database directory
-	char mainVersion = version.charAt(1);
-	char minorVersion = version.charAt(2);
+        // Initialize reference version and database directory
+        char mainVersion = version.charAt(1);
+        char minorVersion = version.charAt(2);
 
-	// Initialize milestones
-	if (mainVersion == '3') {
-		switch (minorVersion) {
-			case '3':
-			case '4':
-			case '5':
-				throw new RuntimeException("Version "+mainVersion+'.'+minorVersion+" is no longer supported!");
-			case '6':
-				MILESTONES = V36_MILESTONES;
-				break;
-			case '7':
-				MILESTONES = V37_MILESTONES;
-				break;
-			default:
-				throw new RuntimeException("Version "+mainVersion+'.'+minorVersion+" is not supported yet!");
-		}
-	} else {
-		throw new RuntimeException("Version "+mainVersion+'.'+minorVersion+" is not supported yet!");
-	}
-}
+        // Initialize milestones
+        if (mainVersion == '3') {
+            switch (minorVersion) {
+                case '3':
+                case '4':
+                case '5':
+                    throw new RuntimeException("Version " + mainVersion + '.' + minorVersion + " is no longer supported!");
+                case '6':
+                    MILESTONES = V36_MILESTONES;
+                    break;
+                case '7':
+                    MILESTONES = V37_MILESTONES;
+                    break;
+                default:
+                    throw new RuntimeException("Version " + mainVersion + '.' + minorVersion + " is not supported yet!");
+            }
+        } else {
+            throw new RuntimeException("Version " + mainVersion + '.' + minorVersion + " is not supported yet!");
+        }
+    }
 
-// Static information for time and date
-public static final int ONE_MINUTE = 60000;
-public static final long ONE_HOUR = 3600000L;
-public static final SimpleDateFormat DATE_FORMAT = new SimpleDateFormat("yyyyMMddHHmm"); //$NON-NLS-1$
+    // Static information for time and date
+    public static final int              ONE_MINUTE  = 60000;
+    public static final long             ONE_HOUR    = 3600000L;
+    public static final SimpleDateFormat DATE_FORMAT = new SimpleDateFormat("yyyyMMddHHmm"); //$NON-NLS-1$
 
-/**
- * Return the name to display for the given component.
- * <p>
+    /**
+     * Return the name to display for the given component.
+     * <p>
  * This name is built from the name of the component selected in the Components view.
  * The rules to build the name are:
- * <ol>
+     * <ol>
  * <li>If the component name does not start with "org.eclipse" then the part name is just
  * 		"<b>component name</b>"</li>
- * <li>Otherwise, remove "org.eclipse." form the component name and count
- * 		the tokens separated by a dot ('.')
- * 		<ul>
+     * <li>Otherwise, remove "org.eclipse." form the component name and count
+     * the tokens separated by a dot ('.')
+     * <ul>
  * 		<li>If there's only one remaining token, then the part name is "<b>Platform/</b>"
  * 			followed by:
- * 			<ul>
- * 			<li>"<b><i>TOKEN</i></b>" if token is less than 3 characters,</li>
- * 			<li>"<b><i>Token</i></b>" otherwise</li>
- * 			</ul>
- * 		</li>
+     * <ul>
+     * <li>"<b><i>TOKEN</i></b>" if token is less than 3 characters,</li>
+     * <li>"<b><i>Token</i></b>" otherwise</li>
+     * </ul>
+     * </li>
  * 		<li>Otherwise then the part name is "<b><i>FIRST_TOKEN</i></b>" followed by:
- * 			<ul>
- * 			<li>for each followed additional token:
- * 				<ul>
- * 				<li>"<b><i>TOKEN</i></b>" if token is less than 3 characters,</li>
- * 				<li>"<b><i>Token</i></b>" otherwise</li>
- * 				</ul>
- * 			</li>
- * 			</ul>
- * 		</li>
- * 		</ul>
- * </ol>
+     * <ul>
+     * <li>for each followed additional token:
+     * <ul>
+     * <li>"<b><i>TOKEN</i></b>" if token is less than 3 characters,</li>
+     * <li>"<b><i>Token</i></b>" otherwise</li>
+     * </ul>
+     * </li>
+     * </ul>
+     * </li>
+     * </ul>
+     * </ol>
  * E.g.
  * 	- org.eclipse.ui -> "Platform/UI"
  * 	- org.eclipse.swt -> "Platform/SWT"
@@ -170,484 +172,511 @@
  * 	- org.eclipse.jdt.ui -> "JDT/UI"
  * 	- org.eclipse.jdt.core -> "JDT/Core"
  * 	- org.eclipse.pde.api.tools -> "PDE/API Tools"
- */
-public static String componentDisplayName(String componentName) {
-	String partName;
-	StringBuffer buffer = null;
-	if (componentName.startsWith(ORG_ECLIPSE)) {
-		partName = componentName.substring(ORG_ECLIPSE.length());
-		StringTokenizer tokenizer = new StringTokenizer(partName, ".");
-		while (tokenizer.hasMoreTokens()) {
-			String token = tokenizer.nextToken();
-			if (buffer == null) {
-				if (tokenizer.hasMoreTokens()) {
-					buffer = new StringBuffer("'"+token.toUpperCase());
-					buffer.append('/');
-				} else {
-					buffer = new StringBuffer("'Platform/");
-					if (token.length() > 3) {
-						buffer.append(Character.toUpperCase(token.charAt(0)));
-						buffer.append(token.substring(1));
-					} else {
-						buffer.append(token.toUpperCase());
-					}
-				}
-			} else {
-				if (token.length() > 3) {
-					buffer.append(Character.toUpperCase(token.charAt(0)));
-					buffer.append(token.substring(1));
-				} else {
-					buffer.append(token.toUpperCase());
-				}
+     */
+    public static String componentDisplayName(String componentName) {
+        String partName;
+        StringBuffer buffer = null;
+        if (componentName.startsWith(ORG_ECLIPSE)) {
+            partName = componentName.substring(ORG_ECLIPSE.length());
+            StringTokenizer tokenizer = new StringTokenizer(partName, ".");
+            while (tokenizer.hasMoreTokens()) {
+                String token = tokenizer.nextToken();
+                if (buffer == null) {
+                    if (tokenizer.hasMoreTokens()) {
+                        buffer = new StringBuffer("'" + token.toUpperCase());
+                        buffer.append('/');
+                    } else {
+                        buffer = new StringBuffer("'Platform/");
+                        if (token.length() > 3) {
+                            buffer.append(Character.toUpperCase(token.charAt(0)));
+                            buffer.append(token.substring(1));
+                        } else {
+                            buffer.append(token.toUpperCase());
+                        }
+                    }
+                } else {
+                    if (token.length() > 3) {
+                        buffer.append(Character.toUpperCase(token.charAt(0)));
+                        buffer.append(token.substring(1));
+                    } else {
+                        buffer.append(token.toUpperCase());
+                    }
 				if (tokenizer.hasMoreTokens()) buffer.append(' ');
-			}
-		}
-	} else {
-		buffer = new StringBuffer("'");
-		buffer.append(componentName);
-		buffer.append("'");
-	}
-	if (buffer == null) {
-	    throw new RuntimeException("buffer was unexpectedly null. Program error?");
-	}
-	buffer.append("' results");
-	return buffer.toString();
-}
+                }
+            }
+        } else {
+            buffer = new StringBuffer("'");
+            buffer.append(componentName);
+            buffer.append("'");
+        }
+        if (buffer == null) {
+            throw new RuntimeException("buffer was unexpectedly null. Program error?");
+        }
+        buffer.append("' results");
+        return buffer.toString();
+    }
 
-/**
- * Compute the student t-test values.
- *
- * @see "http://en.wikipedia.org/wiki/Student's_t-test"
- *
+    /**
+     * Compute the student t-test values.
+     *
+     * @see "http://en.wikipedia.org/wiki/Student's_t-test"
+     *
  * @param baselineResults The baseline build
  * @param buildResults The current build
- * @return The student t-test value as a double.
- */
-public static double computeTTest(BuildResults baselineResults, BuildResults buildResults) {
+     * @return The student t-test value as a double.
+     */
+    public static double computeTTest(BuildResults baselineResults, BuildResults buildResults) {
 
-	double ref = baselineResults.getValue();
-	double val = buildResults.getValue();
+        double ref = baselineResults.getValue();
+        double val = buildResults.getValue();
 
-	double delta = ref - val;
-	long dfRef = baselineResults.getCount() - 1;
-	double sdRef = baselineResults.getDeviation();
-	long dfVal = buildResults.getCount() - 1;
-	double sdVal = buildResults.getDeviation();
-	// TODO if the stdev's are not sufficiently similar, we have to take a
-	// different approach
+        double delta = ref - val;
+        long dfRef = baselineResults.getCount() - 1;
+        double sdRef = baselineResults.getDeviation();
+        long dfVal = buildResults.getCount() - 1;
+        double sdVal = buildResults.getDeviation();
+        // TODO if the stdev's are not sufficiently similar, we have to take a
+        // different approach
 
-	if (!Double.isNaN(sdRef) && !Double.isNaN(sdVal) && dfRef > 0 && dfVal > 0) {
-		long df = dfRef + dfVal;
-		double sp_square = (dfRef * sdRef * sdRef + dfVal * sdVal * sdVal) / df;
+        if (!Double.isNaN(sdRef) && !Double.isNaN(sdVal) && dfRef > 0 && dfVal > 0) {
+            long df = dfRef + dfVal;
+            double sp_square = (dfRef * sdRef * sdRef + dfVal * sdVal * sdVal) / df;
 
-		double se_diff = Math.sqrt(sp_square * (1.0 / (dfRef + 1) + 1.0 / (dfVal + 1)));
-		double t = Math.abs(delta / se_diff);
-		return t;
-	}
+            double se_diff = Math.sqrt(sp_square * (1.0 / (dfRef + 1) + 1.0 / (dfVal + 1)));
+            double t = Math.abs(delta / se_diff);
+            return t;
+        }
 
-	return -1;
-}
+        return -1;
+    }
 
-/**
- * Copy a file to another location.
- *
+    /**
+     * Copy a file to another location.
+     *
  * @param src the source file.
  * @param dest the destination.
- * @return <code>true</code> if the file was successfully copied,
- * 	<code>false</code> otherwise.
- */
-public static boolean copyFile(File src, File dest) {
+     * @return <code>true</code> if the file was successfully copied,
+     *         <code>false</code> otherwise.
+     */
+    public static boolean copyFile(File src, File dest) {
 
-	try {
-		InputStream in = new FileInputStream(src);
-		OutputStream out = new FileOutputStream(dest);
-		byte[] buf = new byte[1024];
-		int len;
-		while ((len = in.read(buf)) > 0) {
-			out.write(buf, 0, len);
-		}
-		in.close();
-		out.close();
+        try {
+            InputStream in = new FileInputStream(src);
+            OutputStream out = new FileOutputStream(dest);
+            byte[] buf = new byte[1024];
+            int len;
+            while ((len = in.read(buf)) > 0) {
+                out.write(buf, 0, len);
+            }
+            in.close();
+            out.close();
 	} catch (FileNotFoundException e) {
-		e.printStackTrace();
-		return false;
+            e.printStackTrace();
+            return false;
 	} catch (IOException e) {
-		e.printStackTrace();
-		return false;
-	}
-	return true;
-}
+            e.printStackTrace();
+            return false;
+        }
+        return true;
+    }
 
-/**
- * Copy a file content to another location.
- *
+    /**
+     * Copy a file content to another location.
+     *
  * @param in the input stream.
  * @param dest the destination.
- * @return <code>true</code> if the file was successfully copied,
- * 	<code>false</code> otherwise.
- */
-public static boolean copyStream(InputStream in, File dest) {
+     * @return <code>true</code> if the file was successfully copied,
+     *         <code>false</code> otherwise.
+     */
+    public static boolean copyStream(InputStream in, File dest) {
 
-	try {
-		OutputStream out = new FileOutputStream(dest);
-		byte[] buf = new byte[1024];
-		int len;
-		while ((len = in.read(buf)) > 0) {
-			out.write(buf, 0, len);
-		}
-		in.close();
-		out.close();
+        try {
+            OutputStream out = new FileOutputStream(dest);
+            byte[] buf = new byte[1024];
+            int len;
+            while ((len = in.read(buf)) > 0) {
+                out.write(buf, 0, len);
+            }
+            in.close();
+            out.close();
 	} catch (FileNotFoundException e) {
-		e.printStackTrace();
-		return false;
+            e.printStackTrace();
+            return false;
 	} catch (IOException e) {
-		e.printStackTrace();
-		return false;
-	}
-	return true;
-}
+            e.printStackTrace();
+            return false;
+        }
+        return true;
+    }
 
-/**
- * Return the build date as yyyyMMddHHmm.
- *
+    /**
+     * Return the build date as yyyyMMddHHmm.
+     *
  * @param buildName The build name (e.g. I20090806-0100)
- * @return The date as a string.
- */
-public static String getBuildDate(String buildName) {
-	return getBuildDate(buildName, DB_Results.getDbBaselinePrefix());
-}
+     * @return The date as a string.
+     */
+    public static String getBuildDate(String buildName) {
+        return getBuildDate(buildName, DB_Results.getDbBaselinePrefix());
+    }
 
-/**
- * Return the build date as yyyyMMddHHmm.
- *
+    /**
+     * Return the build date as yyyyMMddHHmm.
+     *
  * @param buildName The build name (e.g. I20090806-0100)
  * @param baselinePrefix The baseline prefix (e.g. {@link DB_Results#getDbBaselinePrefix()})
- * @return The date as a string.
- */
-public static String getBuildDate(String buildName, String baselinePrefix) {
+     * @return The date as a string.
+     */
+    public static String getBuildDate(String buildName, String baselinePrefix) {
 
-	// Baseline name
-	if (baselinePrefix != null && buildName.startsWith(baselinePrefix)) {
-		int length = buildName.length();
-		return buildName.substring(length-12, length);
-	}
+        String result = "";
+        // Baseline name
+        if (baselinePrefix != null && buildName.startsWith(baselinePrefix)) {
+            int length = buildName.length();
+            result = buildName.substring(length - 12, length);
+        } else {
+            // Build name
+            char first = buildName.charAt(0);
+            // TODO: should check if in buildIdPrefixes instead of hard coding
+            if (first == 'N' || first == 'I' || first == 'M') {
+                result = buildName.substring(1, 9) + buildName.substring(10, 14);
+            } else {
+                //System.err.println("\n\tERROR: buildName did not have expected format. buildName: " + buildName);
+                // 2015/10/30 (dw) following too complicated (and, unsure if correct, so should be removed or simplified greatly bullet proofed)  
+                // Try with date format, to handle old release baselines
+                int length = buildName.length() - 12 /* length of date */;
+                for (int i = 0; i <= length; i++) {
+                    try {
+                        String substring = i == 0 ? buildName : buildName.substring(i);
+                        Util.DATE_FORMAT.parse(substring);
+                        // if no exception,
+                        result = substring;
+                    }
+                    catch (ParseException ex) {
+                        result = null;
+                    }
+              }
+            }
+        }
+        return result;
+    }
 
-	// Build name
-	char first = buildName.charAt(0);
-	if (first == 'N' || first == 'I' || first == 'M') { // TODO (frederic) should be buildIdPrefixes...
-		return buildName.substring(1, 9)+buildName.substring(10, 14);
-	}
-
-	// Try with date format
-	int length = buildName.length() - 12 /* length of date */;
-	for (int i=0; i<=length; i++) {
-		try {
-			String substring = i == 0 ? buildName : buildName.substring(i);
-			Util.DATE_FORMAT.parse(substring);
-			return substring; // if no exception is raised then the substring has a correct date format => return it
-		} catch(ParseException ex) {
-			// skip
-		}
-	}
-	return null;
-}
-
-/**
- * Returns the date of the milestone corresponding at the given index.
- *
+    /**
+     * Returns the date of the milestone corresponding at the given index.
+     *
  * @param index The index of the milestone
- * @return The date as a YYYYMMDD-hhmm string.
- */
-public static String getMilestoneDate(int index) {
-	int length = getMilestonesLength();
+     * @return The date as a YYYYMMDD-hhmm string.
+     */
+    public static String getMilestoneDate(int index) {
+        int length = getMilestonesLength();
 	if (index >= length) return null;
-	int dash = MILESTONES[index].indexOf('-');
-	return MILESTONES[index].substring(dash+1);
-}
+        int dash = MILESTONES[index].indexOf('-');
+        return MILESTONES[index].substring(dash + 1);
+    }
 
-/**
- * Returns the milestone matching the given build name.
- *
+    /**
+     * Returns the milestone matching the given build name.
+     *
  * @param buildName The name of the build
- * @return The milestone as a string (e.g. M1)
- */
-public static String getMilestone(String buildName) {
-	if (buildName != null && buildName.length() >= 12) {
-		int length = getMilestonesLength();
-		String buildDate = getBuildDate(buildName, DB_Results.getDbBaselinePrefix());
-		for (int i=0; i<length; i++) {
-			int start = MILESTONES[i].indexOf(buildDate);
-			if (start > 0) {
-				return MILESTONES[i];
-			}
-		}
-	}
-	return null;
-}
+     * @return The milestone as a string (e.g. M1)
+     */
+    public static String getMilestone(String buildName) {
+        if (buildName != null && buildName.length() >= 12) {
+            int length = getMilestonesLength();
+            String buildDate = getBuildDate(buildName, DB_Results.getDbBaselinePrefix());
+            for (int i = 0; i < length; i++) {
+                int start = MILESTONES[i].indexOf(buildDate);
+                if (start > 0) {
+                    return MILESTONES[i];
+                }
+            }
+        }
+        return null;
+    }
 
-/**
- * Returns the name the milestone matching the given build name.
- *
+    /**
+     * Returns the name the milestone matching the given build name.
+     *
  * @param buildName The name of the build
- * @return The milestone name as a string (e.g. M1)
- */
-public static String getMilestoneName(String buildName) {
-	if (buildName != null && buildName.length() >= 12) {
-		int length = getMilestonesLength();
-		String buildDate = getBuildDate(buildName, DB_Results.getDbBaselinePrefix());
-		for (int i=0; i<length; i++) {
-			int start = MILESTONES[i].indexOf(buildDate);
-			if (start > 0) {
-				return MILESTONES[i].substring(0, start - 1);
-			}
-		}
-	}
-	return null;
-}
+     * @return The milestone name as a string (e.g. M1)
+     */
+    public static String getMilestoneName(String buildName) {
+        if (buildName != null && buildName.length() >= 12) {
+            int length = getMilestonesLength();
+            String buildDate = getBuildDate(buildName, DB_Results.getDbBaselinePrefix());
+            for (int i = 0; i < length; i++) {
+                int start = MILESTONES[i].indexOf(buildDate);
+                if (start > 0) {
+                    return MILESTONES[i].substring(0, start - 1);
+                }
+            }
+        }
+        return null;
+    }
 
-/**
- * Returns whether the given build name is a milestone or not.
- *
+    /**
+     * Returns whether the given build name is a milestone or not.
+     *
  * @param buildName The build name
- * @return <code>true</code> if the build name matches a milestone one,
- * 	<code>false</code> otherwise.
- */
-public static boolean isMilestone(String buildName) {
-	return getMilestoneName(buildName) != null;
-}
+     * @return <code>true</code> if the build name matches a milestone one,
+     *         <code>false</code> otherwise.
+     */
+    public static boolean isMilestone(String buildName) {
+        return getMilestoneName(buildName) != null;
+    }
 
-/**
- * Returns the name of the milestone which run after the given build name
- * or <code>null</code> if there's no milestone since the build has run.
- *
- * @param buildName The build name
- * @return <code>true</code> if the build name matches a milestone one,
- * 	<code>false</code> otherwise.
- */
-public static String getNextMilestone(String buildName) {
-	int length = getMilestonesLength();
-	String buildDate = getBuildDate(buildName);
-	for (int i=0; i<length; i++) {
-		String milestoneDate = MILESTONES[i].substring(MILESTONES[i].indexOf('-')+1);
-		if (milestoneDate.compareTo(buildDate) > 0) {
-			return milestoneDate;
-		}
-	}
-	return null;
-}
+    /**
+     * Returns the name of the milestone which run after the given build name or
+     * <code>null</code> if there's no milestone since the build has run.
+     *
+     * @param buildName
+     *            The build name
+     * @return <code>true</code> if the build name matches a milestone one,
+     *         <code>false</code> otherwise.
+     */
+    public static String getNextMilestone(String buildName) {
+        int length = getMilestonesLength();
+        String buildDate = getBuildDate(buildName);
+        for (int i = 0; i < length; i++) {
+            String milestoneDate = MILESTONES[i].substring(MILESTONES[i].indexOf('-') + 1);
+            if (milestoneDate.compareTo(buildDate) > 0) {
+                return milestoneDate;
+            }
+        }
+        return null;
+    }
 
-/**
- * Return the number of milestones.
- *
- * @return The number as an int
- */
-public static int getMilestonesLength() {
-	if (MILESTONES == null) initMilestones();
-	int length = MILESTONES.length;
-	return length;
-}
+    /**
+     * Return the number of milestones.
+     *
+     * @return The number as an int
+     */
+    public static int getMilestonesLength() {
+        if (MILESTONES == null)
+            initMilestones();
+        int length = MILESTONES.length;
+        return length;
+    }
 
-/**
- * @deprecated
- */
-public static boolean matchPattern(String name, String pattern) {
-	if (pattern.equals("*")) return true; //$NON-NLS-1$
-	if (pattern.indexOf('*') < 0 && pattern.indexOf('?') < 0) {
-		pattern += "*"; //$NON-NLS-1$
-	}
-	StringTokenizer tokenizer = new StringTokenizer(pattern, "*?", true); //$NON-NLS-1$
-	int start = 0;
-	String previous = ""; //$NON-NLS-1$
-	while (tokenizer.hasMoreTokens()) {
-		String token = tokenizer.nextToken();
-		if (!token.equals("*") && !token.equals("?")) { //$NON-NLS-1$ //$NON-NLS-2$
-			if (previous.equals("*")) { //$NON-NLS-1$
-				int idx = name.substring(start).indexOf(token);
-				if (idx < 0) return false;
-				start += idx;
-			} else {
-				if (previous.equals("?")) start++; //$NON-NLS-1$
-				if (!name.substring(start).startsWith(token)) return false;
-			}
-			start += token.length();
-		}
-		previous = token;
-	}
-	if (previous.equals("*")) { //$NON-NLS-1$
-		return true;
-	} else if (previous.equals("?")) { //$NON-NLS-1$
-		return name.length() == start;
-	}
-	return name.endsWith(previous);
-}
+    /**
+     * @deprecated
+     */
+    public static boolean matchPattern(String name, String pattern) {
+        if (pattern.equals("*")) //$NON-NLS-1$
+            return true;
+        if (pattern.indexOf('*') < 0 && pattern.indexOf('?') < 0) {
+            pattern += "*"; //$NON-NLS-1$
+        }
+        StringTokenizer tokenizer = new StringTokenizer(pattern, "*?", true); //$NON-NLS-1$
+        int start = 0;
+        String previous = ""; //$NON-NLS-1$
+        while (tokenizer.hasMoreTokens()) {
+            String token = tokenizer.nextToken();
+            if (!token.equals("*") && !token.equals("?")) { //$NON-NLS-1$ //$NON-NLS-2$
+                if (previous.equals("*")) { //$NON-NLS-1$
+                    int idx = name.substring(start).indexOf(token);
+                    if (idx < 0)
+                        return false;
+                    start += idx;
+                } else {
+                    if (previous.equals("?")) //$NON-NLS-1$
+                        start++;
+                    if (!name.substring(start).startsWith(token))
+                        return false;
+                }
+                start += token.length();
+            }
+            previous = token;
+        }
+        if (previous.equals("*")) { //$NON-NLS-1$
+            return true;
+        } else if (previous.equals("?")) { //$NON-NLS-1$
+            return name.length() == start;
+        }
+        return name.endsWith(previous);
+    }
 
-/**
- * @deprecated
- */
-public static double round(double value) {
-	return Math.round(value * 10000) / 10000.0;
-}
+    /**
+     * @deprecated
+     */
+    public static double round(double value) {
+        return Math.round(value * 10000) / 10000.0;
+    }
 
-/**
- * @deprecated
- */
-public static double round(double value, int precision) {
-	if (precision < 0) {
-		throw new IllegalArgumentException("Should have a precision at least greater than 0!");
-	}
-	if (precision == 0) return (long) Math.floor(value);
-	double factor = 10;
-	int n = 1;
-	while (n++ < precision)
-		factor *= 10;
-	return Math.round(value * factor) / factor;
-}
+    /**
+     * @deprecated
+     */
+    public static double round(double value, int precision) {
+        if (precision < 0) {
+            throw new IllegalArgumentException("Should have a precision at least greater than 0!");
+        }
+        if (precision == 0)
+            return (long) Math.floor(value);
+        double factor = 10;
+        int n = 1;
+        while (n++ < precision)
+            factor *= 10;
+        return Math.round(value * factor) / factor;
+    }
 
-/**
- * Returns a string to display the given time as a duration
- * formatted as "hh:mm:ss".
- *
- * @param time The time to format as a long.
- * @return The formatted string.
- */
-public static String timeChrono(long time) {
-	if (time < 1000) { // less than 1s
-		return "00:00:00"; //$NON-NLS-1$
-	}
-	StringBuffer buffer = new StringBuffer();
-	int seconds = (int) (time / 1000);
-	if (seconds < 60) {
-		buffer.append("00:00:"); //$NON-NLS-1$
-		if (seconds < 10) buffer.append('0');
-		buffer.append(seconds);
-	} else {
-		int minutes = seconds / 60;
-		if (minutes < 60) {
-			buffer.append("00:"); //$NON-NLS-1$
-			if (minutes < 10) buffer.append('0');
-			buffer.append(minutes);
-			buffer.append(':');
-			seconds = seconds % 60;
-			if (seconds < 10) buffer.append('0');
-			buffer.append(seconds);
-		} else {
-			int hours = minutes / 60;
-			if (hours < 10) buffer.append('0');
-			buffer.append(hours);
-			buffer.append(':');
-			minutes = minutes % 60;
-			if (minutes < 10) buffer.append('0');
-			buffer.append(minutes);
-			buffer.append(':');
-			seconds = seconds % 60;
-			if (seconds < 10) buffer.append('0');
-			buffer.append(seconds);
-		}
-	}
-	return buffer.toString();
-}
+    /**
+     * Returns a string to display the given time as a duration formatted as
+     * "hh:mm:ss".
+     *
+     * @param time
+     *            The time to format as a long.
+     * @return The formatted string.
+     */
+    public static String timeChrono(long time) {
+        if (time < 1000) { // less than 1s
+            return "00:00:00"; //$NON-NLS-1$
+        }
+        StringBuffer buffer = new StringBuffer();
+        int seconds = (int) (time / 1000);
+        if (seconds < 60) {
+            buffer.append("00:00:"); //$NON-NLS-1$
+            if (seconds < 10)
+                buffer.append('0');
+            buffer.append(seconds);
+        } else {
+            int minutes = seconds / 60;
+            if (minutes < 60) {
+                buffer.append("00:"); //$NON-NLS-1$
+                if (minutes < 10)
+                    buffer.append('0');
+                buffer.append(minutes);
+                buffer.append(':');
+                seconds = seconds % 60;
+                if (seconds < 10)
+                    buffer.append('0');
+                buffer.append(seconds);
+            } else {
+                int hours = minutes / 60;
+                if (hours < 10)
+                    buffer.append('0');
+                buffer.append(hours);
+                buffer.append(':');
+                minutes = minutes % 60;
+                if (minutes < 10)
+                    buffer.append('0');
+                buffer.append(minutes);
+                buffer.append(':');
+                seconds = seconds % 60;
+                if (seconds < 10)
+                    buffer.append('0');
+                buffer.append(seconds);
+            }
+        }
+        return buffer.toString();
+    }
 
-/**
- * Returns a string to display the given time as the hour of the day
- * formatted as "hh:mm:ss".
- *
- * @param time The time to format as a long.
- * @return The formatted string.
- */
-public static String timeEnd(long time) {
-	GregorianCalendar calendar = new GregorianCalendar();
-	calendar.add(Calendar.SECOND, (int)(time/1000));
-	Date date = calendar.getTime();
-	SimpleDateFormat dateFormat = new SimpleDateFormat("KK:mm:ss"); //$NON-NLS-1$
-	return dateFormat.format(date);
-}
+    /**
+     * Returns a string to display the given time as the hour of the day
+     * formatted as "hh:mm:ss".
+     *
+     * @param time
+     *            The time to format as a long.
+     * @return The formatted string.
+     */
+    public static String timeEnd(long time) {
+        GregorianCalendar calendar = new GregorianCalendar();
+        calendar.add(Calendar.SECOND, (int) (time / 1000));
+        Date date = calendar.getTime();
+        SimpleDateFormat dateFormat = new SimpleDateFormat("KK:mm:ss"); //$NON-NLS-1$
+        return dateFormat.format(date);
+    }
 
-/**
- * Returns a string to display the given time as a duration
- * formatted as:
- *	<ul>
- *	<li>"XXXms" if the duration is less than 0.1s (e.g. "543ms")</li>
- *	<li>"X.YYs" if the duration is less than 1s (e.g. "5.43s")</li>
- *	<li>"XX.Ys" if the duration is less than 1mn (e.g. "54.3s")</li>
- *	<li>"XXmn XXs" if the duration is less than 1h (e.g. "54mn 3s")</li>
- *	<li>"XXh XXmn XXs" if the duration is over than 1h (e.g. "5h 4mn 3s")</li>
- *	</ul>
- *
- * @param time The time to format as a long.
- * @return The formatted string.
- */
-public static String timeString(long time) {
-	NumberFormat format = NumberFormat.getInstance();
-	format.setMaximumFractionDigits(1);
-	StringBuffer buffer = new StringBuffer();
-	if (time == 0) {
-		// print nothing
-	} if (time < 100) { // less than 0.1s
-		buffer.append(time);
-		buffer.append("ms"); //$NON-NLS-1$
-	} else if (time < 1000) { // less than 1s
-		if ((time%100) != 0) {
-			format.setMaximumFractionDigits(2);
-		}
-		buffer.append(format.format(time/1000.0));
-		buffer.append("s"); //$NON-NLS-1$
-	} else if (time < Util.ONE_MINUTE) {  // less than 1mn
-		if ((time%1000) == 0) {
-			buffer.append(time/1000);
-		} else {
-			buffer.append(format.format(time/1000.0));
-		}
-		buffer.append("s"); //$NON-NLS-1$
-	} else if (time < Util.ONE_HOUR) {  // less than 1h
-		buffer.append(time/Util.ONE_MINUTE).append("mn "); //$NON-NLS-1$
-		long seconds = time%Util.ONE_MINUTE;
-		buffer.append(seconds/1000);
-		buffer.append("s"); //$NON-NLS-1$
-	} else {  // more than 1h
-		long h = time / Util.ONE_HOUR;
-		buffer.append(h).append("h "); //$NON-NLS-1$
-		long m = (time % Util.ONE_HOUR) / Util.ONE_MINUTE;
-		buffer.append(m).append("mn "); //$NON-NLS-1$
-		long seconds = m%Util.ONE_MINUTE;
-		buffer.append(seconds/1000);
-		buffer.append("s"); //$NON-NLS-1$
-	}
-	return buffer.toString();
-}
+    /**
+     * Returns a string to display the given time as a duration formatted as:
+     * <ul>
+     * <li>"XXXms" if the duration is less than 0.1s (e.g. "543ms")</li>
+     * <li>"X.YYs" if the duration is less than 1s (e.g. "5.43s")</li>
+     * <li>"XX.Ys" if the duration is less than 1mn (e.g. "54.3s")</li>
+     * <li>"XXmn XXs" if the duration is less than 1h (e.g. "54mn 3s")</li>
+     * <li>"XXh XXmn XXs" if the duration is over than 1h (e.g. "5h 4mn 3s")
+     * </li>
+     * </ul>
+     *
+     * @param time
+     *            The time to format as a long.
+     * @return The formatted string.
+     */
+    public static String timeString(long time) {
+        NumberFormat format = NumberFormat.getInstance();
+        format.setMaximumFractionDigits(1);
+        StringBuffer buffer = new StringBuffer();
+        if (time == 0) {
+            // print nothing
+        }
+        if (time < 100) { // less than 0.1s
+            buffer.append(time);
+            buffer.append("ms"); //$NON-NLS-1$
+        } else if (time < 1000) { // less than 1s
+            if ((time % 100) != 0) {
+                format.setMaximumFractionDigits(2);
+            }
+            buffer.append(format.format(time / 1000.0));
+            buffer.append("s"); //$NON-NLS-1$
+        } else if (time < Util.ONE_MINUTE) { // less than 1mn
+            if ((time % 1000) == 0) {
+                buffer.append(time / 1000);
+            } else {
+                buffer.append(format.format(time / 1000.0));
+            }
+            buffer.append("s"); //$NON-NLS-1$
+        } else if (time < Util.ONE_HOUR) { // less than 1h
+            buffer.append(time / Util.ONE_MINUTE).append("mn "); //$NON-NLS-1$
+            long seconds = time % Util.ONE_MINUTE;
+            buffer.append(seconds / 1000);
+            buffer.append("s"); //$NON-NLS-1$
+        } else { // more than 1h
+            long h = time / Util.ONE_HOUR;
+            buffer.append(h).append("h "); //$NON-NLS-1$
+            long m = (time % Util.ONE_HOUR) / Util.ONE_MINUTE;
+            buffer.append(m).append("mn "); //$NON-NLS-1$
+            long seconds = m % Util.ONE_MINUTE;
+            buffer.append(seconds / 1000);
+            buffer.append("s"); //$NON-NLS-1$
+        }
+        return buffer.toString();
+    }
 
-private Util() {
-	// don't instantiate
-}
+    private Util() {
+        // don't instantiate
+    }
 
-/**
- * Set the milestones.
- *
- * @param items The milestones list (e.g. {@link IPerformancesConstants#V37_MILESTONES}).
- */
-public static void setMilestones(String[] items) {
-	MILESTONES = items;
-}
+    /**
+     * Set the milestones.
+     *
+     * @param items
+     *            The milestones list (e.g.
+     *            {@link IPerformancesConstants#V37_MILESTONES}).
+     */
+    public static void setMilestones(String[] items) {
+        MILESTONES = items;
+    }
 
-/**
- * Init the milestones from preferences
- *
- * @param preferences The preferences from which got milestones list
- */
-public static void initMilestones(IEclipsePreferences preferences) {
-	int eclipseVersion = preferences.getInt(IPerformancesConstants.PRE_ECLIPSE_VERSION, IPerformancesConstants.DEFAULT_ECLIPSE_VERSION);
-	String prefix = IPerformancesConstants.PRE_MILESTONE_BUILDS + "." + eclipseVersion;
-	int index = 0;
-	String milestone = preferences.get(prefix + index, null);
-	String[] milestones = new String[20];
-	while (milestone != null) {
-		milestones[index] = milestone;
-		index++;
-		milestone = preferences.get(prefix + index, null);
-	}
-	int length = milestones.length;
-	if (index < length) {
-		System.arraycopy(milestones, 0, milestones = new String[index], 0, index);
-	}
-	MILESTONES = milestones;
-}
+    /**
+     * Init the milestones from preferences
+     *
+     * @param preferences
+     *            The preferences from which got milestones list
+     */
+    public static void initMilestones(IEclipsePreferences preferences) {
+        int eclipseVersion = preferences.getInt(IPerformancesConstants.PRE_ECLIPSE_VERSION,
+                IPerformancesConstants.DEFAULT_ECLIPSE_VERSION);
+        String prefix = IPerformancesConstants.PRE_MILESTONE_BUILDS + "." + eclipseVersion;
+        int index = 0;
+        String milestone = preferences.get(prefix + index, null);
+        String[] milestones = new String[20];
+        while (milestone != null) {
+            milestones[index] = milestone;
+            index++;
+            milestone = preferences.get(prefix + index, null);
+        }
+        int length = milestones.length;
+        if (index < length) {
+            System.arraycopy(milestones, 0, milestones = new String[index], 0, index);
+        }
+        MILESTONES = milestones;
+    }
 }
diff --git a/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/performance/ui/GenerateResults.java b/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/performance/ui/GenerateResults.java
index dd1b12a..47eb87f 100644
--- a/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/performance/ui/GenerateResults.java
+++ b/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/performance/ui/GenerateResults.java
@@ -29,6 +29,7 @@
 import org.eclipse.core.runtime.SubMonitor;
 import org.eclipse.swt.widgets.Display;
 import org.eclipse.test.internal.performance.results.db.ConfigResults;
+import org.eclipse.test.internal.performance.results.db.DB_Results;
 import org.eclipse.test.internal.performance.results.db.PerformanceResults;
 import org.eclipse.test.internal.performance.results.db.ScenarioResults;
 import org.eclipse.test.internal.performance.results.utils.Util;
@@ -214,6 +215,7 @@
 	while (i < argsLength) {
 		String arg = args[i];
 		if (!arg.startsWith("-")) {
+		    System.err.println("ERROR: Unrecognized argument (arg) found, with value of >" + arg + "<");
 			i++;
 			continue;
 		}
@@ -229,6 +231,7 @@
 			}
 			buffer.append("	-baseline = "+baseline+'\n');
 			i++;
+			i++;
 			continue;
 		}
 		if (arg.equals("-baseline.prefix")) {
@@ -239,6 +242,7 @@
 			}
 			buffer.append("	").append(arg).append(" = ").append(this.baselinePrefix).append('\n');
 			i++;
+			i++;
 			continue;
 		}
 		if (arg.equals("-current.prefix")) {
@@ -256,6 +260,7 @@
 			}
 			buffer.append('\n');
 			i++;
+			i++;
 			continue;
 		}
 		if (arg.equals("-highlight") || arg.equals("-highlight.latest")) {
@@ -269,9 +274,13 @@
 			for (int j = 0; j < ids.length; j++) {
 				this.pointsOfInterest.add(ids[j]);
 				buffer.append(ids[j]);
+				if (j < ids.length - 1) {
+				    buffer.append(",");
+				}
 			}
 			buffer.append('\n');
 			i++;
+			i++;
 			continue;
 		}
 		if (arg.equals("-current")) {
@@ -282,6 +291,7 @@
 			}
 			buffer.append("	").append(arg).append(" = ").append(currentBuildId).append('\n');
 			i++;
+			i++;
 			continue;
 		}
 		if (arg.equals("-jvm")) {
@@ -292,6 +302,7 @@
 			}
 			buffer.append("	").append(arg).append(" = ").append(jvm).append('\n');
 			i++;
+			i++;
 			continue;
 		}
 		if (arg.equals("-output")) {
@@ -303,9 +314,11 @@
 			this.outputDir = new File(dir);
 			if (!this.outputDir.exists() && !this.outputDir.mkdirs()) {
 				System.err.println("Cannot create directory "+dir+" to write results in!");
-				System.exit(2);
+				throw new RuntimeException("Can not create directory " + dir);
+				//System.exit(2);
 			}
 			buffer.append("	").append(arg).append(" = ").append(dir).append('\n');
+			i++;
 			continue;
 		}
 		if (arg.equals("-dataDir")) {
@@ -317,9 +330,11 @@
 			this.dataDir = new File(dir);
 			if (!this.dataDir.exists() && !this.dataDir.mkdirs()) {
 				System.err.println("Cannot create directory "+dir+" to save data locally!");
-				System.exit(2);
+				//System.exit(2);
+				throw new RuntimeException("Can not create directory " + dir);
 			}
 			buffer.append("	").append(arg).append(" = ").append(dir).append('\n');
+			i++;
 			continue;
 		}
 		if (arg.equals("-config")) {
@@ -369,6 +384,7 @@
 			}
 			buffer.append('\n');
 			i++;
+			i++;
 			continue;
 		}
 		if (arg.equals("-config.properties")) {
@@ -399,6 +415,7 @@
 			}
 			buffer.append('\n');
 			i++;
+			i++;
 			continue;
 		}
 		if (arg.equals("-scenario.filter") || arg.equals("-scenario.pattern")) {
@@ -409,6 +426,7 @@
 			}
 			buffer.append("	").append(arg).append(" = ").append(this.scenarioPattern).append('\n');
 			i++;
+			i++;
 			continue;
 		}
 		if (arg.equals("-fingerprints")) {
@@ -433,6 +451,7 @@
 			if (printFile==null ||printFile.startsWith("-")) {
 				buffer.append(" (to the console)").append('\n');
 			} else {
+			    i++;
 				try {
 					this.printStream = new PrintStream(new BufferedOutputStream(new FileOutputStream(printFile)));
 				}
@@ -458,9 +477,13 @@
 			}
 			buffer.append("	").append(arg).append(" = ").append(value).append('\n');
 			i++;
+			i++;
 			continue;
 		}
-		i++;
+		// To get to hear mean "matched none". 
+        System.err.println("ERROR: Unrecognized argument (arg) found, with value of >" + arg + "<");
+        i++;
+        continue;
 	}
 	if (this.printStream != null) {
 		this.printStream.print(buffer.toString());
@@ -581,11 +604,11 @@
 	}
 	stream.print(currentName);
 	stream.print(" relative to ");
-	int index = baselineName.indexOf('_');
+	int index = baselineName.indexOf('-');
 	if (index > 0) {
 		stream.print(baselineName.substring(0, index));
 		stream.print(" (");
-		index = baselineName.lastIndexOf('_');
+		index = baselineName.lastIndexOf('-');
 		stream.print(baselineName.substring(index+1, baselineName.length()));
 		stream.print(')');
 	} else {
@@ -1022,12 +1045,11 @@
 
 	// Init baseline prefix if not set
 	if (this.baselinePrefix == null) {
-		int index = baseline.lastIndexOf('_');
+		int index = baseline.lastIndexOf('-');
 		if (index > 0) {
 			this.baselinePrefix = baseline.substring(0, index);
 		} else {
-//			this.baselinePrefix = DB_Results.getDbBaselinePrefix();
-			this.baselinePrefix = baseline;
+			this.baselinePrefix = DB_Results.getDbBaselinePrefix();
 		}
 	}
 
diff --git a/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/performance/ui/Main.java b/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/performance/ui/Main.java
index 0b04544..43cb18e 100644
--- a/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/performance/ui/Main.java
+++ b/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/performance/ui/Main.java
@@ -9,6 +9,7 @@
 
 package org.eclipse.test.performance.ui;
 
+import org.eclipse.core.runtime.IStatus;
 import org.eclipse.equinox.app.IApplication;
 import org.eclipse.equinox.app.IApplicationContext;
 import org.eclipse.test.internal.performance.results.db.DB_Results;
@@ -48,8 +49,8 @@
                 System.out.println("\t\t>" + args[i] + "<");
             }
         }
-        generation.run(args);
-        return null;
+        IStatus exitStatus = generation.run(args);
+        return exitStatus;
     }
 
     /*
diff --git a/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/performance/ui/ScenarioData.java b/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/performance/ui/ScenarioData.java
index dba5161..113280a 100644
--- a/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/performance/ui/ScenarioData.java
+++ b/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/performance/ui/ScenarioData.java
@@ -105,7 +105,7 @@
 	buildLoop: while (builds.hasNext()) {
 		BuildResults buildResults = (BuildResults) builds.next();
 		String buildID = buildResults.getName();
-		int underscoreIndex = buildID.indexOf('_');
+		int underscoreIndex = buildID.indexOf('-');
 		String label = (underscoreIndex != -1 && buildID.equals(current)) ? buildID.substring(0, underscoreIndex) : buildID;
 		if (buildID.startsWith(defaultBaselinePrefix) && (underscoreIndex != -1)) {
 			label = defaultBaselinePrefix+buildID.charAt(defaultBaselinePrefix.length())+buildID.substring(underscoreIndex);
diff --git a/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/performance/ui/Utils.java b/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/performance/ui/Utils.java
index b76708f..b4d8141 100644
--- a/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/performance/ui/Utils.java
+++ b/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/performance/ui/Utils.java
@@ -8,6 +8,7 @@
  * Contributors:
  *     IBM Corporation - initial API and implementation
  *******************************************************************************/
+
 package org.eclipse.test.performance.ui;
 
 import java.io.BufferedOutputStream;
@@ -33,395 +34,387 @@
 import org.eclipse.test.internal.performance.PerformanceTestPlugin;
 import org.eclipse.test.internal.performance.db.Variations;
 import org.eclipse.test.internal.performance.results.utils.Util;
-import org.eclipse.ui.internal.ide.handlers.BuildProjectHandler;
 import org.osgi.framework.Bundle;
 
-
 public class Utils {
 
-	public final static double STANDARD_ERROR_THRESHOLD = 0.03; // 3%
-	static final NumberFormat PERCENT_FORMAT = NumberFormat.getPercentInstance();
-	static {
-		PERCENT_FORMAT.setMaximumFractionDigits(1);
-	}
-	static final DecimalFormat DEVIATION_FORMAT = (DecimalFormat) NumberFormat.getPercentInstance();
-	static {
-		DEVIATION_FORMAT.setMaximumFractionDigits(1);
-		DEVIATION_FORMAT.setMinimumFractionDigits(1);
-		DEVIATION_FORMAT.setPositivePrefix("+");
-		DEVIATION_FORMAT.setNegativePrefix("- ");
-	}
-	static final DecimalFormat STDERR_FORMAT = (DecimalFormat) NumberFormat.getNumberInstance();
-	static {
-		STDERR_FORMAT.setMaximumFractionDigits(1);
-		STDERR_FORMAT.setMinimumFractionDigits(1);
-		STDERR_FORMAT.setMultiplier(100);
-	}
-	public final static String STANDARD_ERROR_THRESHOLD_STRING = PERCENT_FORMAT.format(STANDARD_ERROR_THRESHOLD);
+    public final static double STANDARD_ERROR_THRESHOLD = 0.03;                             // 3%
+    static final NumberFormat  PERCENT_FORMAT           = NumberFormat.getPercentInstance();
+    static {
+        PERCENT_FORMAT.setMaximumFractionDigits(1);
+    }
+    static final DecimalFormat DEVIATION_FORMAT = (DecimalFormat) NumberFormat.getPercentInstance();
+    static {
+        DEVIATION_FORMAT.setMaximumFractionDigits(1);
+        DEVIATION_FORMAT.setMinimumFractionDigits(1);
+        DEVIATION_FORMAT.setPositivePrefix("+");
+        DEVIATION_FORMAT.setNegativePrefix("- ");
+    }
+    static final DecimalFormat STDERR_FORMAT = (DecimalFormat) NumberFormat.getNumberInstance();
+    static {
+        STDERR_FORMAT.setMaximumFractionDigits(1);
+        STDERR_FORMAT.setMinimumFractionDigits(1);
+        STDERR_FORMAT.setMultiplier(100);
+    }
+    public final static String STANDARD_ERROR_THRESHOLD_STRING = PERCENT_FORMAT.format(STANDARD_ERROR_THRESHOLD);
 
-	// Image files
-	public final static String UNKNOWN_IMAGE="images/Unknown.gif";
-	public final static String OK_IMAGE="images/OK.gif";
-	public final static String OK_IMAGE_WARN="images/OK_caution.gif";
-	public final static String FAIL_IMAGE="images/FAIL.gif";
-	public final static String FAIL_IMAGE_WARN="images/FAIL_caution.gif";
-	public final static String FAIL_IMAGE_EXPLAINED="images/FAIL_greyed.gif";
-	public final static String LIGHT="images/light.gif";
-	public final static String WARNING_OBJ="images/warning_obj.gif";
+    // Image files
+    public final static String UNKNOWN_IMAGE                   = "images/Unknown.gif";
+    public final static String OK_IMAGE                        = "images/OK.gif";
+    public final static String OK_IMAGE_WARN                   = "images/OK_caution.gif";
+    public final static String FAIL_IMAGE                      = "images/FAIL.gif";
+    public final static String FAIL_IMAGE_WARN                 = "images/FAIL_caution.gif";
+    public final static String FAIL_IMAGE_EXPLAINED            = "images/FAIL_greyed.gif";
+    public final static String LIGHT                           = "images/light.gif";
+    public final static String WARNING_OBJ                     = "images/warning_obj.gif";
 
-	// Java script files
-	public final static String TOOLTIP_SCRIPT = "scripts/ToolTip.js";
-	public final static String TOOLTIP_STYLE = "scripts/ToolTip.css";
-	public final static String FINGERPRINT_SCRIPT = "scripts/Fingerprints.js";
+    // Java script files
+    public final static String TOOLTIP_SCRIPT                  = "scripts/ToolTip.js";
+    public final static String TOOLTIP_STYLE                   = "scripts/ToolTip.css";
+    public final static String FINGERPRINT_SCRIPT              = "scripts/Fingerprints.js";
 
-	// Doc files
-	public final static String HELP = "doc/help.html";
+    // Doc files
+    public final static String HELP                            = "doc/help.html";
 
-	// Status
-	public final static int OK = 0;
-	public final static int NAN = 0x1;
-	public final static int ERR = 0x2;
+    // Status
+    public final static int    OK                              = 0;
+    public final static int    NAN                             = 0x1;
+    public final static int    ERR                             = 0x2;
 
-	/**
-	 * Return &lt;html&gt;&lt;head&gt;&lt;meta http-equiv="Content-Type"
-	 *         content="text/html; charset=iso-8859-1"&gt;
-	 */
-	public final static String HTML_OPEN = "<html><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">\n";
+    /**
+     * Return &lt;html&gt;&lt;head&gt;&lt;meta http-equiv="Content-Type"
+     * content="text/html; charset=iso-8859-1"&gt;
+     */
+    public final static String HTML_OPEN                       = "<html><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">\n";
 
-	/**
-	 * Return "&lt;/html&gt;".
-	 */
-	public final static String HTML_CLOSE = "</html>\n";
+    /**
+     * Return "&lt;/html&gt;".
+     */
+    public final static String HTML_CLOSE                      = "</html>\n";
 
-	/**
-	 * Default style-sheet used on eclipse.org
-	 */
+    /**
+     * Default style-sheet used on eclipse.org
+     */
 	public final static String HTML_DEFAULT_CSS = "<style type=\"text/css\">" + "p, table, td, th {  font-family: arial, helvetica, geneva; font-size: 10pt}\n"
 			+ "pre {  font-family: \"Courier New\", Courier, mono; font-size: 10pt}\n" + "h2 { font-family: arial, helvetica, geneva; font-size: 18pt; font-weight: bold ; line-height: 14px}\n"
 			+ "code {  font-family: \"Courier New\", Courier, mono; font-size: 10pt}\n" + "sup {  font-family: arial,helvetica,geneva; font-size: 10px}\n"
 			+ "h3 {  font-family: arial, helvetica, geneva; font-size: 14pt; font-weight: bold}\n" + "li {  font-family: arial, helvetica, geneva; font-size: 10pt}\n"
-			+ "h1 {  font-family: arial, helvetica, geneva; font-size: 28px; font-weight: bold}\n"
-			+ "body {  font-family: arial, helvetica, geneva; font-size: 10pt; clip:   rect(   ); margin-top: 5mm; margin-left: 3mm}\n"
-			+ ".indextop { font-size: x-large;; font-family: Verdana, Arial, Helvetica, sans-serif; font-weight: bold}\n"
-			+ ".indexsub { font-size: xx-small;; font-family: Arial, Helvetica, sans-serif; color: #8080FF}\n" + "</style>\n\n";
+            + "h1 {  font-family: arial, helvetica, geneva; font-size: 28px; font-weight: bold}\n"
+            + "body {  font-family: arial, helvetica, geneva; font-size: 10pt; clip:   rect(   ); margin-top: 5mm; margin-left: 3mm}\n"
+            + ".indextop { font-size: x-large;; font-family: Verdana, Arial, Helvetica, sans-serif; font-weight: bold}\n"
+            + ".indexsub { font-size: xx-small;; font-family: Arial, Helvetica, sans-serif; color: #8080FF}\n" + "</style>\n\n";
 
-	/**
-	 * Creates a Variations object using build id pattern, config and jvm.
-	 *
-	 * @param buildIdPattern
-	 * @param config
-	 * @param jvm
-	 */
-	public static Variations getVariations(String buildIdPattern, String config, String jvm) {
-		String buildIdPatterns = buildIdPattern.replace(',', '%');
-		Variations variations = new Variations();
-		variations.put(PerformanceTestPlugin.CONFIG, config);
-		variations.put(PerformanceTestPlugin.BUILD, buildIdPatterns);
-		variations.put("jvm", jvm);
-		return variations;
-	}
+    /**
+     * Creates a Variations object using build id pattern, config and jvm.
+     *
+     * @param buildIdPattern
+     * @param config
+     * @param jvm
+     */
+    public static Variations getVariations(String buildIdPattern, String config, String jvm) {
+        String buildIdPatterns = buildIdPattern.replace(',', '%');
+        Variations variations = new Variations();
+        variations.put(PerformanceTestPlugin.CONFIG, config);
+        variations.put(PerformanceTestPlugin.BUILD, buildIdPatterns);
+        variations.put("jvm", jvm);
+        return variations;
+    }
 
-	/**
-	 * Copy all bundle files contained in the given path
-	 */
-	public static void copyBundleFiles(Bundle bundle, String path, String pattern, File output) {
-		Enumeration imageFiles = bundle.findEntries(path, pattern, false);
-		while (imageFiles.hasMoreElements()) {
-			URL url = (URL) imageFiles.nextElement();
-			try {
-				File outputFile = new File(output, url.getFile());
-				if (!outputFile.getParentFile().exists()) {
-					outputFile.getParentFile().mkdirs();
-				}
-				Util.copyStream(url.openStream(), outputFile);
+    /**
+     * Copy all bundle files contained in the given path
+     */
+    public static void copyBundleFiles(Bundle bundle, String path, String pattern, File output) {
+        Enumeration imageFiles = bundle.findEntries(path, pattern, false);
+        while (imageFiles.hasMoreElements()) {
+            URL url = (URL) imageFiles.nextElement();
+            try {
+                File outputFile = new File(output, url.getFile());
+                if (!outputFile.getParentFile().exists()) {
+                    outputFile.getParentFile().mkdirs();
+                }
+                Util.copyStream(url.openStream(), outputFile);
 			} catch (IOException e) {
-				// TODO Auto-generated catch block
-				e.printStackTrace();
-			}
-		}
-	}
+                // TODO Auto-generated catch block
+                e.printStackTrace();
+            }
+        }
+    }
 
-	/**
-	 * Downsample Image to 8 bit depth format so that the resulting image data
-	 * can be saved to GIF. Note. If the source image contains photo quality
-	 * content with more than 256 colours, resulting data will look very poor.
-	 */
-	static int closest(RGB[] rgbs, int n, RGB rgb) {
-		int minDist = 256 * 256 * 3;
-		int minIndex = 0;
-		for (int i = 0; i < n; ++i) {
-			RGB rgb2 = rgbs[i];
-			int da = rgb2.red - rgb.red;
-			int dg = rgb2.green - rgb.green;
-			int db = rgb2.blue - rgb.blue;
-			int dist = da * da + dg * dg + db * db;
-			if (dist < minDist) {
-				minDist = dist;
-				minIndex = i;
-			}
-		}
-		return minIndex;
-	}
+    /**
+     * Downsample Image to 8 bit depth format so that the resulting image data
+     * can be saved to GIF. Note. If the source image contains photo quality
+     * content with more than 256 colours, resulting data will look very poor.
+     */
+    static int closest(RGB[] rgbs, int n, RGB rgb) {
+        int minDist = 256 * 256 * 3;
+        int minIndex = 0;
+        for (int i = 0; i < n; ++i) {
+            RGB rgb2 = rgbs[i];
+            int da = rgb2.red - rgb.red;
+            int dg = rgb2.green - rgb.green;
+            int db = rgb2.blue - rgb.blue;
+            int dist = da * da + dg * dg + db * db;
+            if (dist < minDist) {
+                minDist = dist;
+                minIndex = i;
+            }
+        }
+        return minIndex;
+    }
 
-	static class ColorCounter implements Comparable {
-		RGB rgb;
+    static class ColorCounter implements Comparable {
 
-		int count;
+        RGB rgb;
 
-		public int compareTo(Object o) {
-			return ((ColorCounter) o).count - this.count;
-		}
-	}
+        int count;
 
-	public static ImageData downSample(Image image) {
-		ImageData data = image.getImageData();
-		if (!data.palette.isDirect && data.depth <= 8)
-			return data;
+        public int compareTo(Object o) {
+            return ((ColorCounter) o).count - this.count;
+        }
+    }
 
-		// compute a histogram of color frequencies
-		HashMap freq = new HashMap();
-		int width = data.width;
-		int[] pixels = new int[width];
-		int[] maskPixels = new int[width];
-		for (int y = 0, height = data.height; y < height; ++y) {
-			data.getPixels(0, y, width, pixels, 0);
-			for (int x = 0; x < width; ++x) {
-				RGB rgb = data.palette.getRGB(pixels[x]);
-				ColorCounter counter = (ColorCounter) freq.get(rgb);
-				if (counter == null) {
-					counter = new ColorCounter();
-					counter.rgb = rgb;
-					freq.put(rgb, counter);
-				}
-				counter.count++;
-			}
-		}
+    public static ImageData downSample(Image image) {
+        ImageData data = image.getImageData();
+        if (!data.palette.isDirect && data.depth <= 8)
+            return data;
 
-		// sort colors by most frequently used
-		ColorCounter[] counters = new ColorCounter[freq.size()];
-		freq.values().toArray(counters);
-		Arrays.sort(counters);
+        // compute a histogram of color frequencies
+        HashMap freq = new HashMap();
+        int width = data.width;
+        int[] pixels = new int[width];
+        int[] maskPixels = new int[width];
+        for (int y = 0, height = data.height; y < height; ++y) {
+            data.getPixels(0, y, width, pixels, 0);
+            for (int x = 0; x < width; ++x) {
+                RGB rgb = data.palette.getRGB(pixels[x]);
+                ColorCounter counter = (ColorCounter) freq.get(rgb);
+                if (counter == null) {
+                    counter = new ColorCounter();
+                    counter.rgb = rgb;
+                    freq.put(rgb, counter);
+                }
+                counter.count++;
+            }
+        }
 
-		// pick the most frequently used 256 (or fewer), and make a palette
-		ImageData mask = null;
-		if (data.transparentPixel != -1 || data.maskData != null) {
-			mask = data.getTransparencyMask();
-		}
-		int n = Math.min(256, freq.size());
-		RGB[] rgbs = new RGB[n + (mask != null ? 1 : 0)];
-		for (int i = 0; i < n; ++i)
-			rgbs[i] = counters[i].rgb;
-		if (mask != null) {
+        // sort colors by most frequently used
+        ColorCounter[] counters = new ColorCounter[freq.size()];
+        freq.values().toArray(counters);
+        Arrays.sort(counters);
+
+        // pick the most frequently used 256 (or fewer), and make a palette
+        ImageData mask = null;
+        if (data.transparentPixel != -1 || data.maskData != null) {
+            mask = data.getTransparencyMask();
+        }
+        int n = Math.min(256, freq.size());
+        RGB[] rgbs = new RGB[n + (mask != null ? 1 : 0)];
+        for (int i = 0; i < n; ++i)
+            rgbs[i] = counters[i].rgb;
+        if (mask != null) {
 			rgbs[rgbs.length - 1] = data.transparentPixel != -1 ? data.palette.getRGB(data.transparentPixel) : new RGB(255, 255, 255);
-		}
-		PaletteData palette = new PaletteData(rgbs);
+        }
+        PaletteData palette = new PaletteData(rgbs);
 
-		// create a new image using the new palette:
-		// for each pixel in the old image, look up the best matching
-		// index in the new palette
-		ImageData newData = new ImageData(width, data.height, 8, palette);
-		if (mask != null)
-			newData.transparentPixel = rgbs.length - 1;
-		for (int y = 0, height = data.height; y < height; ++y) {
-			data.getPixels(0, y, width, pixels, 0);
-			if (mask != null)
-				mask.getPixels(0, y, width, maskPixels, 0);
-			for (int x = 0; x < width; ++x) {
-				if (mask != null && maskPixels[x] == 0) {
-					pixels[x] = rgbs.length - 1;
-				} else {
-					RGB rgb = data.palette.getRGB(pixels[x]);
-					pixels[x] = closest(rgbs, n, rgb);
-				}
-			}
-			newData.setPixels(0, y, width, pixels, 0);
-		}
-		return newData;
-	}
+        // create a new image using the new palette:
+        // for each pixel in the old image, look up the best matching
+        // index in the new palette
+        ImageData newData = new ImageData(width, data.height, 8, palette);
+        if (mask != null)
+            newData.transparentPixel = rgbs.length - 1;
+        for (int y = 0, height = data.height; y < height; ++y) {
+            data.getPixels(0, y, width, pixels, 0);
+            if (mask != null)
+                mask.getPixels(0, y, width, maskPixels, 0);
+            for (int x = 0; x < width; ++x) {
+                if (mask != null && maskPixels[x] == 0) {
+                    pixels[x] = rgbs.length - 1;
+                } else {
+                    RGB rgb = data.palette.getRGB(pixels[x]);
+                    pixels[x] = closest(rgbs, n, rgb);
+                }
+            }
+            newData.setPixels(0, y, width, pixels, 0);
+        }
+        return newData;
+    }
 
-	/**
-	 * Returns the date/time from the build id in format yyyymmddhm
-	 *
-	 * @param buildId
-	 * @return date/time in format YYYYMMDDHHMM, ie. 200504060010
-	 */
-	public static long getDateFromBuildID(String buildId) {
-		return getDateFromBuildID(buildId, false);
-	}
+    /**
+     * Returns the date/time from the build id in format yyyymmddhm
+     *
+     * @param buildId
+     * @return date/time in format YYYYMMDDHHMM, ie. 200504060010
+     */
+    public static long getDateFromBuildID(String buildId) {
+        return getDateFromBuildID(buildId, false);
+    }
 
-	public static long getDateFromBuildID(String buildId, boolean matchLast) {
-		Calendar calendar = Calendar.getInstance();
+    public static long getDateFromBuildID(String buildId, boolean matchLast) {
+        Calendar calendar = Calendar.getInstance();
 
-		if (buildId.indexOf('_') != -1) {
-			String[] buildIdParts = buildId.split("_");
+        try {
+            if (buildId.indexOf('-') > -1) {
+                // if regular build, expect <buildType><date>-<time> format
+                String[] buildIdParts = buildId.split("-");
+                // two parts are from IDs such as I20140606-1215, so skip first
+                // char, and hour and second are in second part.
+                if (buildIdParts.length == 2) {
+                    int year = Integer.parseInt(buildIdParts[0].substring(1, 5));
+                    int month = Integer.parseInt(buildIdParts[0].substring(5, 7));
+                    int date = Integer.parseInt(buildIdParts[0].substring(7, 9));
+                    int hours = Integer.parseInt(buildIdParts[1].substring(0, 2));
+                    int min = Integer.parseInt(buildIdParts[1].substring(2, 4));
+                    calendar.set(year, month, date, hours, min);
+                } else if (buildIdParts.length == 3) {
+                    // three parts, such a from R-4.5-201506032000, so only
+                    // part[2] is date
+                    int year = Integer.parseInt(buildIdParts[2].substring(0, 4));
+                    int month = Integer.parseInt(buildIdParts[2].substring(4, 6));
+                    int date = Integer.parseInt(buildIdParts[2].substring(6, 8));
+                    int hours = Integer.parseInt(buildIdParts[2].substring(8, 10));
+                    int min = Integer.parseInt(buildIdParts[2].substring(10, 12));
+                    calendar.set(year, month, date, hours, min);
+                } else {
+                    System.err.println("ERROR: BuildId where number of build parts (based on split(\"-\")) was neither 2 nor 3 parts. Unexpected data. BuildId: biuldId");
+                }
+                return calendar.getTimeInMillis();
+            }
+            System.err.println("ERROR: BuildId with on '-' found. BuildId: buildId. Unexpected data.");
+        }
+        catch (StringIndexOutOfBoundsException e) {
+            System.err.println("ERROR: StringIndexOutofBoundsExeception while processing Date part of buildId, " + buildId
+                    + ". Probably due to error in data in database?");
+            // Do nothing, but return '-1'
+        }
+        return -1;
+    }
 
-			int buildIdSegment = 1;
-			if (matchLast)
-				buildIdSegment = buildIdParts.length - 1;
-			// if release build, expect <release>_<release date and
-			// timestamp>_<date and timestamp test ran>
-			// use test date and time for plotting
-			int year = Integer.parseInt(buildIdParts[buildIdSegment].substring(0, 4));
-			int month = Integer.parseInt(buildIdParts[buildIdSegment].substring(4, 6)) - 1;
-			int date = Integer.parseInt(buildIdParts[buildIdSegment].substring(6, 8));
-			int hours = Integer.parseInt(buildIdParts[buildIdSegment].substring(8, 10));
-			int min = Integer.parseInt(buildIdParts[buildIdSegment].substring(10, 12));
-
-			calendar.set(year, month, date, hours, min);
-			return calendar.getTimeInMillis();
-
-		} else if (buildId.indexOf('-') != -1) {
-			// if regular build, expect <buildType><date>-<time> format
-			String[] buildIdParts = buildId.split("-");
-			// two parts are from IDs such as I20140606-1215, so skip first char, and hour and second are in second part.
-			if (buildIdParts.length == 2) {
-			int year = Integer.parseInt(buildIdParts[0].substring(1, 5));
-			int month = Integer.parseInt(buildIdParts[0].substring(5, 7));
-			int date = Integer.parseInt(buildIdParts[0].substring(7, 9));
-			int hours = Integer.parseInt(buildIdParts[1].substring(0, 2));
-			int min = Integer.parseInt(buildIdParts[1].substring(2, 4));
-			calendar.set(year, month, date, hours, min);
-			} else if (buildIdParts.length == 3) {
-			    // three parts, such a from R-4.4-201406061215, so only part[2] is date
-	            int year = Integer.parseInt(buildIdParts[2].substring(0, 4));
-	            int month = Integer.parseInt(buildIdParts[2].substring(4, 6));
-	            int date = Integer.parseInt(buildIdParts[2].substring(6, 8));
-	            int hours = Integer.parseInt(buildIdParts[2].substring(8, 10));
-	            int min = Integer.parseInt(buildIdParts[2].substring(10, 12));
-	            calendar.set(year, month, date, hours, min);			    
-			}
-			return calendar.getTimeInMillis();
-		}
-
-		return -1;
-	}
-
-	/**
-	 * Returns a message corresponding to given statistics.
-	 *
+    /**
+     * Returns a message corresponding to given statistics.
+     *
 	 * @param resultStats The value with its standard error
-	 * @param full
-	 * @return The failure message. May be empty if stats are good...
-	 */
-	public static String failureMessage(double[] resultStats, boolean full) {
-		StringBuffer buffer = new StringBuffer();
-		int level = confidenceLevel(resultStats);
-//		boolean isWarn = (level & WARN) != 0;
-		boolean isErr = (level & ERR) != 0;
-		if (full) {
-			if (isErr) {
-				buffer.append("*** WARNING ***  ");
+     * @param full
+     * @return The failure message. May be empty if stats are good...
+     */
+    public static String failureMessage(double[] resultStats, boolean full) {
+        StringBuffer buffer = new StringBuffer();
+        int level = confidenceLevel(resultStats);
+        // boolean isWarn = (level & WARN) != 0;
+        boolean isErr = (level & ERR) != 0;
+        if (full) {
+            if (isErr) {
+                buffer.append("*** WARNING ***  ");
 	 			buffer.append(Messages.bind(Messages.standardError, PERCENT_FORMAT.format(resultStats[1]), STANDARD_ERROR_THRESHOLD_STRING));
-			}
-			return buffer.toString();
-		}
-		if (resultStats != null) {
-			double deviation = resultStats[0];
-			buffer.append("<font color=\"#0000FF\" size=\"1\">");
-			if (Double.isNaN(deviation) || Double.isInfinite(deviation)) {
-	 			buffer.append(" [n/a]");
- 			} else {
-				double stderr = resultStats[1];
-				deviation = Math.abs(deviation)<0.001 ? 0 : -deviation;
-	 			if (Double.isNaN(stderr) || Double.isInfinite(stderr)) {
-		 			buffer.append(DEVIATION_FORMAT.format(deviation));
-					buffer.append("</font><font color=\"#DDDD00\" size=\"1\"> ");
-		 			buffer.append(" [n/a]");
-	 			} else {
-		 			buffer.append(DEVIATION_FORMAT.format(deviation));
-	 				buffer.append(" [&#177;");
-	 				buffer.append(STDERR_FORMAT.format(Math.abs(stderr)));
-	 				buffer.append(']');
-	 			}
- 			}
-			buffer.append("</font>");
-		}
-		return buffer.toString();
-	}
+            }
+            return buffer.toString();
+        }
+        if (resultStats != null) {
+            double deviation = resultStats[0];
+            buffer.append("<font color=\"#0000FF\" size=\"1\">");
+            if (Double.isNaN(deviation) || Double.isInfinite(deviation)) {
+                buffer.append(" [n/a]");
+            } else {
+                double stderr = resultStats[1];
+                deviation = Math.abs(deviation) < 0.001 ? 0 : -deviation;
+                if (Double.isNaN(stderr) || Double.isInfinite(stderr)) {
+                    buffer.append(DEVIATION_FORMAT.format(deviation));
+                    buffer.append("</font><font color=\"#DDDD00\" size=\"1\"> ");
+                    buffer.append(" [n/a]");
+                } else {
+                    buffer.append(DEVIATION_FORMAT.format(deviation));
+                    buffer.append(" [&#177;");
+                    buffer.append(STDERR_FORMAT.format(Math.abs(stderr)));
+                    buffer.append(']');
+                }
+            }
+            buffer.append("</font>");
+        }
+        return buffer.toString();
+    }
 
-	/**
-	 * Returns the confidence level for given statistics:
-	 * <ul>
-	 * <li>{@link #NAN}: if the value is infinite or not a number</li>
+    /**
+     * Returns the confidence level for given statistics:
+     * <ul>
+     * <li>{@link #NAN}: if the value is infinite or not a number</li>
 	 * <li>{@link #ERR}: if the standard error is over the expected threshold ({@link #STANDARD_ERROR_THRESHOLD})</li>
-	 * <li>{@link #OK}: in all other cases</li>
-	 * </ul>
-	 *
+     * <li>{@link #OK}: in all other cases</li>
+     * </ul>
+     *
 	 * @param resultStats array of 2 doubles, the former is the average value and
 	 * 	the latter is the standard error made while computing the average.
 	 * @return a value telling caller the level of confidence of the provided value
-	 */
-	public static int confidenceLevel(double[] resultStats) {
-		int level = OK;
- 		if (resultStats != null){
-			if (Double.isNaN(resultStats[0]) || Double.isInfinite(resultStats[0])) {
-				level = NAN;
- 			} else {
+     */
+    public static int confidenceLevel(double[] resultStats) {
+        int level = OK;
+        if (resultStats != null) {
+            if (Double.isNaN(resultStats[0]) || Double.isInfinite(resultStats[0])) {
+                level = NAN;
+            } else {
 //	 			if (resultStats[1] >= (STANDARD_ERROR_THRESHOLD/2)) { // warns standard error higher than the half of authorized threshold
-//	 				level |= WARN;
-//	 			}
+                // level |= WARN;
+                // }
 	 			if (resultStats[1] >= STANDARD_ERROR_THRESHOLD) { // standard error higher than the authorized threshold
-	 				level = ERR;
-	 			}
- 			}
- 		}
-		return level;
-	}
-
-	/**
-	 * Get an icon image corresponding to a given level of confidence and explanation.
-	 *
-	 * @param confidence the confiden level
-	 * @param hasExplanation flags indicates whether the confidence may be tempered by an explanation
-	 * @return Corresponding image
-	 */
-	public static String getImage(int confidence, boolean scenarioFailed, boolean hasExplanation) {
-	    String image = null;
-
-	    if (scenarioFailed) {
-	    	if (hasExplanation) {
-		    	image = FAIL_IMAGE_EXPLAINED;
-		    } else if ((confidence & ERR) != 0) {
-    			image = FAIL_IMAGE_WARN;
-		    } else {
-    			image = FAIL_IMAGE;
-		    }
-	    } else if ((confidence & NAN) != 0) {
-			image = UNKNOWN_IMAGE;
-	    } else if ((confidence & ERR) != 0) {
-	   		image = OK_IMAGE_WARN;
-	    } else {
-   			image = OK_IMAGE;
-	    }
-	    return image;
+                    level = ERR;
+                }
+            }
+        }
+        return level;
     }
 
-/**
- * @param outputFile
- * @param image
- */
-public static void saveImage(File outputFile, Image image) {
-	// Save image
-	ImageData data = downSample(image);
-	ImageLoader imageLoader = new ImageLoader();
-	imageLoader.data = new ImageData[] { data };
+    /**
+	 * Get an icon image corresponding to a given level of confidence and explanation.
+     *
+	 * @param confidence the confiden level
+	 * @param hasExplanation flags indicates whether the confidence may be tempered by an explanation
+     * @return Corresponding image
+     */
+    public static String getImage(int confidence, boolean scenarioFailed, boolean hasExplanation) {
+        String image = null;
 
-	OutputStream out = null;
-	try {
-		out = new BufferedOutputStream(new FileOutputStream(outputFile));
-		imageLoader.save(out, SWT.IMAGE_GIF);
+        if (scenarioFailed) {
+            if (hasExplanation) {
+                image = FAIL_IMAGE_EXPLAINED;
+            } else if ((confidence & ERR) != 0) {
+                image = FAIL_IMAGE_WARN;
+            } else {
+                image = FAIL_IMAGE;
+            }
+        } else if ((confidence & NAN) != 0) {
+            image = UNKNOWN_IMAGE;
+        } else if ((confidence & ERR) != 0) {
+            image = OK_IMAGE_WARN;
+        } else {
+            image = OK_IMAGE;
+        }
+        return image;
+    }
+
+    /**
+     * @param outputFile
+     * @param image
+     */
+    public static void saveImage(File outputFile, Image image) {
+        // Save image
+        ImageData data = downSample(image);
+        ImageLoader imageLoader = new ImageLoader();
+        imageLoader.data = new ImageData[] { data };
+
+        OutputStream out = null;
+        try {
+            out = new BufferedOutputStream(new FileOutputStream(outputFile));
+            imageLoader.save(out, SWT.IMAGE_GIF);
 	} catch (FileNotFoundException e) {
-		e.printStackTrace();
+            e.printStackTrace();
 	} finally {
-		image.dispose();
-		if (out != null) {
-			try {
-				out.close();
+            image.dispose();
+            if (out != null) {
+                try {
+                    out.close();
 			} catch (IOException e1) {
-				// silently ignored
-			}
-		}
-	}
-}
+                    // silently ignored
+                }
+            }
+        }
+    }
 
-}
\ No newline at end of file
+}