From 23c416f30f4a1e69e76b70d71f6a9a7da4a020f1 Mon Sep 17 00:00:00 2001
From: James Moger <james.moger@gitblit.com>
Date: Thu, 10 Apr 2014 18:58:09 -0400
Subject: [PATCH] Hook-up comprensive command cleanup (destroy)

---
 src/main/java/com/gitblit/wicket/WicketUtils.java |   59 ++---------------------------------------------------------
 1 files changed, 2 insertions(+), 57 deletions(-)

diff --git a/src/main/java/com/gitblit/wicket/WicketUtils.java b/src/main/java/com/gitblit/wicket/WicketUtils.java
index f1f084c..8598447 100644
--- a/src/main/java/com/gitblit/wicket/WicketUtils.java
+++ b/src/main/java/com/gitblit/wicket/WicketUtils.java
@@ -38,8 +38,6 @@
 import org.apache.wicket.protocol.http.WebRequest;
 import org.apache.wicket.resource.ContextRelativeResource;
 import org.eclipse.jgit.diff.DiffEntry.ChangeType;
-import org.wicketstuff.googlecharts.AbstractChartData;
-import org.wicketstuff.googlecharts.IChartData;
 
 import com.gitblit.Constants;
 import com.gitblit.Constants.AccessPermission;
@@ -434,7 +432,7 @@
 		parameterMap.put("pg", String.valueOf(pageNumber));
 		return new PageParameters(parameterMap);
 	}
-	
+
 	public static PageParameters newBlameTypeParameter(String repositoryName,
 			String commitId, String path, String blameType) {
 		Map<String, String> parameterMap = new HashMap<String, String>();
@@ -536,7 +534,7 @@
 			// past
 			title = timeUtils.timeAgo(date);
 		}
-		if ((System.currentTimeMillis() - date.getTime()) < 10 * 24 * 60 * 60 * 1000L) {
+		if (title != null && (System.currentTimeMillis() - date.getTime()) < 10 * 24 * 60 * 60 * 1000L) {
 			String tmp = dateString;
 			dateString = title;
 			title = tmp;
@@ -632,32 +630,6 @@
 		return label;
 	}
 
-	public static IChartData getChartData(Collection<Metric> metrics) {
-		final double[] commits = new double[metrics.size()];
-		final double[] tags = new double[metrics.size()];
-		int i = 0;
-		double max = 0;
-		for (Metric m : metrics) {
-			commits[i] = m.count;
-			if (m.tag > 0) {
-				tags[i] = m.count;
-			} else {
-				tags[i] = -1d;
-			}
-			max = Math.max(max, m.count);
-			i++;
-		}
-		IChartData data = new AbstractChartData(max) {
-			private static final long serialVersionUID = 1L;
-
-			@Override
-			public double[][] getData() {
-				return new double[][] { commits, tags };
-			}
-		};
-		return data;
-	}
-
 	public static double maxValue(Collection<Metric> metrics) {
 		double max = Double.MIN_VALUE;
 		for (Metric m : metrics) {
@@ -667,31 +639,4 @@
 		}
 		return max;
 	}
-
-	public static IChartData getScatterData(Collection<Metric> metrics) {
-		final double[] y = new double[metrics.size()];
-		final double[] x = new double[metrics.size()];
-		int i = 0;
-		double max = 0;
-		for (Metric m : metrics) {
-			y[i] = m.count;
-			if (m.duration > 0) {
-				x[i] = m.duration;
-			} else {
-				x[i] = -1d;
-			}
-			max = Math.max(max, m.count);
-			i++;
-		}
-		IChartData data = new AbstractChartData(max) {
-			private static final long serialVersionUID = 1L;
-
-			@Override
-			public double[][] getData() {
-				return new double[][] { x, y };
-			}
-		};
-		return data;
-	}
-
 }

--
Gitblit v1.9.1