graphhopper
graphhopper copied to clipboard
No error when flushing DataAccess that was not created, but cannot load it either
In RAMIntDataAccess.java:
@Test
public void flushWithoutCreate() {
DataAccess da = createDataAccess("abc");
da.setHeader(0, 6);
assertEquals(6, da.getHeader(0));
// no error here...
da.flush();
da.close();
DataAccess loaded = createDataAccess("abc");
// this will fail because we did not call create() before flush()
assertTrue(loaded.loadExisting());
}
Should we throw an error when trying to flush before calling create? Or should it just be possible to do this and we have to call create after loadExisting?
Should we throw an error when trying to flush before calling create?
Yes, sounds like a good idea. Either loadExisting or create should be called before using the DataAccess.