forked from I2P_Developers/i2p.i2p
propagate from branch 'i2p.i2p' (head 04337e47a38298a4035f48b830f6a2532767bd50)
to branch 'i2p.i2p.zzz.test2' (head 052c3194bd75846075a6b64a1f96cdca6eae33b4)
This commit is contained in:
@ -70,7 +70,6 @@ public class ConsoleUpdateManager implements UpdateManager {
|
||||
/** downloaded AND installed */
|
||||
private final Map<UpdateItem, Version> _installed;
|
||||
private static final DecimalFormat _pct = new DecimalFormat("0.0%");
|
||||
private static final VersionComparator _versionComparator = new VersionComparator();
|
||||
|
||||
private volatile String _status;
|
||||
|
||||
@ -1289,7 +1288,7 @@ public class ConsoleUpdateManager implements UpdateManager {
|
||||
}
|
||||
|
||||
public int compareTo(Version r) {
|
||||
return _versionComparator.compare(version, r.version);
|
||||
return VersionComparator.comp(version, r.version);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -252,7 +252,7 @@ class PluginUpdateRunner extends UpdateRunner {
|
||||
|
||||
String minVersion = ConfigClientsHelper.stripHTML(props, "min-i2p-version");
|
||||
if (minVersion != null &&
|
||||
(new VersionComparator()).compare(CoreVersion.VERSION, minVersion) < 0) {
|
||||
VersionComparator.comp(CoreVersion.VERSION, minVersion) < 0) {
|
||||
to.delete();
|
||||
statusDone("<b>" + _("This plugin requires I2P version {0} or higher", minVersion) + "</b>");
|
||||
return;
|
||||
@ -260,7 +260,7 @@ class PluginUpdateRunner extends UpdateRunner {
|
||||
|
||||
minVersion = ConfigClientsHelper.stripHTML(props, "min-java-version");
|
||||
if (minVersion != null &&
|
||||
(new VersionComparator()).compare(System.getProperty("java.version"), minVersion) < 0) {
|
||||
VersionComparator.comp(System.getProperty("java.version"), minVersion) < 0) {
|
||||
to.delete();
|
||||
statusDone("<b>" + _("This plugin requires Java version {0} or higher", minVersion) + "</b>");
|
||||
return;
|
||||
@ -295,21 +295,21 @@ class PluginUpdateRunner extends UpdateRunner {
|
||||
}
|
||||
String oldVersion = oldProps.getProperty("version");
|
||||
if (oldVersion == null ||
|
||||
(new VersionComparator()).compare(oldVersion, version) >= 0) {
|
||||
VersionComparator.comp(oldVersion, version) >= 0) {
|
||||
to.delete();
|
||||
statusDone("<b>" + _("Downloaded plugin version {0} is not newer than installed plugin", version) + "</b>");
|
||||
return;
|
||||
}
|
||||
minVersion = ConfigClientsHelper.stripHTML(props, "min-installed-version");
|
||||
if (minVersion != null &&
|
||||
(new VersionComparator()).compare(minVersion, oldVersion) > 0) {
|
||||
VersionComparator.comp(minVersion, oldVersion) > 0) {
|
||||
to.delete();
|
||||
statusDone("<b>" + _("Plugin update requires installed plugin version {0} or higher", minVersion) + "</b>");
|
||||
return;
|
||||
}
|
||||
String maxVersion = ConfigClientsHelper.stripHTML(props, "max-installed-version");
|
||||
if (maxVersion != null &&
|
||||
(new VersionComparator()).compare(maxVersion, oldVersion) < 0) {
|
||||
VersionComparator.comp(maxVersion, oldVersion) < 0) {
|
||||
to.delete();
|
||||
statusDone("<b>" + _("Plugin update requires installed plugin version {0} or lower", maxVersion) + "</b>");
|
||||
return;
|
||||
@ -317,14 +317,14 @@ class PluginUpdateRunner extends UpdateRunner {
|
||||
oldVersion = LogsHelper.jettyVersion();
|
||||
minVersion = ConfigClientsHelper.stripHTML(props, "min-jetty-version");
|
||||
if (minVersion != null &&
|
||||
(new VersionComparator()).compare(minVersion, oldVersion) > 0) {
|
||||
VersionComparator.comp(minVersion, oldVersion) > 0) {
|
||||
to.delete();
|
||||
statusDone("<b>" + _("Plugin requires Jetty version {0} or higher", minVersion) + "</b>");
|
||||
return;
|
||||
}
|
||||
maxVersion = ConfigClientsHelper.stripHTML(props, "max-jetty-version");
|
||||
if (maxVersion != null &&
|
||||
(new VersionComparator()).compare(maxVersion, oldVersion) < 0) {
|
||||
VersionComparator.comp(maxVersion, oldVersion) < 0) {
|
||||
to.delete();
|
||||
statusDone("<b>" + _("Plugin requires Jetty version {0} or lower", maxVersion) + "</b>");
|
||||
return;
|
||||
|
@ -184,7 +184,7 @@ class UpdateRunner extends I2PAppThread implements UpdateTask, EepGet.StatusList
|
||||
if (_isPartial) {
|
||||
// Compare version with what we have now
|
||||
String newVersion = TrustedUpdate.getVersionString(new ByteArrayInputStream(_baos.toByteArray()));
|
||||
boolean newer = (new VersionComparator()).compare(newVersion, RouterVersion.VERSION) > 0;
|
||||
boolean newer = VersionComparator.comp(newVersion, RouterVersion.VERSION) > 0;
|
||||
if (newer) {
|
||||
_newVersion = newVersion;
|
||||
} else {
|
||||
|
@ -144,7 +144,7 @@ public class ConfigServiceHandler extends FormHandler {
|
||||
if (ctx.hasWrapper() && _wrapperListener == null &&
|
||||
!SystemVersion.isWindows()) {
|
||||
String wv = System.getProperty("wrapper.version");
|
||||
if (wv != null && (new VersionComparator()).compare(wv, LISTENER_AVAILABLE) >= 0) {
|
||||
if (wv != null && VersionComparator.comp(wv, LISTENER_AVAILABLE) >= 0) {
|
||||
try {
|
||||
_wrapperListener = new WrapperListener(ctx);
|
||||
} catch (Throwable t) {}
|
||||
|
@ -48,7 +48,7 @@ public class LogsHelper extends HelperBase {
|
||||
File f = null;
|
||||
if (ctx.hasWrapper()) {
|
||||
String wv = System.getProperty("wrapper.version");
|
||||
if (wv != null && (new VersionComparator()).compare(wv, LOCATION_AVAILABLE) >= 0) {
|
||||
if (wv != null && VersionComparator.comp(wv, LOCATION_AVAILABLE) >= 0) {
|
||||
try {
|
||||
f = WrapperManager.getWrapperLogFile();
|
||||
} catch (Throwable t) {}
|
||||
|
@ -73,7 +73,7 @@ public class PluginStarter implements Runnable {
|
||||
!NewsHelper.isUpdateInProgress()) {
|
||||
String prev = _context.getProperty("router.previousVersion");
|
||||
if (prev != null &&
|
||||
(new VersionComparator()).compare(RouterVersion.VERSION, prev) > 0) {
|
||||
VersionComparator.comp(RouterVersion.VERSION, prev) > 0) {
|
||||
updateAll(_context, true);
|
||||
}
|
||||
}
|
||||
@ -236,7 +236,7 @@ public class PluginStarter implements Runnable {
|
||||
|
||||
String minVersion = ConfigClientsHelper.stripHTML(props, "min-i2p-version");
|
||||
if (minVersion != null &&
|
||||
(new VersionComparator()).compare(CoreVersion.VERSION, minVersion) < 0) {
|
||||
VersionComparator.comp(CoreVersion.VERSION, minVersion) < 0) {
|
||||
String foo = "Plugin " + appName + " requires I2P version " + minVersion + " or higher";
|
||||
log.error(foo);
|
||||
disablePlugin(appName);
|
||||
@ -245,7 +245,7 @@ public class PluginStarter implements Runnable {
|
||||
|
||||
minVersion = ConfigClientsHelper.stripHTML(props, "min-java-version");
|
||||
if (minVersion != null &&
|
||||
(new VersionComparator()).compare(System.getProperty("java.version"), minVersion) < 0) {
|
||||
VersionComparator.comp(System.getProperty("java.version"), minVersion) < 0) {
|
||||
String foo = "Plugin " + appName + " requires Java version " + minVersion + " or higher";
|
||||
log.error(foo);
|
||||
disablePlugin(appName);
|
||||
@ -255,7 +255,7 @@ public class PluginStarter implements Runnable {
|
||||
String jVersion = LogsHelper.jettyVersion();
|
||||
minVersion = ConfigClientsHelper.stripHTML(props, "min-jetty-version");
|
||||
if (minVersion != null &&
|
||||
(new VersionComparator()).compare(minVersion, jVersion) > 0) {
|
||||
VersionComparator.comp(minVersion, jVersion) > 0) {
|
||||
String foo = "Plugin " + appName + " requires Jetty version " + minVersion + " or higher";
|
||||
log.error(foo);
|
||||
disablePlugin(appName);
|
||||
@ -264,7 +264,7 @@ public class PluginStarter implements Runnable {
|
||||
|
||||
String maxVersion = ConfigClientsHelper.stripHTML(props, "max-jetty-version");
|
||||
if (maxVersion != null &&
|
||||
(new VersionComparator()).compare(maxVersion, jVersion) < 0) {
|
||||
VersionComparator.comp(maxVersion, jVersion) < 0) {
|
||||
String foo = "Plugin " + appName + " requires Jetty version " + maxVersion + " or lower";
|
||||
log.error(foo);
|
||||
disablePlugin(appName);
|
||||
|
Reference in New Issue
Block a user