Github user aledsage commented on a diff in the pull request:

    https://github.com/apache/brooklyn-server/pull/196#discussion_r67018475
  
    --- Diff: 
core/src/main/java/org/apache/brooklyn/core/catalog/internal/CatalogBomScanner.java
 ---
    @@ -268,7 +268,7 @@ private void addLibraryDetails(Bundle bundle, 
Map<String, Object> catalog) {
     
             private String readBom(URL bom) {
                 try (final InputStream ins = bom.openStream()) {
    -                return Streams.readFullyString(ins);
    +                return Streams.readFullyStringAndClose(ins);
    --- End diff --
    
    The stream is created in a try-with-resources [1], so no need to close. Is 
your thinking that if we call `readFullyStringAndClose()` everywhere, then it 
will be easier to make sure we're closing things everywhere? (e.g. we can 
search for uses of readFullyString, and not have many usages to review).
    
    [1] 
https://docs.oracle.com/javase/tutorial/essential/exceptions/tryResourceClose.html


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to