]> source.dussan.org Git - poi.git/commitdiff
Change one exception to warning-log to avoid regressions in mass-tests
authorDominik Stadler <centic@apache.org>
Sun, 2 Jun 2024 11:31:31 +0000 (11:31 +0000)
committerDominik Stadler <centic@apache.org>
Sun, 2 Jun 2024 11:31:31 +0000 (11:31 +0000)
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

poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/PICFAndOfficeArtData.java
poi-scratchpad/src/test/java/org/apache/poi/hwpf/converter/TestWordToConverterSuite.java
poi-scratchpad/src/test/java/org/apache/poi/hwpf/converter/TestWordToTextConverter.java
test-data/spreadsheet/stress.xls

index ecf46adc838f83272b4e72bb460bfff1a6c7d8fd..5885cff08fa57c1f5fd04e00e08f7eb5b8bf6de7 100644 (file)
@@ -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());
             }
         }
     }
index 0eb956e88c909b73764194f79c8563a6c1c794eb..9cfb4b6d11bbd327c74e75be73335bf526e31add 100644 (file)
@@ -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"
     );
 
index f33cffb4335a0a975c291cabfbe3e4963d9c675b..d469f00015f19bc8707613e072244a9efa8dc6c5 100644 (file)
@@ -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"
     );
 
index 5a384cdef31c0a4c9fb0322cc3d4690adf615063..4c9c65f32a1908ad8fd3b178b171b73c07bb1cf5 100644 (file)
Binary files a/test-data/spreadsheet/stress.xls and b/test-data/spreadsheet/stress.xls differ