Use try with resources in tests.performance.ui.

Change-Id: I91a1cca7e014d132bd06452a5b31edc6d965a530
Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
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 8994351..51a2a49 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
@@ -270,10 +270,9 @@
 //	if (!dir.exists()) return null;
 	File dataFile = new File(dir, getName()+".dat");	//$NON-NLS-1$
 	if (!dataFile.exists()) throw new FileNotFoundException();
-	DataInputStream stream = null;
-	try {
+	try (DataInputStream stream = new DataInputStream(new BufferedInputStream(new FileInputStream(dataFile)));) {
 		// Read local file info
-		stream = new DataInputStream(new BufferedInputStream(new FileInputStream(dataFile)));
+
 		print(" - read local files info"); //$NON-NLS-1$
 		String lastBuildName = stream.readUTF(); // first string is the build name
 
@@ -309,14 +308,6 @@
 		return lastBuildName;
 	} catch (IOException ioe) {
 		println("	!!! "+dataFile+" should be deleted as it contained invalid data !!!"); //$NON-NLS-1$ //$NON-NLS-2$
-	} finally {
-		try {
-		    if (stream != null) {
-	        stream.close();
-		    }
-        } catch (IOException e) {
-	        // nothing else to do!
-        }
 	}
 	return null;
 }
@@ -428,9 +419,8 @@
 		}
 		file = dataFile;
 	}
-	try {
-		DataOutputStream stream = new DataOutputStream(new BufferedOutputStream(new FileOutputStream(file)));
-		try {
+
+		try (DataOutputStream stream = new DataOutputStream(new BufferedOutputStream(new FileOutputStream(file)))){
 			int size = this.children.size();
 			stream.writeUTF(lastBuildName(0));
 			stream.writeInt(size);
@@ -438,16 +428,14 @@
 				ScenarioResults scenarioResults = (ScenarioResults) this.children.get(i);
 				scenarioResults.write(stream);
 			}
-		}
-		finally {
-			stream.close();
-			println("	=> extracted data "+(temp?"temporarily ":"")+"written in file "+file); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-		}
+
 	} catch (FileNotFoundException e) {
 		System.err.println("can't create output file"+file); //$NON-NLS-1$
 	} catch (IOException e) {
 		e.printStackTrace();
-	}
+	} finally {
+    println(" => extracted data "+(temp?"temporarily ":"")+"written in file "+file); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+  }
 }
 
 }
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 41e5459..ee4e190 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
@@ -708,7 +708,7 @@
  * @return The list of all scenarios matching the pattern for a given build.
  * @see #internalQueryBuildScenarios(String, String)
  */
-public static List getScenarios() {
+public static List<String> getScenarios() {
 	return Arrays.asList(SCENARII);
 }
 
@@ -973,10 +973,9 @@
 	if (COMMENTS != null) return;
 	long start = System.currentTimeMillis();
 	if (DEBUG) DEBUG_WRITER.print("		[DB query all comments..."); //$NON-NLS-1$
-	ResultSet result = null;
-	try {
-		String[] comments = null;
-		result = this.fSQL.queryAllComments();
+	String[] comments = null;
+	try (ResultSet result = this.fSQL.queryAllComments();){
+
 		while (result.next()) {
 			int commentID = result.getInt(1);
 			// Ignore kind as there's only one
@@ -994,13 +993,6 @@
 	} catch (SQLException e) {
 		PerformanceTestPlugin.log(e);
 	} finally {
-		if (result != null) {
-			try {
-				result.close();
-			} catch (SQLException e1) {
-				// ignored
-			}
-		}
 		if (DEBUG) DEBUG_WRITER.println("done in " + (System.currentTimeMillis() - start) + "ms]"); //$NON-NLS-1$ //$NON-NLS-2$
 	}
 }
@@ -1016,12 +1008,10 @@
 		DEBUG_WRITER.print("	- DB query all variations for configuration pattern: "+configPattern); //$NON-NLS-1$
 		DEBUG_WRITER.print("..."); //$NON-NLS-1$
 	}
-	ResultSet result = null;
-	try {
-		CONFIGS = null;
-		BUILDS = null;
-		BUILDS_LENGTH = 0;
-		result = this.fSQL.queryAllVariations(configPattern);
+	CONFIGS = null;
+	BUILDS = null;
+	BUILDS_LENGTH = 0;
+	try (ResultSet result = this.fSQL.queryAllVariations(configPattern);){
 		while (result.next()) {
 			String variation = result.getString(1); //  something like "||build=I20070615-1200||config=eclipseperfwin2_R3.3||jvm=sun|"
 			StringTokenizer tokenizer = new StringTokenizer(variation, "=|"); //$NON-NLS-1$
@@ -1038,13 +1028,6 @@
 	} catch (SQLException e) {
 		PerformanceTestPlugin.log(e);
 	} finally {
-		if (result != null) {
-			try {
-				result.close();
-			} catch (SQLException e1) {
-				// ignored
-			}
-		}
 		if (DEBUG) DEBUG_WRITER.println("done in " + (System.currentTimeMillis() - start) + "ms]"); //$NON-NLS-1$ //$NON-NLS-2$
 	}
 }
@@ -1067,7 +1050,7 @@
 		}
 		int previousId = -1;
 		List scenarios = null;
-		List scenariosNames = new ArrayList();
+		List<String> scenariosNames = new ArrayList();
 		while (result.next()) {
 			int id = result.getInt(1);
 			String name = result.getString(2);
@@ -1156,11 +1139,10 @@
 		DEBUG_WRITER.print("	- DB query all summaries for scenario '"+scenarioResults.getShortName()+"' of '"+config+"' config"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
 	}
 	internalQueryAllComments();
-	ResultSet result = null;
-	try {
-		int scenarioID = scenarioResults.getId();
+	int scenarioID = scenarioResults.getId();
+	try (ResultSet result = this.fSQL.queryScenarioSummaries(scenarioID, config, builds)){
 		// First try to get summaries of elapsed process dimension
-		result = this.fSQL.queryScenarioSummaries(scenarioID, config, builds);
+
 		while (result.next()) {
 			String variation = result.getString(1); //  something like "|build=I20070615-1200||config=eclipseperfwin2_R3.3||jvm=sun|"
 			int summaryKind = result.getShort(2);
@@ -1180,13 +1162,6 @@
 	} catch (SQLException e) {
 		PerformanceTestPlugin.log(e);
 	} finally {
-		if (result != null) {
-			try {
-				result.close();
-			} catch (SQLException e1) {
-				// ignored
-			}
-		}
 		if (DEBUG) DEBUG_WRITER.println("done in " + (System.currentTimeMillis() - start) + "ms]"); //$NON-NLS-1$ //$NON-NLS-2$
 	}
 }
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 33e592e..7576f44 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
@@ -225,110 +225,104 @@
 	boolean values = (kind & IPerformancesConstants.STATUS_VALUES) != 0;
 	// Write status only for component with error
 	StringBuffer excluded = new StringBuffer();
-	try {
-		DataOutputStream stream = new DataOutputStream(new BufferedOutputStream(new FileOutputStream(resultsFile)));
-		try {
-			StringBuffer buffer = new StringBuffer();
-			// Print build name
-			buffer.append("Status for ");
-			buffer.append(getPerformanceResults().getName());
-			buffer.append(Util.LINE_SEPARATOR);
-			// Print status options
-			if ((kind & ~IPerformancesConstants.STATUS_VALUES) > 0) {
-				buffer.append("Options: ");
-				buffer.append(Util.LINE_SEPARATOR);
-				final int errorLevel = kind & IPerformancesConstants.STATUS_ERROR_LEVEL_MASK;
-				if (errorLevel != 0) {
-					buffer.append("	error level: ");
-					switch (errorLevel) {
-						case IPerformancesConstants.STATUS_ERROR_NONE:
-							buffer.append("include all failures whatever the error level is");
-							break;
-						case IPerformancesConstants.STATUS_ERROR_NOTICEABLE:
-							buffer.append("all failures with at least a noticeable error (> 3%) are excluded!");
-							break;
-						case IPerformancesConstants.STATUS_ERROR_SUSPICIOUS:
-							buffer.append("all failures with at least a suspicious error (> 25%) are excluded!");
-							break;
-						case IPerformancesConstants.STATUS_ERROR_WEIRD:
-							buffer.append("all failures with at least a weird error (> 50%) are excluded!");
-							break;
-						case IPerformancesConstants.STATUS_ERROR_INVALID:
-							buffer.append("all failures with an invalid error (> 100%) are excluded!");
-							break;
-					}
-					buffer.append(Util.LINE_SEPARATOR);
-				}
-				final int smallValue = kind & IPerformancesConstants.STATUS_SMALL_VALUE_MASK;
-				if (smallValue > 0) {
-					buffer.append("	small value: ");
-					switch (smallValue) {
-						case IPerformancesConstants.STATUS_SMALL_VALUE_BUILD:
-							buffer.append("all failures with a small build value (<100ms) are excluded!");
-							break;
-						case IPerformancesConstants.STATUS_SMALL_VALUE_DELTA:
-							buffer.append("all failures with a small delta value (<100ms) are excluded!");
-							break;
-						case IPerformancesConstants.STATUS_SMALL_VALUE_MASK:
-							buffer.append("all failures with a small build or delta value (<100ms) are excluded!");
-							break;
-					}
-					buffer.append(Util.LINE_SEPARATOR);
-				}
-				final int stats = kind & IPerformancesConstants.STATUS_STATISTICS_MASK;
-				if (stats > 0) {
-					buffer.append("	statistics: ");
-					switch (stats) {
-						case IPerformancesConstants.STATUS_STATISTICS_ERRATIC:
-							buffer.append("all failures with erratic baseline results (variation > 20%) are excluded!");
-							break;
-						case IPerformancesConstants.STATUS_STATISTICS_UNSTABLE:
-							buffer.append("all failures with unstable baseline results (10% < variation < 20%) are excluded!");
-							break;
-					}
-					buffer.append(Util.LINE_SEPARATOR);
-				}
-				int buildsNumber = kind & IPerformancesConstants.STATUS_BUILDS_NUMBER_MASK;
-				buffer.append("	builds to confirm a regression: ");
-				buffer.append(buildsNumber);
-				buffer.append(Util.LINE_SEPARATOR);
-			}
-			// Print columns title
-			buffer.append("Component");
-			buffer.append("	Scenario");
-			buffer.append("	Machine");
-			if (values) {
-				buffer.append("			Build		");
-				buffer.append("		History		");
-			}
-			buffer.append("	Comment");
-			buffer.append(Util.LINE_SEPARATOR);
-			if (values) {
-				buffer.append("			value");
-				buffer.append("	baseline");
-				buffer.append("	variation");
-				buffer.append("	delta");
-				buffer.append("	error");
-				buffer.append("	n");
-				buffer.append("	mean");
-				buffer.append("	deviation");
-				buffer.append("	coeff");
-				buffer.append(Util.LINE_SEPARATOR);
-			}
-			stream.write(buffer.toString().getBytes());
-			StringBuffer componentBuffer = getFailures(new StringBuffer(), kind, excluded);
-			if (componentBuffer.length() > 0) {
-				stream.write(componentBuffer.toString().getBytes());
-			}
-		}
-		finally {
-			stream.close();
-		}
-	} catch (FileNotFoundException e) {
-		System.err.println("Can't create output file"+resultsFile); //$NON-NLS-1$
-	} catch (IOException e) {
-		e.printStackTrace();
-	}
+  try (DataOutputStream stream = new DataOutputStream(new BufferedOutputStream(new FileOutputStream(resultsFile)))) {
+    StringBuffer buffer = new StringBuffer();
+    // Print build name
+    buffer.append("Status for ");
+    buffer.append(getPerformanceResults().getName());
+    buffer.append(Util.LINE_SEPARATOR);
+    // Print status options
+    if ((kind & ~IPerformancesConstants.STATUS_VALUES) > 0) {
+      buffer.append("Options: ");
+      buffer.append(Util.LINE_SEPARATOR);
+      final int errorLevel = kind & IPerformancesConstants.STATUS_ERROR_LEVEL_MASK;
+      if (errorLevel != 0) {
+        buffer.append("	error level: ");
+        switch (errorLevel) {
+          case IPerformancesConstants.STATUS_ERROR_NONE:
+            buffer.append("include all failures whatever the error level is");
+            break;
+          case IPerformancesConstants.STATUS_ERROR_NOTICEABLE:
+            buffer.append("all failures with at least a noticeable error (> 3%) are excluded!");
+            break;
+          case IPerformancesConstants.STATUS_ERROR_SUSPICIOUS:
+            buffer.append("all failures with at least a suspicious error (> 25%) are excluded!");
+            break;
+          case IPerformancesConstants.STATUS_ERROR_WEIRD:
+            buffer.append("all failures with at least a weird error (> 50%) are excluded!");
+            break;
+          case IPerformancesConstants.STATUS_ERROR_INVALID:
+            buffer.append("all failures with an invalid error (> 100%) are excluded!");
+            break;
+        }
+        buffer.append(Util.LINE_SEPARATOR);
+      }
+      final int smallValue = kind & IPerformancesConstants.STATUS_SMALL_VALUE_MASK;
+      if (smallValue > 0) {
+        buffer.append("	small value: ");
+        switch (smallValue) {
+          case IPerformancesConstants.STATUS_SMALL_VALUE_BUILD:
+            buffer.append("all failures with a small build value (<100ms) are excluded!");
+            break;
+          case IPerformancesConstants.STATUS_SMALL_VALUE_DELTA:
+            buffer.append("all failures with a small delta value (<100ms) are excluded!");
+            break;
+          case IPerformancesConstants.STATUS_SMALL_VALUE_MASK:
+            buffer.append("all failures with a small build or delta value (<100ms) are excluded!");
+            break;
+        }
+        buffer.append(Util.LINE_SEPARATOR);
+      }
+      final int stats = kind & IPerformancesConstants.STATUS_STATISTICS_MASK;
+      if (stats > 0) {
+        buffer.append("	statistics: ");
+        switch (stats) {
+          case IPerformancesConstants.STATUS_STATISTICS_ERRATIC:
+            buffer.append("all failures with erratic baseline results (variation > 20%) are excluded!");
+            break;
+          case IPerformancesConstants.STATUS_STATISTICS_UNSTABLE:
+            buffer.append("all failures with unstable baseline results (10% < variation < 20%) are excluded!");
+            break;
+        }
+        buffer.append(Util.LINE_SEPARATOR);
+      }
+      int buildsNumber = kind & IPerformancesConstants.STATUS_BUILDS_NUMBER_MASK;
+      buffer.append("	builds to confirm a regression: ");
+      buffer.append(buildsNumber);
+      buffer.append(Util.LINE_SEPARATOR);
+    }
+    // Print columns title
+    buffer.append("Component");
+    buffer.append("	Scenario");
+    buffer.append("	Machine");
+    if (values) {
+      buffer.append("			Build		");
+      buffer.append("		History		");
+    }
+    buffer.append("	Comment");
+    buffer.append(Util.LINE_SEPARATOR);
+    if (values) {
+      buffer.append("			value");
+      buffer.append("	baseline");
+      buffer.append("	variation");
+      buffer.append("	delta");
+      buffer.append("	error");
+      buffer.append("	n");
+      buffer.append("	mean");
+      buffer.append("	deviation");
+      buffer.append("	coeff");
+      buffer.append(Util.LINE_SEPARATOR);
+    }
+    stream.write(buffer.toString().getBytes());
+    StringBuffer componentBuffer = getFailures(new StringBuffer(), kind, excluded);
+    if (componentBuffer.length() > 0) {
+      stream.write(componentBuffer.toString().getBytes());
+    }
+  } catch (FileNotFoundException e) {
+    System.err.println("Can't create output file" + resultsFile); //$NON-NLS-1$
+  } catch (IOException e) {
+    e.printStackTrace();
+  }
 	return excluded;
 }
 
diff --git a/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/performance/ui/FingerPrint.java b/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/performance/ui/FingerPrint.java
index bca093a..11fac99 100644
--- a/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/performance/ui/FingerPrint.java
+++ b/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/performance/ui/FingerPrint.java
@@ -12,7 +12,6 @@
 
 import java.io.BufferedOutputStream;
 import java.io.File;
-import java.io.FileNotFoundException;
 import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.OutputStream;
@@ -212,21 +211,12 @@
 	ImageLoader imageLoader = new ImageLoader();
 	imageLoader.data = new ImageData[] { data };
 
-	OutputStream out = null;
-	try {
-		out = new BufferedOutputStream(new FileOutputStream(outputFile));
+	try (OutputStream out = new BufferedOutputStream(new FileOutputStream(outputFile))){
 		imageLoader.save(out, SWT.IMAGE_GIF);
-	} catch (FileNotFoundException e) {
+	} catch (IOException e) {
 		e.printStackTrace();
 	} finally {
 		image.dispose();
-		if (out != null) {
-			try {
-				out.close();
-			} catch (IOException e1) {
-				// silently ignored
-			}
-		}
 	}
 }
 }
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 47e5a3d..079b6a3 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
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2010 IBM Corporation and others.
+ * Copyright (c) 2000, 2017 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -504,56 +504,56 @@
 private void printComponent(/*PerformanceResults performanceResults, */String component) throws FileNotFoundException {
 	if (this.printStream != null) this.printStream.print(".");
 	File outputFile = new File(this.outputDir, component + ".php");
-	PrintStream stream = new PrintStream(new BufferedOutputStream(new FileOutputStream(outputFile)));
+  try (PrintStream stream = new PrintStream(new BufferedOutputStream(new FileOutputStream(outputFile)))) {
 
-	// Print header
-	boolean isGlobal = component.startsWith("global");
-	if (isGlobal) {
-		File globalFile = new File(this.outputDir, "global.php");
-		PrintStream gStream = new PrintStream(new BufferedOutputStream(new FileOutputStream(globalFile)));
-		gStream.print(Utils.HTML_OPEN);
-		gStream.print("</head>\n");
-		gStream.print("<body>\n");
-		gStream.print("<?php\n");
-		gStream.print("	include(\"global_fp.php\");\n");
-		gStream.print("?>\n");
-		gStream.print("<table border=0 cellpadding=2 cellspacing=5 width=\"100%\">\n");
-		gStream.print("<tbody><tr> <td colspan=3 align=\"left\" bgcolor=\"#0080c0\" valign=\"top\"><b><font color=\"#ffffff\" face=\"Arial,Helvetica\">\n");
-		gStream.print("Detailed performance data grouped by scenario prefix</font></b></td></tr></tbody></table>\n");
-		gStream.print("<a href=\"org.eclipse.ant.php?\">org.eclipse.ant*</a><br>\n");
-		gStream.print("<a href=\"org.eclipse.compare.php?\">org.eclipse.compare*</a><br>\n");
-		gStream.print("<a href=\"org.eclipse.core.php?\">org.eclipse.core*</a><br>\n");
-		gStream.print("<a href=\"org.eclipse.jdt.core.php?\">org.eclipse.jdt.core*</a><br>\n");
-		gStream.print("<a href=\"org.eclipse.jdt.debug.php?\">org.eclipse.jdt.debug*</a><br>\n");
-		gStream.print("<a href=\"org.eclipse.jdt.text.php?\">org.eclipse.jdt.text*</a><br>\n");
-		gStream.print("<a href=\"org.eclipse.jdt.ui.php?\">org.eclipse.jdt.ui*</a><br>\n");
-		gStream.print("<a href=\"org.eclipse.jface.php?\">org.eclipse.jface*</a><br>\n");
-		gStream.print("<a href=\"org.eclipse.osgi.php?\">org.eclipse.osgi*</a><br>\n");
-		gStream.print("<a href=\"org.eclipse.pde.api.tools.php?\">org.eclipse.pde.api.tools*</a><br>\n");
-		gStream.print("<a href=\"org.eclipse.pde.ui.php?\">org.eclipse.pde.ui*</a><br>\n");
-		gStream.print("<a href=\"org.eclipse.swt.php?\">org.eclipse.swt*</a><br>\n");
-		gStream.print("<a href=\"org.eclipse.team.php?\">org.eclipse.team*</a><br>\n");
-		gStream.print("<a href=\"org.eclipse.ua.php?\">org.eclipse.ua*</a><br>\n");
-		gStream.print("<a href=\"org.eclipse.ui.php?\">org.eclipse.ui*</a><br><p><br><br>\n");
-		gStream.print("</body>\n");
-		gStream.print(Utils.HTML_CLOSE);
-		gStream.close();
-	} else {
-		stream.print(Utils.HTML_OPEN);
-	}
-	stream.print("<link href=\""+Utils.TOOLTIP_STYLE+"\" rel=\"stylesheet\" type=\"text/css\">\n");
-	stream.print("<script src=\""+Utils.TOOLTIP_SCRIPT+"\"></script>\n");
-	stream.print("<script src=\""+Utils.FINGERPRINT_SCRIPT+"\"></script>\n");
-	stream.print(Utils.HTML_DEFAULT_CSS);
+    // Print header
+    boolean isGlobal = component.startsWith("global");
+    if (isGlobal) {
+      File globalFile = new File(this.outputDir, "global.php");
+      try (PrintStream gStream = new PrintStream(new BufferedOutputStream(new FileOutputStream(globalFile)))) {
+        gStream.print(Utils.HTML_OPEN);
+        gStream.print("</head>\n");
+        gStream.print("<body>\n");
+        gStream.print("<?php\n");
+        gStream.print("	include(\"global_fp.php\");\n");
+        gStream.print("?>\n");
+        gStream.print("<table border=0 cellpadding=2 cellspacing=5 width=\"100%\">\n");
+        gStream.print("<tbody><tr> <td colspan=3 align=\"left\" bgcolor=\"#0080c0\" valign=\"top\"><b><font color=\"#ffffff\" face=\"Arial,Helvetica\">\n");
+        gStream.print("Detailed performance data grouped by scenario prefix</font></b></td></tr></tbody></table>\n");
+        gStream.print("<a href=\"org.eclipse.ant.php?\">org.eclipse.ant*</a><br>\n");
+        gStream.print("<a href=\"org.eclipse.compare.php?\">org.eclipse.compare*</a><br>\n");
+        gStream.print("<a href=\"org.eclipse.core.php?\">org.eclipse.core*</a><br>\n");
+        gStream.print("<a href=\"org.eclipse.jdt.core.php?\">org.eclipse.jdt.core*</a><br>\n");
+        gStream.print("<a href=\"org.eclipse.jdt.debug.php?\">org.eclipse.jdt.debug*</a><br>\n");
+        gStream.print("<a href=\"org.eclipse.jdt.text.php?\">org.eclipse.jdt.text*</a><br>\n");
+        gStream.print("<a href=\"org.eclipse.jdt.ui.php?\">org.eclipse.jdt.ui*</a><br>\n");
+        gStream.print("<a href=\"org.eclipse.jface.php?\">org.eclipse.jface*</a><br>\n");
+        gStream.print("<a href=\"org.eclipse.osgi.php?\">org.eclipse.osgi*</a><br>\n");
+        gStream.print("<a href=\"org.eclipse.pde.api.tools.php?\">org.eclipse.pde.api.tools*</a><br>\n");
+        gStream.print("<a href=\"org.eclipse.pde.ui.php?\">org.eclipse.pde.ui*</a><br>\n");
+        gStream.print("<a href=\"org.eclipse.swt.php?\">org.eclipse.swt*</a><br>\n");
+        gStream.print("<a href=\"org.eclipse.team.php?\">org.eclipse.team*</a><br>\n");
+        gStream.print("<a href=\"org.eclipse.ua.php?\">org.eclipse.ua*</a><br>\n");
+        gStream.print("<a href=\"org.eclipse.ui.php?\">org.eclipse.ui*</a><br><p><br><br>\n");
+        gStream.print("</body>\n");
+        gStream.print(Utils.HTML_CLOSE);
+      }
+    } else {
+      stream.print(Utils.HTML_OPEN);
+    }
+    stream.print("<link href=\"" + Utils.TOOLTIP_STYLE + "\" rel=\"stylesheet\" type=\"text/css\">\n");
+    stream.print("<script src=\"" + Utils.TOOLTIP_SCRIPT + "\"></script>\n");
+    stream.print("<script src=\"" + Utils.FINGERPRINT_SCRIPT + "\"></script>\n");
+    stream.print(Utils.HTML_DEFAULT_CSS);
 
-	// Print title
-	stream.print("<body>");
-	printComponentTitle(/*performanceResults, */component, isGlobal, stream);
+    // Print title
+    stream.print("<body>");
+    printComponentTitle(/* performanceResults, */component, isGlobal, stream);
 
-	// print the html representation of fingerprint for each config
-	Display display = Display.getDefault();
-	if (this.genFingerPrints || this.genAll) {
-		final FingerPrint fingerprint = new FingerPrint(component, stream, this.outputDir);
+    // print the html representation of fingerprint for each config
+    Display display = Display.getDefault();
+    if (this.genFingerPrints || this.genAll) {
+      final FingerPrint fingerprint = new FingerPrint(component, stream, this.outputDir);
       display.syncExec(() -> {
         try {
           fingerprint.print(GenerateResults.this.performanceResults);
@@ -561,29 +561,27 @@
           ex.printStackTrace();
         }
       });
-	}
-//	FingerPrint fingerprint = new FingerPrint(component, stream, this.outputDir);
-//	fingerprint.print(performanceResults);
+    }
+    // FingerPrint fingerprint = new FingerPrint(component, stream, this.outputDir);
+    // fingerprint.print(performanceResults);
 
-	// print scenario status table
-	if (!isGlobal) {
-		// print the component scenario status table beneath the fingerprint
-		final ScenarioStatusTable sst = new ScenarioStatusTable(component, stream);
-		display.syncExec(
-			() -> {
-      	try {
-      		sst.print(GenerateResults.this.performanceResults);
-      	} catch (Exception ex) {
-      		ex.printStackTrace();
-      	}
-      }
-		);
-//		ScenarioStatusTable sst = new ScenarioStatusTable(component, stream);
-//		sst.print(performanceResults);
-	}
+    // print scenario status table
+    if (!isGlobal) {
+      // print the component scenario status table beneath the fingerprint
+      final ScenarioStatusTable sst = new ScenarioStatusTable(component, stream);
+      display.syncExec(() -> {
+        try {
+          sst.print(GenerateResults.this.performanceResults);
+        } catch (Exception ex) {
+          ex.printStackTrace();
+        }
+      });
+      // ScenarioStatusTable sst = new ScenarioStatusTable(component, stream);
+      // sst.print(performanceResults);
+    }
 
-	stream.print(Utils.HTML_CLOSE);
-	stream.close();
+    stream.print(Utils.HTML_CLOSE);
+  }
 }
 
 private void printComponentTitle(/*PerformanceResults performanceResults, */String component, boolean isGlobal, PrintStream stream) {