fixed a compilation problem. I think this reads better than a two-arg "isNewerThan"

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@24466 71c3de6d-444a-0410-be80-ed276b4c234a
This commit is contained in:
kohsuke committed 2009-12-08 00:09:45 +00:00
1 parent a19306af47
commit 26f290b5b7
2 files changed
+29 -18

No files matched your search

@@ -26,6 +26,7 @@ package hudson;
import hudson.model.Hudson;
import hudson.model.UpdateCenter;
import hudson.model.UpdateSite;
import hudson.util.VersionNumber;
import java.io.File;
import java.io.FileOutputStream;
@@ -287,6 +288,26 @@ public final class PluginWrapper {
return "???";
}
/**
* Returns the version number of this plugin
*/
public VersionNumber getVersionNumber() {
return new VersionNumber(getVersion());
}
/**
* Returns true if the version of this plugin is older than the given version.
*/
public boolean isOlderThan(VersionNumber v) {
try {
return getVersionNumber().compareTo(v) < 0;
} catch (IllegalArgumentException e) {
// if we can't figure out our current version, it probably means it's very old,
// since the version information is missing only from the very old plugins
return true;
}
}
/**
* Terminates the plugin.
*/