mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
fix code
This commit is contained in:
@@ -213,7 +213,7 @@ public class Setting extends AbsSetting implements Map<String, String> {
|
||||
Assert.notNull(this.resource, "Setting resource must be not null !");
|
||||
// 先关闭之前的监听
|
||||
IoUtil.closeQuietly(this.watchMonitor);
|
||||
this.watchMonitor = WatchUtil.createModify(resource.getUrl(), new SimpleWatcher() {
|
||||
this.watchMonitor = WatchUtil.ofModify(resource.getUrl(), new SimpleWatcher() {
|
||||
@Override
|
||||
public void onModify(final WatchEvent<?> event, final WatchKey key) {
|
||||
final boolean success = load();
|
||||
|
@@ -228,11 +228,9 @@ public final class Props extends Properties implements TypeGetter<CharSequence>
|
||||
public void autoLoad(final boolean autoReload) {
|
||||
if (autoReload) {
|
||||
Assert.notNull(this.resource, "Properties resource must be not null!");
|
||||
if (null != this.watchMonitor) {
|
||||
// 先关闭之前的监听
|
||||
this.watchMonitor.close();
|
||||
}
|
||||
this.watchMonitor = WatchUtil.createModify(this.resource.getUrl(), new SimpleWatcher() {
|
||||
// 先关闭之前的监听
|
||||
IoUtil.closeQuietly(this.watchMonitor);
|
||||
this.watchMonitor = WatchUtil.ofModify(this.resource.getUrl(), new SimpleWatcher() {
|
||||
@Override
|
||||
public void onModify(final WatchEvent<?> event, final WatchKey key) {
|
||||
load();
|
||||
|
Reference in New Issue
Block a user