Revision: 18435
http://sourceforge.net/p/gate/code/18435
Author: ian_roberts
Date: 2014-11-06 19:01:41 +0000 (Thu, 06 Nov 2014)
Log Message:
-----------
More meaningful exception message for InvalidOffsetException
Modified Paths:
--------------
gate/trunk/src/main/gate/annotation/AnnotationSetImpl.java
Modified: gate/trunk/src/main/gate/annotation/AnnotationSetImpl.java
===================================================================
--- gate/trunk/src/main/gate/annotation/AnnotationSetImpl.java 2014-11-06
14:52:48 UTC (rev 18434)
+++ gate/trunk/src/main/gate/annotation/AnnotationSetImpl.java 2014-11-06
19:01:41 UTC (rev 18435)
@@ -862,7 +862,10 @@
private final Node[] getNodes(Long start, Long end) throws
InvalidOffsetException
{
// are the offsets valid?
- if(!doc.isValidOffsetRange(start, end)) throw new InvalidOffsetException();
+ if(!doc.isValidOffsetRange(start, end)) {
+ throw new InvalidOffsetException("Offsets [" + start + ":" + end +
+ "] not valid for this document of size " +
doc.getContent().size());
+ }
// the set has to be indexed by position in order to add, as we need
// to find out if nodes need creating or if they exist already
if(nodesByOffset == null) {
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
_______________________________________________
GATE-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gate-cvs