replace exception with warning

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1187636 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Sergey Vladimirov 2011-10-22 02:00:34 +00:00
parent d27da3d905
commit 86d46b4713

View File

@ -1,12 +1,16 @@
package org.apache.poi.hpsf; package org.apache.poi.hpsf;
import org.apache.poi.util.LittleEndian;
import org.apache.poi.util.Internal; 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 @Internal
class TypedPropertyValue class TypedPropertyValue
{ {
private static final POILogger logger = POILogFactory
.getLogger( TypedPropertyValue.class );
private int _type; private int _type;
private Object _value; private Object _value;
@ -26,6 +30,11 @@ class TypedPropertyValue
_value = value; _value = value;
} }
Object getValue()
{
return _value;
}
int read( byte[] data, int startOffset ) int read( byte[] data, int startOffset )
{ {
int offset = startOffset; int offset = startOffset;
@ -34,11 +43,13 @@ class TypedPropertyValue
offset += LittleEndian.SHORT_SIZE; offset += LittleEndian.SHORT_SIZE;
short padding = LittleEndian.getShort( data, offset ); 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; 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 ); offset += readValuePadded( data, offset );
return offset - startOffset; return offset - startOffset;