1-
21package org .lmdbjava ;
32
43import java .nio .ByteBuffer ;
@@ -39,7 +38,7 @@ public final class Dbi {
3938 * @throws CommittedException if already committed
4039 * @throws LmdbNativeException if a native C error occurred
4140 */
42- public Dbi (Txn tx , String name , DbiFlags ... flags )
41+ public Dbi (final Txn tx , final String name , final DbiFlags ... flags )
4342 throws CommittedException , LmdbNativeException {
4443 requireNonNull (tx );
4544 if (tx .isCommitted ()) {
@@ -60,7 +59,7 @@ public Dbi(Txn tx, String name, DbiFlags... flags)
6059 * @throws LmdbNativeException if a native C error occurred
6160 * @see #delete(Txn, ByteBuffer, ByteBuffer)
6261 */
63- public void delete (ByteBuffer key ) throws
62+ public void delete (final ByteBuffer key ) throws
6463 CommittedException , LmdbNativeException , NotOpenException {
6564 try (Txn tx = new Txn (env )) {
6665 delete (tx , key );
@@ -75,7 +74,7 @@ public void delete(ByteBuffer key) throws
7574 * @throws LmdbNativeException if a native C error occurred
7675 * @see #delete(Txn, ByteBuffer, ByteBuffer)
7776 */
78- public void delete (Txn tx , ByteBuffer key ) throws
77+ public void delete (final Txn tx , final ByteBuffer key ) throws
7978 CommittedException , LmdbNativeException {
8079 delete (tx , key , null );
8180 }
@@ -85,20 +84,21 @@ public void delete(Txn tx, ByteBuffer key) throws
8584 * Removes key/data pairs from the database.
8685 * </p>
8786 * If the database does not support sorted duplicate data items
88- * ({@link org.lmdbjava.DbiFlags#MDB_DUPSORT}) the value parameter is
89- * ignored. If the database supports sorted duplicates and the data parameter
90- * is NULL, all of the duplicate data items for the key will be deleted.
91- * Otherwise, if the data parameter is non-NULL only the matching data item
92- * will be deleted. This function will return false if the specified key/data
93- * pair is not in the database.
87+ * ({@link org.lmdbjava.DbiFlags#MDB_DUPSORT}) the value parameter is ignored.
88+ * If the database supports sorted duplicates and the data parameter is NULL,
89+ * all of the duplicate data items for the key will be deleted. Otherwise, if
90+ * the data parameter is non-NULL only the matching data item will be deleted.
91+ * This function will return false if the specified key/data pair is not in
92+ * the database.
9493 *
9594 * @param tx Transaction handle
9695 * @param key The key to delete from the database
9796 * @param val The value to delete from the database
9897 * @throws CommittedException if already committed
9998 * @throws LmdbNativeException if a native C error occurred
10099 */
101- public void delete (Txn tx , ByteBuffer key , ByteBuffer val ) throws
100+ public void delete (final Txn tx , final ByteBuffer key , final ByteBuffer val )
101+ throws
102102 CommittedException , LmdbNativeException {
103103
104104 final MDB_val k = createVal (key );
@@ -116,7 +116,7 @@ public void delete(Txn tx, ByteBuffer key, ByteBuffer val) throws
116116 * @throws LmdbNativeException if a native C error occurred
117117 * @see #get(Txn, ByteBuffer)
118118 */
119- public ByteBuffer get (ByteBuffer key ) throws
119+ public ByteBuffer get (final ByteBuffer key ) throws
120120 CommittedException , LmdbNativeException , NotOpenException {
121121 try (Txn tx = new Txn (env , MDB_RDONLY )) {
122122 return get (tx , key );
@@ -131,8 +131,8 @@ public ByteBuffer get(ByteBuffer key) throws
131131 * This function retrieves key/data pairs from the database. The address and
132132 * length of the data associated with the specified \b key are returned in the
133133 * structure to which \b data refers. If the database supports duplicate keys
134- * ({@link org.lmdbjava.DbiFlags#MDB_DUPSORT}) then the first data item
135- * for the key will be returned. Retrieval of other items requires the use of
134+ * ({@link org.lmdbjava.DbiFlags#MDB_DUPSORT}) then the first data item for
135+ * the key will be returned. Retrieval of other items requires the use of
136136 * #mdb_cursor_get().
137137 *
138138 * @param tx transaction handle
@@ -142,7 +142,7 @@ public ByteBuffer get(ByteBuffer key) throws
142142 * @throws CommittedException if already committed
143143 * @throws LmdbNativeException if a native C error occurred
144144 */
145- public ByteBuffer get (Txn tx , ByteBuffer key ) throws
145+ public ByteBuffer get (final Txn tx , final ByteBuffer key ) throws
146146 CommittedException , LmdbNativeException {
147147 assert key .isDirect ();
148148
@@ -152,7 +152,7 @@ public ByteBuffer get(Txn tx, ByteBuffer key) throws
152152 checkRc (lib .mdb_get (tx .ptr , dbi , k , v ));
153153
154154 // inefficient as we create a BB
155- ByteBuffer bb = allocateDirect (1 ).order (LITTLE_ENDIAN );
155+ final ByteBuffer bb = allocateDirect (1 ).order (LITTLE_ENDIAN );
156156 wrap (bb , v );
157157 return bb ;
158158 }
@@ -187,7 +187,7 @@ public String getName() {
187187 * @param tx transaction handle
188188 * @return cursor handle
189189 */
190- public Cursor openCursor (Txn tx ) throws LmdbNativeException {
190+ public Cursor openCursor (final Txn tx ) throws LmdbNativeException {
191191 PointerByReference ptr = new PointerByReference ();
192192 checkRc (lib .mdb_cursor_open (tx .ptr , dbi , ptr ));
193193 return new Cursor (ptr .getValue (), tx );
@@ -201,7 +201,7 @@ public Cursor openCursor(Txn tx) throws LmdbNativeException {
201201 * @throws LmdbNativeException if a native C error occurred
202202 * @see #put(Txn, ByteBuffer, ByteBuffer, DatabaseFlags...)
203203 */
204- public void put (ByteBuffer key , ByteBuffer val ) throws
204+ public void put (final ByteBuffer key , final ByteBuffer val ) throws
205205 CommittedException , LmdbNativeException , NotOpenException {
206206 try (Txn tx = new Txn (env )) {
207207 put (tx , key , val );
@@ -226,9 +226,9 @@ public void put(ByteBuffer key, ByteBuffer val) throws
226226 * @throws CommittedException if already committed
227227 * @throws LmdbNativeException if a native C error occurred
228228 */
229- public void put (Txn tx , ByteBuffer key , ByteBuffer val , DbiFlags ... flags )
230- throws
231- CommittedException , LmdbNativeException {
229+ public void put (final Txn tx , final ByteBuffer key , final ByteBuffer val ,
230+ final DbiFlags ... flags )
231+ throws CommittedException , LmdbNativeException {
232232
233233 final MDB_val k = createVal (key );
234234 final MDB_val v = createVal (val );
0 commit comments