What is clazz used for in "private static Class clazz = SnappyDecompressor.class" source file?
<p>I am studying the compressor implementation (in Java) for Snappy, Zlib and others. Near the top of the source file is this line below. Can anyone explain to me what it means?</p>

<pre><code>HACK - Use this as a global lock in the JNI layer
@SuppressWarnings({"unchecked", "unused"})
private static Class clazz = SnappyDecompressor.class;
</code></pre>

<p>I understand, for example, in Snappy, SnappyDecompressor.java is essentially a wrapper for snappy C / native implementation, and to make calls to that C implementation, the Java layer makes calls through JNI interface. </p>

<p>The top part of the source for snappy (Java wrapper), SnappyDecompressor.java is here:</p>

<pre><code>package org.apache.hadoop.io.compress.snappy;
import java.io.IOException;
import java.nio.Buffer;
import java.nio.ByteBuffer;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.hadoop.io.compress.Decompressor;

/**
 * A {@link Decompressor} based on the snappy compression algorithm.
 * http://code.google.com/p/snappy/
 */
public class SnappyDecompressor implements Decompressor {
  private static final Log LOG =
      LogFactory.getLog(SnappyCompressor.class.getName());
  private static final int DEFAULT_DIRECT_BUFFER_SIZE = 64 * 1024;

  // HACK - Use this as a global lock in the JNI layer
  @SuppressWarnings({"unchecked", "unused"})
  private static Class clazz = SnappyDecompressor.class;
</code></pre>

<p><a href="https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/io/compress/snappy/SnappyDecompressor.java" rel="nofollow">Full source</a></p>