BAEL-838 Tiny change to keep code consistant. Return null or empty.

This commit is contained in:
iaforek 2017-05-16 12:17:59 +01:00
parent e497266a82
commit a8041fef4f

View File

@ -21,6 +21,6 @@ public class StringHelper {
public static String removeLastCharRegexOptional(String s) { public static String removeLastCharRegexOptional(String s) {
return Optional.ofNullable(s) return Optional.ofNullable(s)
.map(str -> str.replaceAll(".$", "")) .map(str -> str.replaceAll(".$", ""))
.orElse(null); .orElse(s);
} }
} }