mrglavas 2003/11/02 05:13:27 Modified: java/src/org/apache/xerces/dom RangeImpl.java Log: Fixing Bug #21625. Patch submitted by Neil Delima. In several methods INVALID_STATE_ERR was not being raised after detach() was invoked on the Range. Revision Changes Path 1.27 +33 -2 xml-xerces/java/src/org/apache/xerces/dom/RangeImpl.java Index: RangeImpl.java =================================================================== RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/dom/RangeImpl.java,v retrieving revision 1.26 retrieving revision 1.27 diff -u -r1.26 -r1.27 --- RangeImpl.java 8 May 2003 19:52:40 -0000 1.26 +++ RangeImpl.java 2 Nov 2003 13:13:27 -0000 1.27 @@ -108,26 +108,57 @@ } public Node getStartContainer() { + if ( fDetach ) { + throw new DOMException( + DOMException.INVALID_STATE_ERR, + DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "INVALID_STATE_ERR", null)); + } return fStartContainer; } public int getStartOffset() { + if ( fDetach ) { + throw new DOMException( + DOMException.INVALID_STATE_ERR, + DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "INVALID_STATE_ERR", null)); + } return fStartOffset; } public Node getEndContainer() { + if ( fDetach ) { + throw new DOMException( + DOMException.INVALID_STATE_ERR, + DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "INVALID_STATE_ERR", null)); + } return fEndContainer; } + public int getEndOffset() { + if ( fDetach ) { + throw new DOMException( + DOMException.INVALID_STATE_ERR, + DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "INVALID_STATE_ERR", null)); + } return fEndOffset; } public boolean getCollapsed() { + if ( fDetach ) { + throw new DOMException( + DOMException.INVALID_STATE_ERR, + DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "INVALID_STATE_ERR", null)); + } return (fStartContainer == fEndContainer && fStartOffset == fEndOffset); } - public Node getCommonAncestorContainer(){ + public Node getCommonAncestorContainer() { + if ( fDetach ) { + throw new DOMException( + DOMException.INVALID_STATE_ERR, + DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "INVALID_STATE_ERR", null)); + } Vector startV = new Vector(); Node node; for (node=fStartContainer; node != null;
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]