Plugins: Blacklist neodatis and seedless for Java 9+ (ticket #2295)

This commit is contained in:
zzz
2018-09-23 15:11:16 +00:00
parent 7a72049e28
commit e59d7a821b
4 changed files with 44 additions and 2 deletions

View File

@ -28,6 +28,7 @@ import net.i2p.util.OrderedProperties;
import net.i2p.util.PortMapper; import net.i2p.util.PortMapper;
import net.i2p.util.SecureDirectory; import net.i2p.util.SecureDirectory;
import net.i2p.util.SecureFile; import net.i2p.util.SecureFile;
import net.i2p.util.SystemVersion;
import net.i2p.util.VersionComparator; import net.i2p.util.VersionComparator;
@ -475,6 +476,15 @@ class PluginUpdateRunner extends UpdateRunner {
statusDone("<b>" + _t("Plugin requires Jetty version {0} or lower", "8.9999") + "</b>"); statusDone("<b>" + _t("Plugin requires Jetty version {0} or lower", "8.9999") + "</b>");
return; return;
} }
if (SystemVersion.isJava9()) {
blacklistVersion = PluginStarter.java9Blacklist.get(appName);
if (blacklistVersion != null &&
VersionComparator.comp(version, blacklistVersion) <= 0) {
to.delete();
statusDone("<b>" + _t("Plugin requires Java version {0} or lower", "8.9999") + "</b>");
return;
}
}
maxVersion = PluginStarter.stripHTML(props, "max-jetty-version"); maxVersion = PluginStarter.stripHTML(props, "max-jetty-version");
if (maxVersion != null && if (maxVersion != null &&
VersionComparator.comp(maxVersion, oldVersion) < 0) { VersionComparator.comp(maxVersion, oldVersion) < 0) {

View File

@ -36,6 +36,7 @@ import net.i2p.util.I2PAppThread;
import net.i2p.util.Log; import net.i2p.util.Log;
import net.i2p.util.PortMapper; import net.i2p.util.PortMapper;
import net.i2p.util.SimpleTimer2; import net.i2p.util.SimpleTimer2;
import net.i2p.util.SystemVersion;
import net.i2p.util.Translate; import net.i2p.util.Translate;
import net.i2p.util.VersionComparator; import net.i2p.util.VersionComparator;
@ -78,12 +79,28 @@ public class PluginStarter implements Runnable {
public static final Map<String, String> jetty9Blacklist; public static final Map<String, String> jetty9Blacklist;
static { static {
Map<String, String> map = new HashMap<String, String>(4); Map<String, String> map = new HashMap<String, String>(2);
map.put("i2pbote", "0.4.5"); map.put("i2pbote", "0.4.5");
map.put("BwSchedule", "0.0.36"); map.put("BwSchedule", "0.0.36");
jetty9Blacklist = Collections.unmodifiableMap(map); jetty9Blacklist = Collections.unmodifiableMap(map);
} }
/**
* Plugin name to plugin version of plugins that do not work
* with Java 9+
* Unmodifiable.
*
* @since 0.9.30
*/
public static final Map<String, String> java9Blacklist;
static {
Map<String, String> map = new HashMap<String, String>(2);
map.put("01_neodatis", "2.1-2.14-209-17");
map.put("02_seedless", "0.1.7-0.1.12");
java9Blacklist = Collections.unmodifiableMap(map);
}
public PluginStarter(RouterContext ctx) { public PluginStarter(RouterContext ctx) {
_context = ctx; _context = ctx;
} }
@ -362,6 +379,18 @@ public class PluginStarter implements Runnable {
throw new Exception(foo); throw new Exception(foo);
} }
if (SystemVersion.isJava9()) {
blacklistVersion = java9Blacklist.get(appName);
if (blacklistVersion != null &&
VersionComparator.comp(curVersion, blacklistVersion) <= 0) {
String foo = "Plugin " + appName + " requires Jetty version 8.9999 or lower";
log.error(foo);
disablePlugin(appName);
foo = gettext("Plugin requires Java version {0} or lower", "8.9999", ctx);
throw new Exception(foo);
}
}
String maxVersion = stripHTML(props, "max-jetty-version"); String maxVersion = stripHTML(props, "max-jetty-version");
if (maxVersion != null && if (maxVersion != null &&
VersionComparator.comp(maxVersion, jVersion) < 0) { VersionComparator.comp(maxVersion, jVersion) < 0) {

View File

@ -1,3 +1,6 @@
2018-09-23 zzz
* Plugins: Blacklist neodatis and seedless for Java 9+ (ticket #2295)
2018-09-22 zzz 2018-09-22 zzz
* NTCP: * NTCP:
- Fix handling of multiple connections - Fix handling of multiple connections

View File

@ -18,7 +18,7 @@ public class RouterVersion {
/** deprecated */ /** deprecated */
public final static String ID = "Monotone"; public final static String ID = "Monotone";
public final static String VERSION = CoreVersion.VERSION; public final static String VERSION = CoreVersion.VERSION;
public final static long BUILD = 5; public final static long BUILD = 6;
/** for example "-test" */ /** for example "-test" */
public final static String EXTRA = "-rc"; public final static String EXTRA = "-rc";