Hi All,
I was looking at Compression.java and I noticed that for Snappy and LZO
compression it is using ClassLoader.getSystemClassLoader() to retrieve the
class file.
LZ4 compression is using this built in function
private static ClassLoader getClassLoaderForCodec() {
ClassLoader cl = Thread.currentThread().getContextClassLoader();
if (cl == null) {
cl = Compression.class.getClassLoader();
}
if (cl == null) {
cl = ClassLoader.getSystemClassLoader();
}
if (cl == null) {
throw new RuntimeException("A ClassLoader to load the Codec could not
be determined");
}
return cl;
}
Is there a reason for the differences between using getSystemClassLoader
and getClassLoaderForCodec?
Seems like the getClassLoaderForCodec method of retrieving compression
class files is more user friendly?
Thanks,
Enoch Hsu