Skip to content

Commit

Permalink
fix #48
Browse files Browse the repository at this point in the history
  • Loading branch information
terrymanu committed Apr 6, 2016
1 parent 4b9b8c8 commit b34852c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ public YamlShardingDataSource(final Map<String, DataSource> dataSource, final Fi
}

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);
}
}
}
3 changes: 2 additions & 1 deletion sharding-jdbc-doc/content/post/release_notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ weight = 1

# 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 #48](https://github.com/dangdangdotcom/sharding-jdbc/issues/48) yaml文件读取后未关闭

## 1.1.0

Expand Down

0 comments on commit b34852c

Please sign in to comment.