diff --git a/src/scratchpad/src/org/apache/poi/hwpf/model/FileInformationBlock.java b/src/scratchpad/src/org/apache/poi/hwpf/model/FileInformationBlock.java index 03199b330..01b090830 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/model/FileInformationBlock.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/model/FileInformationBlock.java @@ -161,7 +161,18 @@ public final class FileInformationBlock implements Cloneable assertCbRgFcLcb( "0x0112", 0x00B7, "0x00B7", _cbRgFcLcb ); break; default: - throw new IllegalStateException("Invalid file format version number: " + getNFib()); + /* +When running with the large CommonCrawl corpus we found the following ids in documents that are processed fine: +java.lang.IllegalStateException: Invalid file format version number: 113 +java.lang.IllegalStateException: Invalid file format version number: 191 +java.lang.IllegalStateException: Invalid file format version number: 192 +java.lang.IllegalStateException: Invalid file format version number: 194 +java.lang.IllegalStateException: Invalid file format version number: 195 +java.lang.IllegalStateException: Invalid file format version number: 216 +java.lang.IllegalStateException: Invalid file format version number: 265 +java.lang.IllegalStateException: Invalid file format version number: 267 + */ + logger.log(POILogger.WARN, "Invalid file format version number: " + getNFib()); } } @@ -197,7 +208,7 @@ public final class FileInformationBlock implements Cloneable assertCswNew( "0x0112", 0x0005, "0x0005", _cswNew ); break; default: - throw new IllegalStateException("Invalid file format version number: " + getNFib()); + logger.log(POILogger.WARN, "Invalid file format version number: " + getNFib()); } } @@ -321,7 +332,7 @@ public final class FileInformationBlock implements Cloneable } catch ( Exception exc ) { - stringBuilder.append( "(exc: " + exc.getMessage() + ")" ); + stringBuilder.append("(exc: ").append(exc.getMessage()).append(")"); } stringBuilder.append( "[/FIB2]\n" ); return stringBuilder.toString(); diff --git a/src/scratchpad/testcases/org/apache/poi/hwpf/usermodel/TestBugs.java b/src/scratchpad/testcases/org/apache/poi/hwpf/usermodel/TestBugs.java index 25c21cd6e..c63361d06 100644 --- a/src/scratchpad/testcases/org/apache/poi/hwpf/usermodel/TestBugs.java +++ b/src/scratchpad/testcases/org/apache/poi/hwpf/usermodel/TestBugs.java @@ -894,4 +894,9 @@ public class TestBugs extends TestCase } } } + + public void testRegressionIn315beta2() { + HWPFDocument hwpfDocument = HWPFTestDataSamples.openSampleFile("cap.stanford.edu_profiles_viewbiosketch_facultyid=4009&name=m_maciver.doc"); + assertNotNull(hwpfDocument); + } } diff --git a/test-data/document/cap.stanford.edu_profiles_viewbiosketch_facultyid=4009&name=m_maciver.doc b/test-data/document/cap.stanford.edu_profiles_viewbiosketch_facultyid=4009&name=m_maciver.doc new file mode 100644 index 000000000..643d8224a Binary files /dev/null and b/test-data/document/cap.stanford.edu_profiles_viewbiosketch_facultyid=4009&name=m_maciver.doc differ