TAMAYA-277: LHF: use try-with-resources with BufferedReader #49
Conversation
This opens a BufferedReader in a try-with-resources block to ensure that the resource is properly closed in the event of an exception.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@acoburn I added some more changes ..... would you fancy to add some more tests. To me the OSGi-stuff does not seem very easy to test :(
code/core/src/main/java/org/apache/tamaya/core/internal/OSGIServiceLoader.java
Outdated
Show resolved
Hide resolved
@ottlinger the best way to test OSGi is with Pax-Exam, but that adds a huge amount of complexity and should probably be part of a separate effort. In the meantime, though, I can definitely add some simple tests. |
... or we merge the changes although they break the quality build: Do you see a chance to reduce the duplicate-warning? I tried to extract the stuff into a method, but that only made things worse. |
I suppose the question is whether Sonar non-compliance should be allowed to fail a build or not. I personally find Sonar to be very useful, but I typically put it in a
|
@ottlinger all the checks now pass. |
@acoburn thanks - my IDE marked the first lines in
Thanks 👍 |
This opens a
BufferedReader
in a try-with-resources block to ensure that the resource is properly closed in the event of an exception.