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; }