Use class names instead of fields to detect Java version
.. because some use patched JDK with backported fields.
This commit is contained in:
parent
f2538a996d
commit
85f47d639f
@ -20,8 +20,8 @@ import java.net.ServerSocket;
|
|||||||
import java.security.AccessController;
|
import java.security.AccessController;
|
||||||
import java.security.PrivilegedActionException;
|
import java.security.PrivilegedActionException;
|
||||||
import java.security.PrivilegedExceptionAction;
|
import java.security.PrivilegedExceptionAction;
|
||||||
|
import java.util.concurrent.BlockingQueue;
|
||||||
import java.util.concurrent.atomic.AtomicInteger;
|
import java.util.concurrent.atomic.AtomicInteger;
|
||||||
import java.util.zip.Deflater;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -147,10 +147,11 @@ public final class DetectionUtil {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Deflater.class.getDeclaredField("SYNC_FLUSH");
|
Class.forName(
|
||||||
return 7;
|
"java.util.concurrent.LinkedTransferQueue", false,
|
||||||
|
BlockingQueue.class.getClassLoader());
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
// Ignore
|
return 7;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 6;
|
return 6;
|
||||||
|
Loading…
Reference in New Issue
Block a user