You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@poi.apache.org by ce...@apache.org on 2016/06/30 21:06:04 UTC

svn commit: r1750864 - in /poi/trunk: src/scratchpad/src/org/apache/poi/hwpf/model/ src/scratchpad/testcases/org/apache/poi/hwpf/usermodel/ test-data/document/

Author: centic
Date: Thu Jun 30 21:06:04 2016
New Revision: 1750864

URL: http://svn.apache.org/viewvc?rev=1750864&view=rev
Log:
Bug 59739: For now fix the regression in FileInformationBlock which was introduced after 3.15-beta1 so that the documents can be loaded again pending a full fix as discussed in the bug.

Added:
    poi/trunk/test-data/document/cap.stanford.edu_profiles_viewbiosketch_facultyid=4009&name=m_maciver.doc
Modified:
    poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/model/FileInformationBlock.java
    poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/usermodel/TestBugs.java

Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/model/FileInformationBlock.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/model/FileInformationBlock.java?rev=1750864&r1=1750863&r2=1750864&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/model/FileInformationBlock.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/model/FileInformationBlock.java Thu Jun 30 21:06:04 2016
@@ -161,7 +161,18 @@ public final class FileInformationBlock
             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
             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
         }
         catch ( Exception exc )
         {
-            stringBuilder.append( "(exc: " + exc.getMessage() + ")" );
+            stringBuilder.append("(exc: ").append(exc.getMessage()).append(")");
         }
         stringBuilder.append( "[/FIB2]\n" );
         return stringBuilder.toString();

Modified: poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/usermodel/TestBugs.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/usermodel/TestBugs.java?rev=1750864&r1=1750863&r2=1750864&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/usermodel/TestBugs.java (original)
+++ poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/usermodel/TestBugs.java Thu Jun 30 21:06:04 2016
@@ -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);
+    }
 }

Added: poi/trunk/test-data/document/cap.stanford.edu_profiles_viewbiosketch_facultyid=4009&name=m_maciver.doc
URL: http://svn.apache.org/viewvc/poi/trunk/test-data/document/cap.stanford.edu_profiles_viewbiosketch_facultyid%3D4009%26name%3Dm_maciver.doc?rev=1750864&view=auto
==============================================================================
Binary files poi/trunk/test-data/document/cap.stanford.edu_profiles_viewbiosketch_facultyid=4009&name=m_maciver.doc (added) and poi/trunk/test-data/document/cap.stanford.edu_profiles_viewbiosketch_facultyid=4009&name=m_maciver.doc Thu Jun 30 21:06:04 2016 differ



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org