You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2023/12/13 15:20:34 UTC
(camel) branch main updated: Fix unusued parameter
This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/main by this push:
new 8ccfaa9f35b Fix unusued parameter
8ccfaa9f35b is described below
commit 8ccfaa9f35b1f60589a8cfd0c0576acfaaaf9a3b
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Wed Dec 13 16:20:22 2023 +0100
Fix unusued parameter
---
core/camel-util/src/main/java/org/apache/camel/util/IOHelper.java | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/core/camel-util/src/main/java/org/apache/camel/util/IOHelper.java b/core/camel-util/src/main/java/org/apache/camel/util/IOHelper.java
index c5892043305..6556a8c89df 100644
--- a/core/camel-util/src/main/java/org/apache/camel/util/IOHelper.java
+++ b/core/camel-util/src/main/java/org/apache/camel/util/IOHelper.java
@@ -777,7 +777,7 @@ public final class IOHelper {
*
* @param path the path of the file to read
* @param commentPrefix the leading character sequence of comment lines.
- * @param stripEmptylines if true {@code true} the lines matching {@link String#isBlank()} will not appear in the
+ * @param stripBlankLines if true {@code true} the lines matching {@link String#isBlank()} will not appear in the
* result
* @return the filtered content of the file
*/
@@ -785,11 +785,11 @@ public final class IOHelper {
StringBuilder result = new StringBuilder();
try (Stream<String> lines = Files.lines(path)) {
lines
- .filter(l -> !l.isBlank())
+ .filter(l -> stripBlankLines ? !l.isBlank() : true)
.filter(line -> !line.startsWith(commentPrefix))
.forEach(line -> result.append(line).append('\n'));
} catch (IOException e) {
- throw new RuntimeException("Could not read " + path, e);
+ throw new RuntimeException("Cannot read file: " + path, e);
}
return result.toString();
}