twitter / hadoop-lzo

Refactored version of code.google.com/hadoop-gpl-compression for hadoop 0.20
GNU General Public License v3.0
546 stars 329 forks source link

JNI issue in LzoDecompressor_decompressBytesDirect #134

Open luchsh opened 6 years ago

luchsh commented 6 years ago

The type of the second parameter of GetStaticObjectField should be 'jclass' instead of 'jobject', this can be found by specifying jvm option "-Xcheck:jni".

JNIEXPORT jint JNICALL
Java_com_hadoop_compression_lzo_LzoDecompressor_decompressBytesDirect(
    JNIEnv *env, jobject this, jint decompressor
    ) {
.....
    // Get members of LzoDecompressor
    clazz = (*env)->GetStaticObjectField(env, this, 
                                                 LzoDecompressor_clazz);