lz4 / lz4-java

LZ4 compression for Java
Apache License 2.0
1.11k stars 252 forks source link

NullPointerException when LZ4Factory is loaded by bootstrap class loader #59

Closed yilongli closed 9 years ago

yilongli commented 9 years ago

At https://github.com/jpountz/lz4-java/blob/aef24cfbbf53d6ade60073b287edc610be743e43/src/java/net/jpountz/lz4/LZ4Factory.java#L149, LZ4Factory.class.getClassLoader() might return null if LZ4Factory is loaded by the bootstrap class loader. It results in a NPE.

LZ4Factory is loaded by the bootstrap class loader in my application because I am using lz4 in a Java agent and this Java agent is loaded by the bootstrap class loader.

trask commented 9 years ago

+1

jpountz commented 9 years ago

Closing as I merged https://github.com/jpountz/lz4-java/pull/60