This is an automated email from the ASF dual-hosted git repository.
ahuber pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/causeway.git
The following commit(s) were added to refs/heads/master by this push:
new 6ae5407625 CAUSEWAY-3404: fixes prev. commit
6ae5407625 is described below
commit 6ae5407625b427759d86bc50f8324c2d9dfe247c
Author: Andi Huber <[email protected]>
AuthorDate: Thu Jan 18 13:21:33 2024 +0100
CAUSEWAY-3404: fixes prev. commit
- don't break the general paradigm of operators acting as identity when
operating on null
---
.../java/org/apache/causeway/commons/internal/base/_Strings.java | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git
a/commons/src/main/java/org/apache/causeway/commons/internal/base/_Strings.java
b/commons/src/main/java/org/apache/causeway/commons/internal/base/_Strings.java
index bf6b8fc2eb..071020fdcc 100644
---
a/commons/src/main/java/org/apache/causeway/commons/internal/base/_Strings.java
+++
b/commons/src/main/java/org/apache/causeway/commons/internal/base/_Strings.java
@@ -830,9 +830,11 @@ public final class _Strings {
/**
* Converts given literal into a double-quoted literal, unless the literal
is {@code null},
- * in which case {@code ""} is returned.
+ * in which case {@code null} is returned.
*/
- public static final StringOperator asDoubleQuoted = s->s!=null ? "\"" + s
+ "\"" : "\"\"";
+ public static final StringOperator asDoubleQuoted = s->s!=null
+ ? "\"" + s + "\""
+ : null;
public static final StringOperator asLowerDashed = asLowerCase
.compose(s->_Strings.condenseWhitespaces(s, "-"));