Skip to content

Commit

Permalink
Change one exception to warning-log to avoid regressions in mass-tests
Browse files Browse the repository at this point in the history
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
  • Loading branch information
centic9 committed Jun 2, 2024
1 parent 329a659 commit 3f243f6
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ Licensed to the Apache Software Foundation (ASF) under one or more
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;
Expand All @@ -33,6 +35,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more

@Internal
public class PICFAndOfficeArtData {
private static final Logger LOG = LogManager.getLogger(PicturesTable.class);

/**
* Can contain either a {@link EscherBlipRecord} or a {@link EscherBSERecord}.
Expand Down Expand Up @@ -89,7 +92,7 @@ public PICFAndOfficeArtData( byte[] dataStream, int startOffset )
// [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());
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
);

Expand Down
Binary file modified test-data/spreadsheet/stress.xls
Binary file not shown.

0 comments on commit 3f243f6

Please sign in to comment.