This commit is contained in:
Looly
2023-03-27 02:02:10 +08:00
parent 16f7549c7d
commit 4fca8310e7
96 changed files with 307 additions and 315 deletions

View File

@@ -166,7 +166,7 @@ public class GroupedSet extends HashMap<String, LinkedHashSet<String>> {
// log.error(e, "Load GroupSet error!");
return false;
} finally {
IoUtil.close(settingStream);
IoUtil.closeQuietly(settingStream);
}
return true;
}
@@ -229,7 +229,7 @@ public class GroupedSet extends HashMap<String, LinkedHashSet<String>> {
valueSet.add(line);
}
} finally {
IoUtil.close(reader);
IoUtil.closeQuietly(reader);
}
}

View File

@@ -222,7 +222,7 @@ public class Setting extends AbsSetting implements Map<String, String> {
this.watchMonitor.start();
StaticLog.debug("Auto load for [{}] listenning...", this.resource.getUrl());
} else {
IoUtil.close(this.watchMonitor);
IoUtil.closeQuietly(this.watchMonitor);
this.watchMonitor = null;
}
}

View File

@@ -88,7 +88,7 @@ public class SettingLoader {
log.error(e, "Load setting error!");
return false;
} finally {
IoUtil.close(settingStream);
IoUtil.closeQuietly(settingStream);
}
return true;
}
@@ -140,7 +140,7 @@ public class SettingLoader {
this.groupedMap.put(group, keyValue[0].trim(), value);
}
} finally {
IoUtil.close(reader);
IoUtil.closeQuietly(reader);
}
}
@@ -189,7 +189,7 @@ public class SettingLoader {
writer = FileUtil.getPrintWriter(file, charset, false);
store(writer);
} finally {
IoUtil.close(writer);
IoUtil.closeQuietly(writer);
}
}

View File

@@ -219,7 +219,7 @@ public final class Props extends Properties implements TypeGetter<CharSequence>
});
this.watchMonitor.start();
} else {
IoUtil.close(this.watchMonitor);
IoUtil.closeQuietly(this.watchMonitor);
this.watchMonitor = null;
}
}
@@ -399,7 +399,7 @@ public final class Props extends Properties implements TypeGetter<CharSequence>
} catch (final IOException e) {
throw new IORuntimeException(e, "Store properties to [{}] error!", absolutePath);
} finally {
IoUtil.close(writer);
IoUtil.closeQuietly(writer);
}
}

View File

@@ -96,7 +96,7 @@ public class YamlUtil {
return yaml.loadAs(reader, type);
} finally {
if (isCloseReader) {
IoUtil.close(reader);
IoUtil.closeQuietly(reader);
}
}
}