mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
do not load snappy implementation if its usage is explicitly disabled via system property
This commit is contained in:
@@ -31,9 +31,14 @@ public class IOUtils {
|
||||
private static volatile boolean canUseSnappy;
|
||||
static {
|
||||
try {
|
||||
Field impl = Snappy.class.getDeclaredField("impl");
|
||||
impl.setAccessible(true);
|
||||
canUseSnappy = impl.get(null) != null && System.getProperty("idea.no.snappy") == null;
|
||||
if (System.getProperty("idea.no.snappy") == null) { // if enabled
|
||||
Field impl = Snappy.class.getDeclaredField("impl");
|
||||
impl.setAccessible(true);
|
||||
canUseSnappy = impl.get(null) != null;
|
||||
}
|
||||
else {
|
||||
canUseSnappy = false;
|
||||
}
|
||||
}
|
||||
catch (Throwable e) {}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user