From 666f1df357aa3588135a3a9cc8272458a521026a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=AB=98=E6=98=A5=E6=99=96?= <18220699480@163.com> Date: Wed, 31 Dec 2025 00:39:33 +0800 Subject: [PATCH 1/2] Fix typo: 'textOccurencesInLog' -> 'textOccurrencesInLog' MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 高春晖 <18220699480@163.com> --- .../src/main/java/org/apache/maven/it/Verifier.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/its/core-it-support/maven-it-helper/src/main/java/org/apache/maven/it/Verifier.java b/its/core-it-support/maven-it-helper/src/main/java/org/apache/maven/it/Verifier.java index d8c678058038..ecb359768d90 100644 --- a/its/core-it-support/maven-it-helper/src/main/java/org/apache/maven/it/Verifier.java +++ b/its/core-it-support/maven-it-helper/src/main/java/org/apache/maven/it/Verifier.java @@ -594,22 +594,22 @@ public void verifyTextNotInLog(String text) throws VerificationException, IOExce } public static void verifyTextNotInLog(List lines, String text) throws VerificationException { - if (textOccurencesInLog(lines, text) > 0) { + if (textOccurrencesInLog(lines, text) > 0) { throw new VerificationException("Text found in log: " + text); } } public static void verifyTextInLog(List lines, String text) throws VerificationException { - if (textOccurencesInLog(lines, text) <= 0) { + if (textOccurrencesInLog(lines, text) <= 0) { throw new VerificationException("Text not found in log: " + text); } } public long textOccurrencesInLog(String text) throws IOException { - return textOccurencesInLog(loadLogLines(), text); + return textOccurrencesInLog(loadLogLines(), text); } - public static long textOccurencesInLog(List lines, String text) { + public static long textOccurrencesInLog(List lines, String text) { return lines.stream().filter(line -> stripAnsi(line).contains(text)).count(); } From 35d9b05a3a3c1b16ee6b6d0ea4cb9c70db8ac0a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=AB=98=E6=98=A5=E6=99=96?= <18220699480@163.com> Date: Wed, 31 Dec 2025 13:59:00 +0800 Subject: [PATCH 2/2] Use deprecate-and-replace approach for API compatibility MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Keep the old method textOccurencesInLog with @Deprecated annotation - Add new method textOccurrencesInLog with correct spelling - Old method delegates to new method for backward compatibility Signed-off-by: 高春晖 <18220699480@163.com> --- .../src/main/java/org/apache/maven/it/Verifier.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/its/core-it-support/maven-it-helper/src/main/java/org/apache/maven/it/Verifier.java b/its/core-it-support/maven-it-helper/src/main/java/org/apache/maven/it/Verifier.java index ecb359768d90..32bc85f8f6bb 100644 --- a/its/core-it-support/maven-it-helper/src/main/java/org/apache/maven/it/Verifier.java +++ b/its/core-it-support/maven-it-helper/src/main/java/org/apache/maven/it/Verifier.java @@ -613,6 +613,14 @@ public static long textOccurrencesInLog(List lines, String text) { return lines.stream().filter(line -> stripAnsi(line).contains(text)).count(); } + /** + * @deprecated Use {@link #textOccurrencesInLog(List, String)} instead + */ + @Deprecated + public static long textOccurencesInLog(List lines, String text) { + return textOccurrencesInLog(lines, text); + } + /** * Checks whether the specified line is just an error message from Velocity. Especially old versions of Doxia employ * a very noisy Velocity instance.