]> source.dussan.org Git - poi.git/commitdiff
replace exception with warning
authorSergey Vladimirov <sergey@apache.org>
Sat, 22 Oct 2011 02:01:14 +0000 (02:01 +0000)
committerSergey Vladimirov <sergey@apache.org>
Sat, 22 Oct 2011 02:01:14 +0000 (02:01 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1187638 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/poi/hpsf/VariantBool.java

index 4342cdfddd403c019a2302139a225b40b558bc67..6b1dabc96cdd77ca363e237df504cd17fa6b0937 100644 (file)
@@ -1,12 +1,15 @@
 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 VariantBool
 {
+    private final static POILogger logger = POILogFactory.getLogger( VariantBool.class );
+    
     static final int SIZE = 2;
 
     private boolean _value;
@@ -26,7 +29,18 @@ class VariantBool
             return;
         }
 
-        throw new IllegalPropertySetDataException( "VARIANT_BOOL value '"
-                + value + "' is incorrect" );
+        logger.log( POILogger.WARN, "VARIANT_BOOL value '",
+                Short.valueOf( value ), "' is incorrect" );
+        _value = value != 0;
+    }
+
+    boolean getValue()
+    {
+        return _value;
+    }
+
+    void setValue( boolean value )
+    {
+        this._value = value;
     }
 }