From 2dc223b9e9caa284dd00dfdb505f1e0c69527c5f Mon Sep 17 00:00:00 2001 From: Sergey Vladimirov Date: Thu, 7 Jul 2011 11:04:59 +0000 Subject: [PATCH] allow bad properties parsing git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1143758 13f79535-47bb-0310-9956-ffa450edef68 --- .../src/org/apache/poi/hwpf/model/PropertyNode.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) 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 251458e3f..187e3db18 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.