From: Dominik Stadler Date: Sun, 2 Jun 2024 11:31:31 +0000 (+0000) Subject: Change one exception to warning-log to avoid regressions in mass-tests X-Git-Tag: REL_5_3_0~16 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=3f243f65ab2cf274a16542fe0bc25f402959f6d3;p=poi.git Change one exception to warning-log to avoid regressions in mass-tests This avoids "breaking" a few documents which could be opened before. git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1918118 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/PICFAndOfficeArtData.java b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/PICFAndOfficeArtData.java index ecf46adc83..5885cff08f 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/PICFAndOfficeArtData.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/PICFAndOfficeArtData.java @@ -19,6 +19,8 @@ package org.apache.poi.hwpf.model; import java.util.LinkedList; import java.util.List; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.apache.poi.ddf.DefaultEscherRecordFactory; import org.apache.poi.ddf.EscherBSERecord; import org.apache.poi.ddf.EscherBlipRecord; @@ -33,6 +35,7 @@ import org.apache.poi.util.LittleEndian; @Internal public class PICFAndOfficeArtData { + private static final Logger LOG = LogManager.getLogger(PicturesTable.class); /** * Can contain either a {@link EscherBlipRecord} or a {@link EscherBSERecord}. @@ -89,7 +92,7 @@ public class PICFAndOfficeArtData { // [MS-ODRAW] allows for multiple records in a OfficeArtInlineSpContainer, which is what we're parsing here. // However, in the context of a HWPF document, there should be only 1. if (_blipRecords.size() != 1) { - throw new IllegalStateException("Should only have one BLIP-Record, but had: " + _blipRecords.size()); + LOG.atWarn().log("Should only have one BLIP-Record, but had: " + _blipRecords.size()); } } } diff --git a/poi-scratchpad/src/test/java/org/apache/poi/hwpf/converter/TestWordToConverterSuite.java b/poi-scratchpad/src/test/java/org/apache/poi/hwpf/converter/TestWordToConverterSuite.java index 0eb956e88c..9cfb4b6d11 100644 --- a/poi-scratchpad/src/test/java/org/apache/poi/hwpf/converter/TestWordToConverterSuite.java +++ b/poi-scratchpad/src/test/java/org/apache/poi/hwpf/converter/TestWordToConverterSuite.java @@ -61,7 +61,6 @@ public class TestWordToConverterSuite { "clusterfuzz-testcase-minimized-POIHWPFFuzzer-4947285593948160.doc", "clusterfuzz-testcase-minimized-POIHWPFFuzzer-5440721166139392.doc", "clusterfuzz-testcase-minimized-POIHWPFFuzzer-5050208641482752.doc", - "clusterfuzz-testcase-minimized-POIHWPFFuzzer-4892412469968896.doc", "clusterfuzz-testcase-minimized-POIHWPFFuzzer-6610789829836800.doc" ); diff --git a/poi-scratchpad/src/test/java/org/apache/poi/hwpf/converter/TestWordToTextConverter.java b/poi-scratchpad/src/test/java/org/apache/poi/hwpf/converter/TestWordToTextConverter.java index f33cffb433..d469f00015 100644 --- a/poi-scratchpad/src/test/java/org/apache/poi/hwpf/converter/TestWordToTextConverter.java +++ b/poi-scratchpad/src/test/java/org/apache/poi/hwpf/converter/TestWordToTextConverter.java @@ -54,7 +54,6 @@ public class TestWordToTextConverter { "clusterfuzz-testcase-minimized-POIHWPFFuzzer-4947285593948160.doc", "clusterfuzz-testcase-minimized-POIHWPFFuzzer-5440721166139392.doc", "clusterfuzz-testcase-minimized-POIHWPFFuzzer-5050208641482752.doc", - "clusterfuzz-testcase-minimized-POIHWPFFuzzer-4892412469968896.doc", "clusterfuzz-testcase-minimized-POIHWPFFuzzer-6610789829836800.doc" ); diff --git a/test-data/spreadsheet/stress.xls b/test-data/spreadsheet/stress.xls index 5a384cdef3..4c9c65f32a 100644 Binary files a/test-data/spreadsheet/stress.xls and b/test-data/spreadsheet/stress.xls differ