poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ser...@apache.org
Subject svn commit: r1187636 - /poi/trunk/src/java/org/apache/poi/hpsf/TypedPropertyValue.java
Date Sat, 22 Oct 2011 02:00:34 GMT
Author: sergey
Date: Sat Oct 22 02:00:34 2011
New Revision: 1187636

URL: http://svn.apache.org/viewvc?rev=1187636&view=rev
Log:
replace exception with warning

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

Modified: poi/trunk/src/java/org/apache/poi/hpsf/TypedPropertyValue.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hpsf/TypedPropertyValue.java?rev=1187636&r1=1187635&r2=1187636&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hpsf/TypedPropertyValue.java (original)
+++ poi/trunk/src/java/org/apache/poi/hpsf/TypedPropertyValue.java Sat Oct 22 02:00:34 2011
@@ -1,12 +1,16 @@
 package org.apache.poi.hpsf;
 
-import org.apache.poi.util.LittleEndian;
-
 import org.apache.poi.util.Internal;
+import org.apache.poi.util.LittleEndian;
+import org.apache.poi.util.POILogFactory;
+import org.apache.poi.util.POILogger;
 
 @Internal
 class TypedPropertyValue
 {
+    private static final POILogger logger = POILogFactory
+            .getLogger( TypedPropertyValue.class );
+
     private int _type;
 
     private Object _value;
@@ -26,6 +30,11 @@ class TypedPropertyValue
         _value = value;
     }
 
+    Object getValue()
+    {
+        return _value;
+    }
+
     int read( byte[] data, int startOffset )
     {
         int offset = startOffset;
@@ -34,11 +43,13 @@ class TypedPropertyValue
         offset += LittleEndian.SHORT_SIZE;
 
         short padding = LittleEndian.getShort( data, offset );
-        if ( padding != 0 )
-            throw new IllegalPropertySetDataException(
-                    "Property padding at offset " + offset
-                            + " MUST be 0, but it's value is " + padding );
         offset += LittleEndian.SHORT_SIZE;
+        if ( padding != 0 )
+        {
+            logger.log( POILogger.WARN, "TypedPropertyValue padding at offset "
+                    + offset + " MUST be 0, but it's value is " + padding );
+        }
+
         offset += readValuePadded( data, offset );
 
         return offset - startOffset;



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


Mime
View raw message