Work around JOSM bug in CachedFile#clear

Signed-off-by: Taylor Smock <tsmock@fb.com>
pull/1/head v1.8.5
Taylor Smock 2021-10-19 07:44:26 -06:00
rodzic 5930bda453
commit d47b59161b
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 625F6A74A3E4311A
1 zmienionych plików z 4 dodań i 3 usunięć

Wyświetl plik

@ -31,11 +31,12 @@ public abstract class CommonSourceReader<T> implements AutoCloseable {
* @throws IOException if any I/O error occurs
*/
public Optional<T> parse() throws IOException {
cachedFile = new CachedFile(source);
cachedFile.setFastFail(fastFail);
this.cachedFile = new CachedFile(this.source);
if (this.clearCache) {
cachedFile.clear();
this.cachedFile.clear();
this.cachedFile = new CachedFile(this.source);
}
this.cachedFile.setFastFail(this.fastFail);
try (JsonReader reader = Json.createReader(cachedFile.setMaxAge(CachedFile.DAYS)
.setCachingStrategy(CachedFile.CachingStrategy.IfModifiedSince).getContentReader())) {
JsonStructure struct = reader.read();