@Test void loadAndSaveExecutesPostLoadHook() { class A extends YamlConfiguration { int i = 0; protected A() { super(configPath, YamlProperties.DEFAULT); } @Override protected void postLoad() { i++; } } A a = new A(); a.loadAndSave(); assertThat(a.i, is(1)); }
public final void loadAndSave() { try { load(); save(); } catch (ConfigurationStoreException e) { if (e.getCause() instanceof NoSuchFileException) { postLoad(); save(); } else { throw e; } } }
YamlConfiguration extends Configuration<YamlConfiguration> { public final void loadAndSave() { try { load(); save(); } catch (ConfigurationStoreException e) { if (e.getCause() instanceof NoSuchFileException) { postLoad(); save(); } else { throw e; } } } }
YamlConfiguration extends Configuration<YamlConfiguration> { public final void loadAndSave() { try { load(); save(); } catch (ConfigurationStoreException e) { if (e.getCause() instanceof NoSuchFileException) { postLoad(); save(); } else { throw e; } } } protected  YamlConfiguration(Path path, YamlProperties properties); protected  YamlConfiguration(Path path); }
YamlConfiguration extends Configuration<YamlConfiguration> { public final void loadAndSave() { try { load(); save(); } catch (ConfigurationStoreException e) { if (e.getCause() instanceof NoSuchFileException) { postLoad(); save(); } else { throw e; } } } protected  YamlConfiguration(Path path, YamlProperties properties); protected  YamlConfiguration(Path path); final void loadAndSave(); }
YamlConfiguration extends Configuration<YamlConfiguration> { public final void loadAndSave() { try { load(); save(); } catch (ConfigurationStoreException e) { if (e.getCause() instanceof NoSuchFileException) { postLoad(); save(); } else { throw e; } } } protected  YamlConfiguration(Path path, YamlProperties properties); protected  YamlConfiguration(Path path); final void loadAndSave();  }