From d3f260851003bdd86790ee25a32bf271db5dc4b4 Mon Sep 17 00:00:00 2001 From: Guus der Kinderen Date: Thu, 19 Sep 2024 14:21:35 +0200 Subject: [PATCH] I shouldn't be left unattended near a computer --- .../jivesoftware/site/DownloadServlet.java | 19 ------------------- .../org/jivesoftware/site/DownloadStats.java | 8 ++++---- 2 files changed, 4 insertions(+), 23 deletions(-) diff --git a/src/main/java/org/jivesoftware/site/DownloadServlet.java b/src/main/java/org/jivesoftware/site/DownloadServlet.java index 915fe8be..f17d47a0 100644 --- a/src/main/java/org/jivesoftware/site/DownloadServlet.java +++ b/src/main/java/org/jivesoftware/site/DownloadServlet.java @@ -68,25 +68,6 @@ public static DownloadInfo forType(int type) { return Arrays.stream(DownloadInfo.values()).filter(d -> d.getType() == type).findFirst().orElse(null); } - - public static DownloadInfo getDownloadInfo(int type) - { - switch (type) { - case 0: return openfire; - case 1: return spark; - case 2: return smack; - case 3: return xiff; - case 4: return spark_update; - case 5: return openfire_plugin; - case 6: return spark_plugin; - case 7: return wildfire; - case 8: return wildfire_plugin; - case 9: return whack; - case 10: return sparkweb; - case 11: return tinder; - default: return null; - } - } } public void doGet(HttpServletRequest request, HttpServletResponse response) throws diff --git a/src/main/java/org/jivesoftware/site/DownloadStats.java b/src/main/java/org/jivesoftware/site/DownloadStats.java index 07a6738a..9e41c948 100644 --- a/src/main/java/org/jivesoftware/site/DownloadStats.java +++ b/src/main/java/org/jivesoftware/site/DownloadStats.java @@ -207,10 +207,10 @@ public void run() { rs = pstmt.executeQuery(); while (rs.next()) { - final int type = rs.getInt(2); - long amount = rs.getLong(1); - - final DownloadServlet.DownloadInfo downloadInfo = DownloadServlet.DownloadInfo.getDownloadInfo(type); + final int type = rs.getInt(1); + long amount = rs.getLong(2); + Log.debug("Iterate over type {}, amount {}", type, amount); + final DownloadServlet.DownloadInfo downloadInfo = DownloadServlet.DownloadInfo.forType(type); if (downloadInfo == null) { continue; }