From: Sergey Vladimirov Date: Thu, 7 Jul 2011 11:04:59 +0000 (+0000) Subject: allow bad properties parsing X-Git-Tag: REL_3_8_BETA4~285 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=306fcf34c95c296fb9e9130df3ed837cf895e333;p=poi.git allow bad properties parsing git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1143758 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/scratchpad/src/org/apache/poi/hwpf/model/PropertyNode.java b/src/scratchpad/src/org/apache/poi/hwpf/model/PropertyNode.java index 251458e3f6..187e3db188 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/model/PropertyNode.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/model/PropertyNode.java @@ -57,10 +57,14 @@ public abstract class PropertyNode> implements Compar _cpStart = 0; } - if ( fcStart > fcEnd ) - throw new IllegalArgumentException( "fcStart (" + fcStart - + ") > fcEnd (" + fcEnd + ")" ); - } + if ( _cpEnd < _cpStart ) + { + _logger.log( POILogger.WARN, "A property claimed to end (" + _cpEnd + + ") before start! " + + "Resetting end to start, and hoping for the best" ); + _cpEnd = _cpStart; + } + } /** * @return The start offset of this property's text.