You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Apparenlty snakeyaml does not close the InputStream you give it, so to prevent problems (especially on Windows), we need to defensively close the stream in YamlProcessor.
This test fails on Windows:
@Test
public void test() throws Exception {
Files.copy(Paths.get("src", "test", "resources", "test.yml"), Paths.get("target", "test.yml"), StandardCopyOption.REPLACE_EXISTING);
new Yaml().loadAll(new FileInputStream("target/test.yml"));
Files.delete(Paths.get("target", "test.yml"));
}
but this one passes:
@Test
public void test() throws Exception {
Files.copy(Paths.get("src", "test", "resources", "test.yml"), Paths.get("target", "test.yml"), StandardCopyOption.REPLACE_EXISTING);
FileInputStream stream = new FileInputStream("target/test.yml");
new Yaml().loadAll(stream);
stream.close();
Files.delete(Paths.get("target", "test.yml"));
}
Discovered by a Spring Cloud user: spring-cloud/spring-cloud-config#45, but will also affect Spring Boot users if they have config files on the file system and then try to delete them.
Dave Syer opened SPR-12487 and commented
Apparenlty snakeyaml does not close the InputStream you give it, so to prevent problems (especially on Windows), we need to defensively close the stream in YamlProcessor.
This test fails on Windows:
but this one passes:
Discovered by a Spring Cloud user: spring-cloud/spring-cloud-config#45, but will also affect Spring Boot users if they have config files on the file system and then try to delete them.
Affects: 4.1.2
Issue Links:
Referenced from: commits 9a71a0c
The text was updated successfully, but these errors were encountered: