From 1a0d6a21b00e15bd318f0d82001b4c452197f02d Mon Sep 17 00:00:00 2001 From: Tim te Beek Date: Sat, 16 Dec 2023 21:41:02 +0100 Subject: [PATCH] Escape slashes following openrewrite/rewrite-templating#39 (#379) See also: - openrewrite/rewrite-templating#39 - openrewrite/rewrite-templating#44 --- .../apache/commons/lang/ApacheCommonsStringUtilsTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/test/java/org/openrewrite/apache/commons/lang/ApacheCommonsStringUtilsTest.java b/src/test/java/org/openrewrite/apache/commons/lang/ApacheCommonsStringUtilsTest.java index b066f16..5cf687f 100644 --- a/src/test/java/org/openrewrite/apache/commons/lang/ApacheCommonsStringUtilsTest.java +++ b/src/test/java/org/openrewrite/apache/commons/lang/ApacheCommonsStringUtilsTest.java @@ -157,7 +157,7 @@ void bar(String in, CharSequence cs) { string = Objects.toString(in, ""); string = Objects.toString(in, "nil"); - string = in == null ? null : in.replaceAll("\\s+", ""); + string = in == null ? null : in.replaceAll("\\\\s+", ""); //bool = StringUtils.endsWithIgnoreCase(in, "suffix"); bool = in == null ? false : in.equalsIgnoreCase("other"); @@ -195,7 +195,7 @@ void bar(String in, CharSequence cs) { string = StringUtils.rightPad(in, 5, ' '); string = StringUtils.rightPad(in, 5, " "); - array = in == null ? null : in.split("\\s+"); + array = in == null ? null : in.split("\\\\s+"); //array = StringUtils.split(in, "*"); bool = StringUtils.startsWith(in, "prefix"); bool = StringUtils.startsWithAny(in, "prefix");