From 0f18de4b062231678724dfa368f006e024a025b9 Mon Sep 17 00:00:00 2001 From: PJ Fanning Date: Fri, 10 Dec 2021 21:13:01 +0000 Subject: [PATCH] [bug-65739] reduce log level of message to debug git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1895794 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/poi/xwpf/usermodel/TestXWPFBugs.java | 2 +- .../org/apache/poi/hpsf/CodePageString.java | 17 ++++++----------- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/poi-ooxml/src/test/java/org/apache/poi/xwpf/usermodel/TestXWPFBugs.java b/poi-ooxml/src/test/java/org/apache/poi/xwpf/usermodel/TestXWPFBugs.java index 4c1bf83e54..f3ce643603 100644 --- a/poi-ooxml/src/test/java/org/apache/poi/xwpf/usermodel/TestXWPFBugs.java +++ b/poi-ooxml/src/test/java/org/apache/poi/xwpf/usermodel/TestXWPFBugs.java @@ -238,7 +238,7 @@ class TestXWPFBugs { assertThrows(NullPointerException.class, () -> styles.getUsedStyleList(null), - "Pasisng in 'null' triggers an exception"); + "Passing in 'null' triggers an exception"); XWPFStyle style = doc.getStyles().getStyle("TableauGrille41"); doc.getStyles().getUsedStyleList(style); diff --git a/poi/src/main/java/org/apache/poi/hpsf/CodePageString.java b/poi/src/main/java/org/apache/poi/hpsf/CodePageString.java index 44fde36a21..3217211b8f 100644 --- a/poi/src/main/java/org/apache/poi/hpsf/CodePageString.java +++ b/poi/src/main/java/org/apache/poi/hpsf/CodePageString.java @@ -16,19 +16,14 @@ ==================================================================== */ package org.apache.poi.hpsf; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.apache.poi.util.*; + import java.io.IOException; import java.io.OutputStream; import java.io.UnsupportedEncodingException; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; -import org.apache.poi.util.CodePageUtil; -import org.apache.poi.util.IOUtils; -import org.apache.poi.util.Internal; -import org.apache.poi.util.LittleEndian; -import org.apache.poi.util.LittleEndianByteArrayInputStream; -import org.apache.poi.util.LittleEndianConsts; - import static org.apache.logging.log4j.util.Unbox.box; @Internal @@ -91,11 +86,11 @@ public class CodePageString { final int terminator = result.indexOf( '\0' ); if ( terminator == -1 ) { LOG.atWarn().log("String terminator (\\0) for CodePageString property value not found. " + - "Continue without trimming and hope for the best."); + "Continue without trimming and hope for the best."); return result; } if ( terminator != result.length() - 1 ) { - LOG.atWarn().log("String terminator (\\0) for CodePageString property value occurred before the end of " + + LOG.atDebug().log("String terminator (\\0) for CodePageString property value occurred before the end of " + "string. Trimming and hope for the best."); } return result.substring( 0, terminator ); -- 2.39.5