From fccce54d52929df243fa65ef1d4bd89c0ba49470 Mon Sep 17 00:00:00 2001 From: Fabrice Bibonne Date: Fri, 29 Dec 2023 14:03:22 +0100 Subject: [PATCH] Fix error mark position for PatternParseException PatternParseException.toDetailedString() return a String with a mark to specify the error position in the pattern. The mark takes place in the second line in the String returned. Because PatternParseFailureAnalyzer.analyze appended "Invalid mapping pattern detected:" at the beginning of the returned String, the mark was not well positioned. Now, a "\n" is inserted after "Invalid mapping pattern detected:" and the mark is well positioned See gh-38944 --- .../analyzer/PatternParseFailureAnalyzer.java | 2 +- .../analyzer/PatternParseFailureAnalyzerTests.java | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/diagnostics/analyzer/PatternParseFailureAnalyzer.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/diagnostics/analyzer/PatternParseFailureAnalyzer.java index e4cf51746c4c..a9eae1eb2268 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/diagnostics/analyzer/PatternParseFailureAnalyzer.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/diagnostics/analyzer/PatternParseFailureAnalyzer.java @@ -30,7 +30,7 @@ class PatternParseFailureAnalyzer extends AbstractFailureAnalyzer