NPE when creating a database if parent path does not exist
Code:
DBMaker .newFileDB(file) .snapshotEnable() .syncOnCommitDisable() .makeTxMaker();
If file refers to /tmp/a/mydb.db and /tmp/a does not exist then the code fails with:
java.lang.NullPointerException
at org.mapdb.StoreWAL.close(StoreWAL.java:1081)
at org.mapdb.StoreDirect.
This is using mapdb-0.9.9-20140104.115606-2.jar
MapDB 0.9.10 is out
I got stung by this on an upgrade from 0.9.9. I was using just a filename in the call to DBMaker.newFileDB() and NOT a fully specified path. So the call to File.getParentFile in Volume.checkFolder() throws an NPE for me now. I think this was to fix another bug but its has now created another. Should I be required to specify some path?
Caused by: java.lang.NullPointerException
at org.mapdb.Volume$FileChannelVol.checkFolder(Volume.java:681)
at org.mapdb.Volume$FileChannelVol.
I think NPE exception is already fixed.
I see the new null check, tested and works for the simple case of using just a filename in CWD, e.g. DBMaker.newFileDB(new File(filename))
Great!