提交 b34852cf 编写于 作者: T terrymanu

fix #48

上级 4b9b8c8d
...@@ -46,6 +46,11 @@ public class YamlShardingDataSource extends ShardingDataSource { ...@@ -46,6 +46,11 @@ public class YamlShardingDataSource extends ShardingDataSource {
} }
private static YamlConfig unmarshal(final File yamlFile) throws IOException { private static YamlConfig unmarshal(final File yamlFile) throws IOException {
return new Yaml(new Constructor(YamlConfig.class)).loadAs(new InputStreamReader(new FileInputStream(yamlFile), "UTF-8"), YamlConfig.class); try (
FileInputStream fileInputStream = new FileInputStream(yamlFile);
InputStreamReader inputStreamReader = new InputStreamReader(fileInputStream, "UTF-8")
) {
return new Yaml(new Constructor(YamlConfig.class)).loadAs(inputStreamReader, YamlConfig.class);
}
} }
} }
...@@ -6,11 +6,12 @@ weight = 1 ...@@ -6,11 +6,12 @@ weight = 1
# Release Notes # Release Notes
## 1.1.0-SNAPSHOT ## 1.1.1-SNAPSHOT
### 缺陷修正: ### 缺陷修正:
1. [ISSUE #43](https://github.com/dangdangdotcom/sharding-jdbc/issues/43) yaml文件中包含中文,且操作系统模式不是utf-8编码导致的yaml不能解析 1. [ISSUE #43](https://github.com/dangdangdotcom/sharding-jdbc/issues/43) yaml文件中包含中文,且操作系统模式不是utf-8编码导致的yaml不能解析
1. [ISSUE #48](https://github.com/dangdangdotcom/sharding-jdbc/issues/48) yaml文件读取后未关闭
## 1.1.0 ## 1.1.0
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册