Skip to content

NPE on Array deserialization #93

orabelt opened this Issue Aug 27, 2012 · 0 comments

2 participants

orabelt commented Aug 27, 2012
public void testArrays() throws IOException {

        Object[][] odata = new Object[][] {
            {(int)25, (short)20, (short)32, (short)16, (short)20},

        String testFile = TestCaseWithTestFile.newTestFile();

        // write
        DB db = DBMaker.openFile(testFile).disableTransactions().make();
        Map<Long, Object> map = db.createTreeMap("testArrays");
        map.put(1L, odata[0]);

        // read
        DB dbr = DBMaker.openFile(testFile).disableTransactions().make();
        Object arr = dbr.getTreeMap("testArrays").get(1L); // <- NPE

at java.lang.reflect.Array.newArray(Native Method)
at java.lang.reflect.Array.newInstance(
at org.apache.jdbm.Serialization.deserializeArrayObject(
at org.apache.jdbm.Serialization.deserialize(
at org.apache.jdbm.Serialization.deserialize(
at org.apache.jdbm.BTreeLazyRecord.fastDeser(
at org.apache.jdbm.BTreeNode.readValues(
at org.apache.jdbm.BTreeNode.deserialize(
at org.apache.jdbm.BTreeNode.deserialize(
at org.apache.jdbm.DBStore.fetch2(
at org.apache.jdbm.DBStore.fetch(
at org.apache.jdbm.DBCacheMRU.fetch(
at org.apache.jdbm.BTree.getRoot(
at org.apache.jdbm.BTree.get(
at org.apache.jdbm.BTreeMap.get(

+1091 if (clazz == null) clazz = Object.class;

@jankotek jankotek added a commit that referenced this issue Aug 28, 2012
@jankotek Fixed issue #93 f5fdf17
@jankotek jankotek closed this Aug 28, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.