forked from I2P_Developers/i2p.i2p
Jrobin: Fix for error in DeallocationHelper on Java version 9-internal
This commit is contained in:
@ -315,11 +315,18 @@ public class DeallocationHelper {
|
||||
"java.nio.ByteBufferAsShortBufferL", "java.nio.ByteBufferAsShortBufferRB",
|
||||
"java.nio.ByteBufferAsShortBufferRL" };
|
||||
final String[] javaVersionElements = System.getProperty("java.version").split("\\.");
|
||||
final int indexOfEarlyAccessSuffix = javaVersionElements[0].lastIndexOf("-ea");
|
||||
int indexOfEarlyAccessSuffix = javaVersionElements[0].lastIndexOf("-ea");
|
||||
if (indexOfEarlyAccessSuffix != -1) {
|
||||
// drops the "-ea" suffix from the major version number for
|
||||
// an early access build
|
||||
javaVersionElements[0] = javaVersionElements[0].substring(0, indexOfEarlyAccessSuffix);
|
||||
} else {
|
||||
indexOfEarlyAccessSuffix = javaVersionElements[0].lastIndexOf("-internal");
|
||||
if (indexOfEarlyAccessSuffix != -1) {
|
||||
// drops the "-internal" suffix from the major version number for
|
||||
// an early access build (Ubuntu)
|
||||
javaVersionElements[0] = javaVersionElements[0].substring(0, indexOfEarlyAccessSuffix);
|
||||
}
|
||||
}
|
||||
final int major, minor;
|
||||
if (javaVersionElements.length >= 2) {
|
||||
|
@ -174,6 +174,8 @@ class SummaryListener implements RateSummaryListener {
|
||||
rrdFile.delete();
|
||||
} catch (IOException ioe) {
|
||||
_log.error("Error starting RRD for stat " + baseName, ioe);
|
||||
} catch (Throwable t) {
|
||||
_log.error("Error starting RRD for stat " + baseName, t);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
Reference in New Issue
Block a user