ottlinger commented on code in PR #233:
URL: https://github.com/apache/creadur-rat/pull/233#discussion_r1564198283


##########
apache-rat-core/src/main/java/org/apache/rat/configuration/builders/ChildContainerBuilder.java:
##########
@@ -52,39 +52,42 @@ protected ChildContainerBuilder() {
 
     /**
      * Reads a text file. Each line becomes a text matcher in the resulting 
list.
-     * 
+     *
      * @param resourceName the name of the resource to read.
      * @return a List of Matchers, one for each non-empty line in the input 
file.
      */
     public AbstractBuilder setResource(String resourceName) {
-          URL url = this.getClass().getResource(resourceName);
-            try (final InputStream in = url.openStream()) {
-                BufferedReader buffer = new BufferedReader(new 
InputStreamReader(in, StandardCharsets.UTF_8));
-                String txt;
-                while (null != (txt = buffer.readLine())) {
-                    txt = txt.trim();
-                    if (StringUtils.isNotBlank(txt)) {
-                        children.add(Builder.text().setText(txt));
-                    }
+        URL url = this.getClass().getResource(resourceName);
+        try (final InputStream in = url.openStream()) {
+            BufferedReader buffer = new BufferedReader(new 
InputStreamReader(in, StandardCharsets.UTF_8));

Review Comment:
   Would we want to put the buffered reader into the tryWithResources as well?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@creadur.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to