Branch: refs/heads/master Home: https://github.com/jenkinsci/configuration-as-code-plugin Commit: eadd066225c5f5dc6ca8e41f9b18393d48845d4e https://github.com/jenkinsci/configuration-as-code-plugin/commit/eadd066225c5f5dc6ca8e41f9b18393d48845d4e Author: Kirill Merkushev <lan...@yandex.ru> Date: 2018-02-27 (Tue, 27 Feb 2018)
Changed paths: M src/main/java/org/jenkinsci/plugins/casc/ConfigurationAsCode.java M src/test/java/org/jenkinsci/plugins/casc/ConfigurationAsCodeTest.java M src/test/java/org/jenkinsci/plugins/casc/misc/TestConfiguration.java Log Message: ----------- safe way to scan for configs (#119) This commit adds resource control for all files, as previously the stream close was neglected which may lead to resource leaks. This commit uses stream api to search configs and run reconfiguration. The stream api here allows to reduce code complexity as we get flat flow of paths, that converted to entries in config and then processed by configurators. In case of files search stream api gives us one line to get the flat stream of paths - it allows us to pay more attention to error handling Passing InputStreams by reference between method without error handling usually looks like antipattern, so all the file logic is concentrated inside of dedicated methods. -- You received this message because you are subscribed to the Google Groups "Jenkins Commits" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-commits+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.