poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n...@apache.org
Subject svn commit: r1207477 - /poi/trunk/src/java/org/apache/poi/hpsf/CodePageString.java
Date Mon, 28 Nov 2011 17:38:30 GMT
Author: nick
Date: Mon Nov 28 17:38:29 2011
New Revision: 1207477

URL: http://svn.apache.org/viewvc?rev=1207477&view=rev
Log:
Demote the HPSF CodePageString null check from an exception to a Warning, as we seem to be
hitting it incorrectly (see bug #52258 for details)

Modified:
    poi/trunk/src/java/org/apache/poi/hpsf/CodePageString.java

Modified: poi/trunk/src/java/org/apache/poi/hpsf/CodePageString.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hpsf/CodePageString.java?rev=1207477&r1=1207476&r2=1207477&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hpsf/CodePageString.java (original)
+++ poi/trunk/src/java/org/apache/poi/hpsf/CodePageString.java Mon Nov 28 17:38:29 2011
@@ -158,10 +158,16 @@ class CodePageString
         offset += LittleEndian.INT_SIZE;
 
         _value = LittleEndian.getByteArray( data, offset, size );
-        if ( _value[size - 1] != 0 )
-            throw new IllegalPropertySetDataException(
-                    "CodePageString started at offset #" + offset
-                            + " is not NULL-terminated" );
+        if ( _value[size - 1] != 0 ) {
+            // TODO Some files, such as TestVisioWithCodepage.vsd, are currently
+            //  triggering this for values that don't look like codepages
+            // See Bug #52258 for details
+            logger.log(POILogger.WARN, "CodePageString started at offset #" + offset
+                        + " is not NULL-terminated" );
+//            throw new IllegalPropertySetDataException(
+//                    "CodePageString started at offset #" + offset
+//                            + " is not NULL-terminated" );
+        }
     }
 
     CodePageString( String string, int codepage )



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


Mime
View raw message