graphhopper / graphhopper/graphhopper

No error when flushing DataAccess that was not created, but cannot load it either

Open
#2,384 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
6.7k
Forks
2k
Avg merge
15h 58m
Merged PRs (30d)
3

Description

In `RAMIntDataAccess.java`:

```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`?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.