tonellotto / jdbm2

Automatically exported from code.google.com/p/jdbm2
0 stars 0 forks source link

NPE in BTree.getRoot() #3

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I can't extract a test case (too much code around - impl of Lucene directory 
akin to the BDB version); sorry.
It seems like creating one record, delete same record, find on same key was the 
offending workflow.
Anyway, I worked around it by being defensive in getRoot():
<code>
    /**
     * Return the root BPage, or null if it doesn't exist.
     */
    BPage<K, V> getRoot()
            throws IOException {
        if (_root == 0) {
            return null;
        }
        BPage<K, V> root = (BPage<K, V>) _recman.fetch(_root, _bpageSerializer);
        if (root != null) {
            root._recid = _root;
            root._btree = this;
        }
        return root;
    }
</code>

 On Mac OS, Java 6.

Original issue reported on code.google.com by hbies...@gmail.com on 14 Jan 2011 at 11:42

GoogleCodeExporter commented 9 years ago
I dont have enough informations to reproduce this. Stacktrace would be very 
useful. 
However I included workaround in commit r64.

Original comment by kja...@gmail.com on 22 Jan 2011 at 5:34

GoogleCodeExporter commented 9 years ago
No activity, workaround on place. Marking as fixed.

Original comment by kja...@gmail.com on 5 Jun 2011 at 1:58