From 2035a9ba0f848761c23cd0f84a6197ac799e0bbd Mon Sep 17 00:00:00 2001 From: gravitylow Date: Tue, 7 Jan 2014 23:50:11 -0500 Subject: [PATCH] Bump to Updater v2.1 --- pom.xml | 2 +- .../net/gravitydevelopment/updater/Updater.java | 16 +++++++++------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/pom.xml b/pom.xml index 9e9a699..f700f94 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ net.gravitydevelopment.updater updater - 2.0 + 2.1 jar Updater http://forums.bukkit.org/threads/updater-2-0-easy-safe-and-policy-compliant-auto-updating-for-your-plugins-new.96681/ diff --git a/src/main/java/net/gravitydevelopment/updater/Updater.java b/src/main/java/net/gravitydevelopment/updater/Updater.java index 5f50426..82db4f3 100644 --- a/src/main/java/net/gravitydevelopment/updater/Updater.java +++ b/src/main/java/net/gravitydevelopment/updater/Updater.java @@ -35,7 +35,7 @@ * If you are unsure about these rules, please read the plugin submission guidelines: http://goo.gl/8iU5l * * @author Gravity - * @version 2.0 + * @version 2.1 */ public class Updater { @@ -194,7 +194,7 @@ public Updater(Plugin plugin, int id, File file, UpdateType type, boolean announ } else { plugin.getLogger().severe("The updater could not load configuration at " + updaterFile.getAbsolutePath()); } - e.printStackTrace(); + plugin.getLogger().log(Level.SEVERE, null, e); } if (this.config.getBoolean("disable")) { @@ -224,7 +224,7 @@ public Updater(Plugin plugin, int id, File file, UpdateType type, boolean announ * Get the result of the update process. * * @return result of the update process. - * @see net.gravitydevelopment.updater.Updater.UpdateResult + * @see UpdateResult */ public Updater.UpdateResult getResult() { this.waitForThread(); @@ -235,13 +235,15 @@ public Updater.UpdateResult getResult() { * Get the latest version's release type. * * @return latest version's release type. - * @see net.gravitydevelopment.updater.Updater.ReleaseType + * @see ReleaseType */ public ReleaseType getLatestType() { this.waitForThread(); - for (ReleaseType type : ReleaseType.values()) { - if (this.versionType.equals(type.name().toLowerCase())) { - return type; + if (this.versionType != null) { + for (ReleaseType type : ReleaseType.values()) { + if (this.versionType.equals(type.name().toLowerCase())) { + return type; + } } } return null;