// Path: src/main/java/org/lmdbjava/Library.java
// static final Lmdb LIB;
// 
// Path: src/main/java/org/lmdbjava/Library.java
// static final jnr.ffi.Runtime RUNTIME;
// 
// Path: src/main/java/org/lmdbjava/MaskedFlag.java
// static boolean isSet(final int flags, final MaskedFlag test) {
//   requireNonNull(test);
//   return (flags & test.getMask()) == test.getMask();
// }
// 
// Path: src/main/java/org/lmdbjava/MaskedFlag.java
// static int mask(final MaskedFlag... flags) {
//   if (flags == null || flags.length == 0) {
//     return 0;
//   }
// 
//   int result = 0;
//   for (final MaskedFlag flag : flags) {
//     if (flag == null) {
//       continue;
//     }
//     result |= flag.getMask();
//   }
//   return result;
// }
// 
// Path: src/main/java/org/lmdbjava/ResultCodeMapper.java
// static void checkRc(final int rc) {
//   switch (rc) {
//     case MDB_SUCCESS:
//       return;
//     case Dbi.BadDbiException.MDB_BAD_DBI:
//       throw new Dbi.BadDbiException();
//     case BadReaderLockException.MDB_BAD_RSLOT:
//       throw new BadReaderLockException();
//     case BadException.MDB_BAD_TXN:
//       throw new BadException();
//     case Dbi.BadValueSizeException.MDB_BAD_VALSIZE:
//       throw new Dbi.BadValueSizeException();
//     case LmdbNativeException.PageCorruptedException.MDB_CORRUPTED:
//       throw new LmdbNativeException.PageCorruptedException();
//     case Cursor.FullException.MDB_CURSOR_FULL:
//       throw new Cursor.FullException();
//     case Dbi.DbFullException.MDB_DBS_FULL:
//       throw new Dbi.DbFullException();
//     case Dbi.IncompatibleException.MDB_INCOMPATIBLE:
//       throw new Dbi.IncompatibleException();
//     case Env.FileInvalidException.MDB_INVALID:
//       throw new Env.FileInvalidException();
//     case Dbi.KeyExistsException.MDB_KEYEXIST:
//       throw new Dbi.KeyExistsException();
//     case Env.MapFullException.MDB_MAP_FULL:
//       throw new Env.MapFullException();
//     case Dbi.MapResizedException.MDB_MAP_RESIZED:
//       throw new Dbi.MapResizedException();
//     case Dbi.KeyNotFoundException.MDB_NOTFOUND:
//       throw new Dbi.KeyNotFoundException();
//     case LmdbNativeException.PageFullException.MDB_PAGE_FULL:
//       throw new LmdbNativeException.PageFullException();
//     case LmdbNativeException.PageNotFoundException.MDB_PAGE_NOTFOUND:
//       throw new LmdbNativeException.PageNotFoundException();
//     case LmdbNativeException.PanicException.MDB_PANIC:
//       throw new LmdbNativeException.PanicException();
//     case Env.ReadersFullException.MDB_READERS_FULL:
//       throw new Env.ReadersFullException();
//     case LmdbNativeException.TlsFullException.MDB_TLS_FULL:
//       throw new LmdbNativeException.TlsFullException();
//     case TxFullException.MDB_TXN_FULL:
//       throw new TxFullException();
//     case Env.VersionMismatchException.MDB_VERSION_MISMATCH:
//       throw new Env.VersionMismatchException();
//     default:
//       break;
//   }
// 
//   final Constant constant = CONSTANTS.getConstant(rc);
//   if (constant == null) {
//     throw new IllegalArgumentException("Unknown result code " + rc);
//   }
//   final String msg = constant.name() + " " + constant.toString();
//   throw new LmdbNativeException.ConstantDerivedException(rc, msg);
// }


import static org.lmdbjava.Txn.State.RESET;
import static org.lmdbjava.TxnFlags.MDB_RDONLY_TXN;
import java.util.Comparator;
import jnr.ffi.Pointer;
import static jnr.ffi.Memory.allocateDirect;
import static jnr.ffi.NativeType.ADDRESS;
import static org.lmdbjava.Library.LIB;
import static org.lmdbjava.Library.RUNTIME;
import static org.lmdbjava.MaskedFlag.isSet;
import static org.lmdbjava.MaskedFlag.mask;
import static org.lmdbjava.ResultCodeMapper.checkRc;
import static org.lmdbjava.Txn.State.DONE;
import static org.lmdbjava.Txn.State.READY;
import static org.lmdbjava.Txn.State.RELEASED;
      super("Transaction incompatible with its parent transaction");
    }
  }

  /**
   * Transaction is not in a READY state.
   */
  public static final class NotReadyException extends LmdbException {

    private static final long serialVersionUID = 1L;

    /**
     * Creates a new instance.
     */
    public NotReadyException() {
      super("Transaction is not in ready state");
    }
  }

  /**
   * The current transaction has not been reset.
   */
  public static class NotResetException extends LmdbException {

    private static final long serialVersionUID = 1L;

    /**
     * Creates a new instance.
     */
    public NotResetException() {
// Path: src/main/java/org/lmdbjava/Library.java
// static final Lmdb LIB;
// 
// Path: src/main/java/org/lmdbjava/Library.java
// static final jnr.ffi.Runtime RUNTIME;
// 
// Path: src/main/java/org/lmdbjava/MaskedFlag.java
// static boolean isSet(final int flags, final MaskedFlag test) {
//   requireNonNull(test);
//   return (flags & test.getMask()) == test.getMask();
// }
// 
// Path: src/main/java/org/lmdbjava/MaskedFlag.java
// static int mask(final MaskedFlag... flags) {
//   if (flags == null || flags.length == 0) {
//     return 0;
//   }
// 
//   int result = 0;
//   for (final MaskedFlag flag : flags) {
//     if (flag == null) {
//       continue;
//     }
//     result |= flag.getMask();
//   }
//   return result;
// }
// 
// Path: src/main/java/org/lmdbjava/ResultCodeMapper.java
// static void checkRc(final int rc) {
//   switch (rc) {
//     case MDB_SUCCESS:
//       return;
//     case Dbi.BadDbiException.MDB_BAD_DBI:
//       throw new Dbi.BadDbiException();
//     case BadReaderLockException.MDB_BAD_RSLOT:
//       throw new BadReaderLockException();
//     case BadException.MDB_BAD_TXN:
//       throw new BadException();
//     case Dbi.BadValueSizeException.MDB_BAD_VALSIZE:
//       throw new Dbi.BadValueSizeException();
//     case LmdbNativeException.PageCorruptedException.MDB_CORRUPTED:
//       throw new LmdbNativeException.PageCorruptedException();
//     case Cursor.FullException.MDB_CURSOR_FULL:
//       throw new Cursor.FullException();
//     case Dbi.DbFullException.MDB_DBS_FULL:
//       throw new Dbi.DbFullException();
//     case Dbi.IncompatibleException.MDB_INCOMPATIBLE:
//       throw new Dbi.IncompatibleException();
//     case Env.FileInvalidException.MDB_INVALID:
//       throw new Env.FileInvalidException();
//     case Dbi.KeyExistsException.MDB_KEYEXIST:
//       throw new Dbi.KeyExistsException();
//     case Env.MapFullException.MDB_MAP_FULL:
//       throw new Env.MapFullException();
//     case Dbi.MapResizedException.MDB_MAP_RESIZED:
//       throw new Dbi.MapResizedException();
//     case Dbi.KeyNotFoundException.MDB_NOTFOUND:
//       throw new Dbi.KeyNotFoundException();
//     case LmdbNativeException.PageFullException.MDB_PAGE_FULL:
//       throw new LmdbNativeException.PageFullException();
//     case LmdbNativeException.PageNotFoundException.MDB_PAGE_NOTFOUND:
//       throw new LmdbNativeException.PageNotFoundException();
//     case LmdbNativeException.PanicException.MDB_PANIC:
//       throw new LmdbNativeException.PanicException();
//     case Env.ReadersFullException.MDB_READERS_FULL:
//       throw new Env.ReadersFullException();
//     case LmdbNativeException.TlsFullException.MDB_TLS_FULL:
//       throw new LmdbNativeException.TlsFullException();
//     case TxFullException.MDB_TXN_FULL:
//       throw new TxFullException();
//     case Env.VersionMismatchException.MDB_VERSION_MISMATCH:
//       throw new Env.VersionMismatchException();
//     default:
//       break;
//   }
// 
//   final Constant constant = CONSTANTS.getConstant(rc);
//   if (constant == null) {
//     throw new IllegalArgumentException("Unknown result code " + rc);
//   }
//   final String msg = constant.name() + " " + constant.toString();
//   throw new LmdbNativeException.ConstantDerivedException(rc, msg);
// }


// Path: src/main/java/org/lmdbjava/Txn.java
import static org.lmdbjava.Txn.State.RESET;
import static org.lmdbjava.TxnFlags.MDB_RDONLY_TXN;
import java.util.Comparator;
import jnr.ffi.Pointer;
import static jnr.ffi.Memory.allocateDirect;
import static jnr.ffi.NativeType.ADDRESS;
import static org.lmdbjava.Library.LIB;
import static org.lmdbjava.Library.RUNTIME;
import static org.lmdbjava.MaskedFlag.isSet;
import static org.lmdbjava.MaskedFlag.mask;
import static org.lmdbjava.ResultCodeMapper.checkRc;
import static org.lmdbjava.Txn.State.DONE;
import static org.lmdbjava.Txn.State.READY;
import static org.lmdbjava.Txn.State.RELEASED;

      super("Transaction incompatible with its parent transaction");
    }
  }

  /**
   * Transaction is not in a READY state.
   */
  public static final class NotReadyException extends LmdbException {

    private static final long serialVersionUID = 1L;

    /**
     * Creates a new instance.
     */
    public NotReadyException() {
      super("Transaction is not in ready state");
    }
  }

  /**
   * The current transaction has not been reset.
   */
  public static class NotResetException extends LmdbException {

    private static final long serialVersionUID = 1L;

    /**
     * Creates a new instance.
     */
    public NotResetException() {
      super("Transaction has not been reset");