[kaffe] CVS kaffe (robilad): Resynced with gnu classpath: dom cleanup

Kaffe CVS cvs-commits at kaffe.org
Sun Feb 13 18:58:52 PST 2005


PatchSet 5533 
Date: 2005/02/14 02:54:23
Author: robilad
Branch: HEAD
Tag: (none) 
Log:
Resynced with gnu classpath: dom cleanup

Members: 
	ChangeLog:1.3577->1.3578 
	libraries/javalib/Makefile.am:1.308->1.309 
	libraries/javalib/Makefile.in:1.394->1.395 
	libraries/javalib/all.files:1.88->1.89 
	libraries/javalib/gnu/xml/dom/Consumer.java:1.8->1.9 
	libraries/javalib/gnu/xml/dom/DomAttr.java:1.9->1.10 
	libraries/javalib/gnu/xml/dom/DomCDATA.java:1.8->1.9(DEAD) 
	libraries/javalib/gnu/xml/dom/DomCDATASection.java:INITIAL->1.1 
	libraries/javalib/gnu/xml/dom/DomCharacterData.java:1.9->1.10 
	libraries/javalib/gnu/xml/dom/DomDOMException.java:INITIAL->1.1 
	libraries/javalib/gnu/xml/dom/DomDoctype.java:1.9->1.10 
	libraries/javalib/gnu/xml/dom/DomDocument.java:1.11->1.12 
	libraries/javalib/gnu/xml/dom/DomDocumentBuilder.java:1.2->1.3 
	libraries/javalib/gnu/xml/dom/DomDocumentConfiguration.java:1.2->1.3 
	libraries/javalib/gnu/xml/dom/DomDocumentFragment.java:INITIAL->1.1 
	libraries/javalib/gnu/xml/dom/DomElement.java:1.8->1.9 
	libraries/javalib/gnu/xml/dom/DomEx.java:1.7->1.8(DEAD) 
	libraries/javalib/gnu/xml/dom/DomFragment.java:1.8->1.9(DEAD) 
	libraries/javalib/gnu/xml/dom/DomImpl.java:1.10->1.11 
	libraries/javalib/gnu/xml/dom/DomIterator.java:1.7->1.8 
	libraries/javalib/gnu/xml/dom/DomNamedNodeMap.java:1.9->1.10 
	libraries/javalib/gnu/xml/dom/DomNode.java:1.12->1.13 
	libraries/javalib/gnu/xml/dom/DomNsNode.java:1.8->1.9 
	libraries/javalib/gnu/xml/dom/DomPI.java:1.8->1.9(DEAD) 
	libraries/javalib/gnu/xml/dom/DomProcessingInstruction.java:INITIAL->1.1 
	libraries/javalib/gnu/xml/dom/DomText.java:1.8->1.9 
	libraries/javalib/gnu/xml/dom/DomXPathExpression.java:1.5->1.6 
	libraries/javalib/gnu/xml/dom/DomXPathResult.java:1.4->1.5 
	libraries/javalib/gnu/xml/dom/JAXPFactory.java:1.8->1.9 
	libraries/javalib/gnu/xml/dom/ls/DomLSEx.java:1.2->1.3(DEAD) 
	libraries/javalib/gnu/xml/dom/ls/DomLSException.java:INITIAL->1.1 
	libraries/javalib/gnu/xml/dom/ls/DomLSParser.java:1.2->1.3 
	libraries/javalib/gnu/xml/dom/ls/DomLSSerializer.java:1.2->1.3 
	libraries/javalib/gnu/xml/util/SAXNullTransformerFactory.java:1.8->1.9 
	libraries/javalib/gnu/xml/xpath/Predicate.java:1.3->1.4 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.3577 kaffe/ChangeLog:1.3578
--- kaffe/ChangeLog:1.3577	Sun Feb 13 22:33:33 2005
+++ kaffe/ChangeLog	Mon Feb 14 02:54:23 2005
@@ -2,6 +2,42 @@
 
 	Resynced with GNU Classpath.
 
+	2005-02-10  Chris Burdess  <dog at gnu.org>
+
+        * gnu/xml/dom/DomAttr.java,
+        gnu/xml/dom/DomCDATA.java,
+        gnu/xml/dom/DomCDATASection.java,
+        gnu/xml/dom/DomCharacterData.java,
+        gnu/xml/dom/DomDOMException.java,
+        gnu/xml/dom/DomDoctype.java,
+        gnu/xml/dom/DomDocument.java,
+        gnu/xml/dom/DomDocumentConfiguration.java,
+        gnu/xml/dom/DomDocumentFragment.java,
+        gnu/xml/dom/DomElement.java,
+        gnu/xml/dom/DomEx.java,
+        gnu/xml/dom/DomFragment.java,
+        gnu/xml/dom/DomImpl.java,
+        gnu/xml/dom/DomIterator.java,
+        gnu/xml/dom/DomNamedNodeMap.java,
+        gnu/xml/dom/DomNode.java,
+        gnu/xml/dom/DomNsNode.java,
+        gnu/xml/dom/DomPI.java,
+        gnu/xml/dom/DomProcessingInstruction.java,
+        gnu/xml/dom/DomText.java,
+        gnu/xml/dom/DomLSEx.java,
+        gnu/xml/dom/DomLSException.java,
+        gnu/xml/dom/DomLSParser.java,
+        gnu/xml/dom/DomLSSerializer.java: Refactoring of exception and DOM
+        implementation class names to conform to Classpath guidelines. Make
+        DomLSException use JDK 1.4+ exception chaining.
+        * gnu/xml/util/SAXNullTransformerFactory.java,
+        gnu/xml/xpath/Predicate.java: Use constants relative to declaring
+        class or interface.
+
+2005-02-13  Dalibor Topic  <robilad at kaffe.org>
+
+	Resynced with GNU Classpath.
+
 	2005-02-10  Michael Koch  <konqueror at gmx.de>
 
         * javax/swing/JTabbedPane.java
Index: kaffe/libraries/javalib/Makefile.am
diff -u kaffe/libraries/javalib/Makefile.am:1.308 kaffe/libraries/javalib/Makefile.am:1.309
--- kaffe/libraries/javalib/Makefile.am:1.308	Sun Feb 13 21:56:28 2005
+++ kaffe/libraries/javalib/Makefile.am	Mon Feb 14 02:54:25 2005
@@ -1646,21 +1646,21 @@
 	gnu/xml/dom/DTDAttributeTypeInfo.java \
 	gnu/xml/dom/DTDElementTypeInfo.java \
 	gnu/xml/dom/DomAttr.java \
-	gnu/xml/dom/DomCDATA.java \
+	gnu/xml/dom/DomCDATASection.java \
 	gnu/xml/dom/DomCharacterData.java \
 	gnu/xml/dom/DomComment.java \
+	gnu/xml/dom/DomDOMException.java \
 	gnu/xml/dom/DomDoctype.java \
 	gnu/xml/dom/DomDocument.java \
 	gnu/xml/dom/DomDocumentBuilder.java \
 	gnu/xml/dom/DomDocumentBuilderFactory.java \
 	gnu/xml/dom/DomDocumentConfiguration.java \
+	gnu/xml/dom/DomDocumentFragment.java \
 	gnu/xml/dom/DomElement.java \
 	gnu/xml/dom/DomEntity.java \
 	gnu/xml/dom/DomEntityReference.java \
 	gnu/xml/dom/DomEvent.java \
-	gnu/xml/dom/DomEx.java \
 	gnu/xml/dom/DomExtern.java \
-	gnu/xml/dom/DomFragment.java \
 	gnu/xml/dom/DomImpl.java \
 	gnu/xml/dom/DomIterator.java \
 	gnu/xml/dom/DomNSResolverContext.java \
@@ -1669,7 +1669,7 @@
 	gnu/xml/dom/DomNodeIterator.java \
 	gnu/xml/dom/DomNotation.java \
 	gnu/xml/dom/DomNsNode.java \
-	gnu/xml/dom/DomPI.java \
+	gnu/xml/dom/DomProcessingInstruction.java \
 	gnu/xml/dom/DomText.java \
 	gnu/xml/dom/DomXPathExpression.java \
 	gnu/xml/dom/DomXPathNSResolver.java \
@@ -1678,7 +1678,7 @@
 	gnu/xml/dom/ImplementationSource.java \
 	gnu/xml/dom/JAXPFactory.java
 gnu_xml_dom_ls_SRCS = \
-	gnu/xml/dom/ls/DomLSEx.java \
+	gnu/xml/dom/ls/DomLSException.java \
 	gnu/xml/dom/ls/DomLSInput.java \
 	gnu/xml/dom/ls/DomLSOutput.java \
 	gnu/xml/dom/ls/DomLSParser.java \
Index: kaffe/libraries/javalib/Makefile.in
diff -u kaffe/libraries/javalib/Makefile.in:1.394 kaffe/libraries/javalib/Makefile.in:1.395
--- kaffe/libraries/javalib/Makefile.in:1.394	Sun Feb 13 21:56:30 2005
+++ kaffe/libraries/javalib/Makefile.in	Mon Feb 14 02:54:26 2005
@@ -2102,21 +2102,21 @@
 	gnu/xml/dom/DTDAttributeTypeInfo.java \
 	gnu/xml/dom/DTDElementTypeInfo.java \
 	gnu/xml/dom/DomAttr.java \
-	gnu/xml/dom/DomCDATA.java \
+	gnu/xml/dom/DomCDATASection.java \
 	gnu/xml/dom/DomCharacterData.java \
 	gnu/xml/dom/DomComment.java \
+	gnu/xml/dom/DomDOMException.java \
 	gnu/xml/dom/DomDoctype.java \
 	gnu/xml/dom/DomDocument.java \
 	gnu/xml/dom/DomDocumentBuilder.java \
 	gnu/xml/dom/DomDocumentBuilderFactory.java \
 	gnu/xml/dom/DomDocumentConfiguration.java \
+	gnu/xml/dom/DomDocumentFragment.java \
 	gnu/xml/dom/DomElement.java \
 	gnu/xml/dom/DomEntity.java \
 	gnu/xml/dom/DomEntityReference.java \
 	gnu/xml/dom/DomEvent.java \
-	gnu/xml/dom/DomEx.java \
 	gnu/xml/dom/DomExtern.java \
-	gnu/xml/dom/DomFragment.java \
 	gnu/xml/dom/DomImpl.java \
 	gnu/xml/dom/DomIterator.java \
 	gnu/xml/dom/DomNSResolverContext.java \
@@ -2125,7 +2125,7 @@
 	gnu/xml/dom/DomNodeIterator.java \
 	gnu/xml/dom/DomNotation.java \
 	gnu/xml/dom/DomNsNode.java \
-	gnu/xml/dom/DomPI.java \
+	gnu/xml/dom/DomProcessingInstruction.java \
 	gnu/xml/dom/DomText.java \
 	gnu/xml/dom/DomXPathExpression.java \
 	gnu/xml/dom/DomXPathNSResolver.java \
@@ -2135,7 +2135,7 @@
 	gnu/xml/dom/JAXPFactory.java
 
 gnu_xml_dom_ls_SRCS = \
-	gnu/xml/dom/ls/DomLSEx.java \
+	gnu/xml/dom/ls/DomLSException.java \
 	gnu/xml/dom/ls/DomLSInput.java \
 	gnu/xml/dom/ls/DomLSOutput.java \
 	gnu/xml/dom/ls/DomLSParser.java \
Index: kaffe/libraries/javalib/all.files
diff -u kaffe/libraries/javalib/all.files:1.88 kaffe/libraries/javalib/all.files:1.89
--- kaffe/libraries/javalib/all.files:1.88	Fri Feb 11 04:56:55 2005
+++ kaffe/libraries/javalib/all.files	Mon Feb 14 02:54:27 2005
@@ -1217,21 +1217,21 @@
 gnu/xml/dom/DTDAttributeTypeInfo.java
 gnu/xml/dom/DTDElementTypeInfo.java
 gnu/xml/dom/DomAttr.java
-gnu/xml/dom/DomCDATA.java
+gnu/xml/dom/DomCDATASection.java
 gnu/xml/dom/DomCharacterData.java
 gnu/xml/dom/DomComment.java
+gnu/xml/dom/DomDOMException.java
 gnu/xml/dom/DomDoctype.java
 gnu/xml/dom/DomDocument.java
 gnu/xml/dom/DomDocumentBuilder.java
 gnu/xml/dom/DomDocumentBuilderFactory.java
 gnu/xml/dom/DomDocumentConfiguration.java
+gnu/xml/dom/DomDocumentFragment.java
 gnu/xml/dom/DomElement.java
 gnu/xml/dom/DomEntity.java
 gnu/xml/dom/DomEntityReference.java
 gnu/xml/dom/DomEvent.java
-gnu/xml/dom/DomEx.java
 gnu/xml/dom/DomExtern.java
-gnu/xml/dom/DomFragment.java
 gnu/xml/dom/DomImpl.java
 gnu/xml/dom/DomIterator.java
 gnu/xml/dom/DomNSResolverContext.java
@@ -1240,7 +1240,7 @@
 gnu/xml/dom/DomNodeIterator.java
 gnu/xml/dom/DomNotation.java
 gnu/xml/dom/DomNsNode.java
-gnu/xml/dom/DomPI.java
+gnu/xml/dom/DomProcessingInstruction.java
 gnu/xml/dom/DomText.java
 gnu/xml/dom/DomXPathExpression.java
 gnu/xml/dom/DomXPathNSResolver.java
@@ -1248,7 +1248,7 @@
 gnu/xml/dom/ImplementationList.java
 gnu/xml/dom/ImplementationSource.java
 gnu/xml/dom/JAXPFactory.java
-gnu/xml/dom/ls/DomLSEx.java
+gnu/xml/dom/ls/DomLSException.java
 gnu/xml/dom/ls/DomLSInput.java
 gnu/xml/dom/ls/DomLSOutput.java
 gnu/xml/dom/ls/DomLSParser.java
Index: kaffe/libraries/javalib/gnu/xml/dom/Consumer.java
diff -u kaffe/libraries/javalib/gnu/xml/dom/Consumer.java:1.8 kaffe/libraries/javalib/gnu/xml/dom/Consumer.java:1.9
--- kaffe/libraries/javalib/gnu/xml/dom/Consumer.java:1.8	Wed Jan  5 17:11:40 2005
+++ kaffe/libraries/javalib/gnu/xml/dom/Consumer.java	Mon Feb 14 02:54:30 2005
@@ -38,16 +38,11 @@
 
 package gnu.xml.dom;
 
-import java.io.IOException;
-
-import org.w3c.dom.Document;
 import org.w3c.dom.DocumentType;
-import org.w3c.dom.DOMImplementation;
 import org.w3c.dom.Node;
 import org.w3c.dom.Text;
 
 import org.xml.sax.Attributes;
-import org.xml.sax.ErrorHandler;
 import org.xml.sax.SAXException;
 import org.xml.sax.ext.Attributes2;
 
Index: kaffe/libraries/javalib/gnu/xml/dom/DomAttr.java
diff -u kaffe/libraries/javalib/gnu/xml/dom/DomAttr.java:1.9 kaffe/libraries/javalib/gnu/xml/dom/DomAttr.java:1.10
--- kaffe/libraries/javalib/gnu/xml/dom/DomAttr.java:1.9	Wed Jan  5 17:11:40 2005
+++ kaffe/libraries/javalib/gnu/xml/dom/DomAttr.java	Mon Feb 14 02:54:30 2005
@@ -38,6 +38,7 @@
 package gnu.xml.dom;
 
 import org.w3c.dom.Attr;
+import org.w3c.dom.DOMException;
 import org.w3c.dom.Element;
 import org.w3c.dom.Node;
 import org.w3c.dom.TypeInfo;
@@ -194,7 +195,7 @@
   {
     if (readonly)
       {
-        throw new DomEx(DomEx.NO_MODIFICATION_ALLOWED_ERR);
+        throw new DomDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR);
       }
     if (value == null)
       {
@@ -284,11 +285,11 @@
   {
     if (parent != null)
       {
-        throw new DomEx (DomEx.HIERARCHY_REQUEST_ERR);
+        throw new DomDOMException(DOMException.HIERARCHY_REQUEST_ERR);
       }
     if (!(e instanceof DomElement))
       {
-        throw new DomEx(DomEx.WRONG_DOCUMENT_ERR);
+        throw new DomDOMException(DOMException.WRONG_DOCUMENT_ERR);
       }
     parent = (DomElement) e;
     depth = parent.depth + 1;
===================================================================
Checking out kaffe/libraries/javalib/gnu/xml/dom/DomCDATA.java
RCS:  /home/cvs/kaffe/kaffe/libraries/javalib/gnu/xml/dom/Attic/DomCDATA.java,v
VERS: 1.8
***************
--- kaffe/libraries/javalib/gnu/xml/dom/DomCDATA.java	Mon Feb 14 02:58:52 2005
+++ /dev/null	Sun Aug  4 19:57:58 2002
@@ -1,91 +0,0 @@
-/* DomCDATA.java -- 
-   Copyright (C) 1999,2000,2001,2004 Free Software Foundation, Inc.
-
-This file is part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; see the file COPYING.  If not, write to the
-Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-02111-1307 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library.  Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module.  An independent module is a module which is not derived from
-or based on this library.  If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so.  If you do not wish to do so, delete this
-exception statement from your version. */
-
-package gnu.xml.dom;
-
-import org.w3c.dom.CDATASection;
-
-/**
- * <p> "CDATASection" implementation.
- * This is a non-core DOM class, supporting the "XML" feature.
- * CDATA sections are just ways to represent text using different
- * delimeters. </p>
- *
- * <p> <em>You are strongly advised not to use CDATASection nodes.</em>
- * The advantage of having slightly prettier ways to print text that may
- * have lots of embedded XML delimiters, such as "&amp;" and "&lt;",
- * can be dwarfed by the cost of dealing with multiple kinds of text
- * nodes in all your algorithms. </p>
- *
- * @author David Brownell
- * @author <a href='mailto:dog at gnu.org'>Chris Burdess</a>
- */
-public class DomCDATA
-  extends DomText
-  implements CDATASection
-{
-  
-  /**
-   * Constructs a CDATA section node associated with the specified
-   * document and holding the specified data.
-   *
-   * <p>This constructor should only be invoked by a Document as part of
-   * its createCDATASection functionality, or through a subclass which is
-   * similarly used in a "Sub-DOM" style layer.
-   *
-   */
-  protected DomCDATA(DomDocument owner, String value)
-  {
-    super(CDATA_SECTION_NODE, owner, value);
-  }
-
-  protected DomCDATA(DomDocument owner, char buf [], int off, int len)
-  {
-    super(CDATA_SECTION_NODE, owner, buf, off, len);
-  }
-
-  /**
-   * <b>DOM L1</b>
-   * Returns the string "#cdata-section".
-   */
-  final public String getNodeName()
-  {
-	return "#cdata-section";
-  }
-  
-}
-
===================================================================
Checking out kaffe/libraries/javalib/gnu/xml/dom/DomCDATASection.java
RCS:  /home/cvs/kaffe/kaffe/libraries/javalib/gnu/xml/dom/DomCDATASection.java,v
VERS: 1.1
***************
--- /dev/null	Sun Aug  4 19:57:58 2002
+++ kaffe/libraries/javalib/gnu/xml/dom/DomCDATASection.java	Mon Feb 14 02:58:52 2005
@@ -0,0 +1,91 @@
+/* DomCDATASection.java -- 
+   Copyright (C) 1999,2000,2001,2004 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+package gnu.xml.dom;
+
+import org.w3c.dom.CDATASection;
+
+/**
+ * <p> "CDATASection" implementation.
+ * This is a non-core DOM class, supporting the "XML" feature.
+ * CDATA sections are just ways to represent text using different
+ * delimeters. </p>
+ *
+ * <p> <em>You are strongly advised not to use CDATASection nodes.</em>
+ * The advantage of having slightly prettier ways to print text that may
+ * have lots of embedded XML delimiters, such as "&amp;" and "&lt;",
+ * can be dwarfed by the cost of dealing with multiple kinds of text
+ * nodes in all your algorithms. </p>
+ *
+ * @author David Brownell
+ * @author <a href='mailto:dog at gnu.org'>Chris Burdess</a>
+ */
+public class DomCDATASection
+  extends DomText
+  implements CDATASection
+{
+  
+  /**
+   * Constructs a CDATA section node associated with the specified
+   * document and holding the specified data.
+   *
+   * <p>This constructor should only be invoked by a Document as part of
+   * its createCDATASection functionality, or through a subclass which is
+   * similarly used in a "Sub-DOM" style layer.
+   *
+   */
+  protected DomCDATASection(DomDocument owner, String value)
+  {
+    super(CDATA_SECTION_NODE, owner, value);
+  }
+
+  protected DomCDATASection(DomDocument owner, char buf [], int off, int len)
+  {
+    super(CDATA_SECTION_NODE, owner, buf, off, len);
+  }
+
+  /**
+   * <b>DOM L1</b>
+   * Returns the string "#cdata-section".
+   */
+  final public String getNodeName()
+  {
+    return "#cdata-section";
+  }
+  
+}
+
Index: kaffe/libraries/javalib/gnu/xml/dom/DomCharacterData.java
diff -u kaffe/libraries/javalib/gnu/xml/dom/DomCharacterData.java:1.9 kaffe/libraries/javalib/gnu/xml/dom/DomCharacterData.java:1.10
--- kaffe/libraries/javalib/gnu/xml/dom/DomCharacterData.java:1.9	Wed Jan  5 17:11:40 2005
+++ kaffe/libraries/javalib/gnu/xml/dom/DomCharacterData.java	Mon Feb 14 02:54:30 2005
@@ -38,8 +38,7 @@
 package gnu.xml.dom;
 
 import org.w3c.dom.CharacterData;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
+import org.w3c.dom.DOMException;
 import org.w3c.dom.events.MutationEvent;
 
 
@@ -82,7 +81,7 @@
   {
     if (isReadonly())
       {
-      throw new DomEx(DomEx.NO_MODIFICATION_ALLOWED_ERR);
+        throw new DomDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR);
       }
     String value = text + arg;
     mutating(value);
@@ -98,12 +97,12 @@
   {
     if (isReadonly())
       {
-        throw new DomEx(DomEx.NO_MODIFICATION_ALLOWED_ERR);
+        throw new DomDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR);
       }
     char[] raw = text.toCharArray();
     if (offset < 0 || count < 0 || offset > raw.length)
       {
-        throw new DomEx(DomEx.INDEX_SIZE_ERR);
+        throw new DomDOMException(DOMException.INDEX_SIZE_ERR);
       }
     if ((offset + count) > raw.length)
       {
@@ -125,7 +124,7 @@
       }
     catch (IndexOutOfBoundsException x)
       {
-        throw new DomEx(DomEx.INDEX_SIZE_ERR);
+        throw new DomDOMException(DOMException.INDEX_SIZE_ERR);
       }
   }
     
@@ -164,7 +163,7 @@
   {
     if (isReadonly())
       {
-      throw new DomEx(DomEx.NO_MODIFICATION_ALLOWED_ERR);
+      throw new DomDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR);
       }
     char[] raw = text.toCharArray();
     char[] tmp = arg.toCharArray ();
@@ -182,7 +181,7 @@
       }
     catch (IndexOutOfBoundsException x)
       {
-        throw new DomEx(DomEx.INDEX_SIZE_ERR);
+        throw new DomDOMException(DOMException.INDEX_SIZE_ERR);
       }
   }
     
@@ -195,14 +194,14 @@
   {
     if (readonly)
       {
-        throw new DomEx(DomEx.NO_MODIFICATION_ALLOWED_ERR);
+        throw new DomDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR);
       }
     char[] raw = text.toCharArray();
     
     // deleteData
     if (offset < 0 || count < 0 || offset > raw.length)
       {
-        throw new DomEx(DomEx.INDEX_SIZE_ERR);
+        throw new DomDOMException(DOMException.INDEX_SIZE_ERR);
       }
     if ((offset + count) > raw.length)
       {
@@ -228,7 +227,7 @@
       }
     catch (IndexOutOfBoundsException x)
       {
-        throw new DomEx(DomEx.INDEX_SIZE_ERR);
+        throw new DomDOMException(DOMException.INDEX_SIZE_ERR);
       }
   }
     
@@ -241,7 +240,7 @@
   {
     if (isReadonly())
       {
-        throw new DomEx (DomEx.NO_MODIFICATION_ALLOWED_ERR);
+        throw new DomDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR);
       }
     if (value == null)
       {
@@ -276,7 +275,7 @@
           {
             return text.substring(offset);
           }
-        throw new DomEx(DomEx.INDEX_SIZE_ERR);
+        throw new DomDOMException(DOMException.INDEX_SIZE_ERR);
       }
   }
 
===================================================================
Checking out kaffe/libraries/javalib/gnu/xml/dom/DomDOMException.java
RCS:  /home/cvs/kaffe/kaffe/libraries/javalib/gnu/xml/dom/DomDOMException.java,v
VERS: 1.1
***************
--- /dev/null	Sun Aug  4 19:57:58 2002
+++ kaffe/libraries/javalib/gnu/xml/dom/DomDOMException.java	Mon Feb 14 02:58:52 2005
@@ -0,0 +1,175 @@
+/* DomDOMException.java -- 
+   Copyright (C) 1999,2000,2001,2004 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+package gnu.xml.dom;
+
+import org.w3c.dom.DOMException;
+import org.w3c.dom.Node;
+
+/**
+ * <p> DOMException implementation.   The version that
+ * is provided by the W3C is abstract, so it can't be instantiated.
+ *
+ * <p> This also provides a bit more information about the error
+ * that is being reported, in terms of the relevant DOM structures
+ * and data.
+ *
+ * @author David Brownell 
+ */
+public class DomDOMException
+  extends DOMException
+{
+
+  /** @serial Data that caused an error to be reported */
+  private String data;
+  
+  /** @serial Node associated with the error. */
+  private Node node;
+  
+  /** @serial Data associated with the error. */
+  private int value;
+  
+  /**
+   * Constructs an exception, with the diagnostic message
+   * corresponding to the specified code.
+   */
+  public DomDOMException(short code)
+  {
+    super(code, diagnostic(code));
+  }
+  
+  /**
+   * Constructs an exception, with the diagnostic message
+   * corresponding to the specified code and additional
+   * information as provided.
+   */
+  public DomDOMException(short code, String data, Node node, int value)
+  {
+    super(code, diagnostic(code));
+    this.data = data;
+    this.node = node;
+    this.value = value;
+  }
+
+  /** Returns the node to which the diagnotic applies, or null. */
+  final public Node getNode()
+  {
+    return node;
+  }
+
+  /** Returns data to which the diagnotic applies, or null. */
+  final public String getData()
+  {
+    return data;
+  }
+
+  /** Returns data to which the diagnotic applies, or null. */
+  final public int getValue()
+  {
+    return value;
+  }
+
+  /**
+   * Returns a diagnostic message that may be slightly more useful
+   * than the generic one, where possible.
+   */
+  public String getMessage()
+  {
+    String retval = super.getMessage();
+    
+    if (data != null)
+      {
+        retval += "\nMore Information: " + data;
+      }
+    if (value != 0)
+      {
+        retval += "\nNumber: " + value;
+      }
+    if (node != null)
+      {
+        retval += "\nNode Name: " + node.getNodeName();
+      }
+    return retval;
+  }
+
+  // these strings should be localizable.
+  
+  private static String diagnostic(short code)
+  {
+    switch (code)
+      {        
+        // DOM L1:
+      case INDEX_SIZE_ERR:
+        return "An index or size is out of range.";
+      case DOMSTRING_SIZE_ERR:
+        return "A string is too big.";
+      case HIERARCHY_REQUEST_ERR:
+        return "The node doesn't belong here.";
+      case WRONG_DOCUMENT_ERR:
+        return "The node belongs in another document.";
+      case INVALID_CHARACTER_ERR:
+        return "That character is not permitted.";
+      case NO_DATA_ALLOWED_ERR:
+        return "This node does not permit data.";
+      case NO_MODIFICATION_ALLOWED_ERR:
+        return "No changes are allowed.";
+      case NOT_FOUND_ERR:
+        return "The node was not found in that context.";
+      case NOT_SUPPORTED_ERR:
+        return "That object is not supported.";
+      case INUSE_ATTRIBUTE_ERR:
+        return "The attribute belongs to a different element.";
+        
+        // DOM L2:
+      case INVALID_STATE_ERR:
+        return "The object is not usable.";
+      case SYNTAX_ERR:
+        return "An illegal string was provided.";
+      case INVALID_MODIFICATION_ERR:
+        return "An object's type may not be changed.";
+      case NAMESPACE_ERR:
+        return "The operation violates XML Namespaces.";
+      case INVALID_ACCESS_ERR:
+        return "Parameter or operation isn't supported by this node.";
+      case TYPE_MISMATCH_ERR:
+        return "The type of the argument is incompatible with the expected type.";
+      }
+    return "Reserved exception number: " + code;
+  }
+
+}
+
Index: kaffe/libraries/javalib/gnu/xml/dom/DomDoctype.java
diff -u kaffe/libraries/javalib/gnu/xml/dom/DomDoctype.java:1.9 kaffe/libraries/javalib/gnu/xml/dom/DomDoctype.java:1.10
--- kaffe/libraries/javalib/gnu/xml/dom/DomDoctype.java:1.9	Wed Jan  5 17:11:40 2005
+++ kaffe/libraries/javalib/gnu/xml/dom/DomDoctype.java	Mon Feb 14 02:54:30 2005
@@ -39,6 +39,7 @@
 
 import java.util.HashMap;
 import org.w3c.dom.DocumentType;
+import org.w3c.dom.DOMException;
 import org.w3c.dom.DOMImplementation;
 import org.w3c.dom.Entity;
 import org.w3c.dom.NamedNodeMap;
@@ -194,7 +195,7 @@
       }
     if (isReadonly())
       {
-        throw new DomEx(DomEx.NO_MODIFICATION_ALLOWED_ERR);
+        throw new DomDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR);
       }
     getEntities();
     
@@ -250,7 +251,7 @@
     
     if (isReadonly())
       {
-        throw new DomEx(DomEx.NO_MODIFICATION_ALLOWED_ERR);
+        throw new DomDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR);
       }
     getNotations();
     
Index: kaffe/libraries/javalib/gnu/xml/dom/DomDocument.java
diff -u kaffe/libraries/javalib/gnu/xml/dom/DomDocument.java:1.11 kaffe/libraries/javalib/gnu/xml/dom/DomDocument.java:1.12
--- kaffe/libraries/javalib/gnu/xml/dom/DomDocument.java:1.11	Wed Jan  5 17:11:40 2005
+++ kaffe/libraries/javalib/gnu/xml/dom/DomDocument.java	Mon Feb 14 02:54:30 2005
@@ -54,7 +54,6 @@
 import org.w3c.dom.EntityReference;
 import org.w3c.dom.NamedNodeMap;
 import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
 import org.w3c.dom.Notation;
 import org.w3c.dom.ProcessingInstruction;
 import org.w3c.dom.Text;
@@ -292,16 +291,16 @@
     if (newChild.getNodeType() == ELEMENT_NODE
         && getDocumentElement() != null)
       {
-        throw new DomEx (DomEx.HIERARCHY_REQUEST_ERR,
-                         "document element already present: " +
-                         getDocumentElement(), newChild, 0);
+        throw new DomDOMException(DOMException.HIERARCHY_REQUEST_ERR,
+                                  "document element already present: " +
+                                  getDocumentElement(), newChild, 0);
       }
     if (newChild.getNodeType() == DOCUMENT_TYPE_NODE
         && getDoctype() != null)
       {
-        throw new DomEx (DomEx.HIERARCHY_REQUEST_ERR,
-                         "document type already present: " +
-                         getDoctype(), newChild, 0);
+        throw new DomDOMException(DOMException.HIERARCHY_REQUEST_ERR,
+                                  "document type already present: " +
+                                  getDoctype(), newChild, 0);
       }
   }
 
@@ -376,12 +375,12 @@
   {
     if (name == null)
       {
-        throw new DomEx (DomEx.NAMESPACE_ERR, name, null, 0);
+        throw new DomDOMException(DOMException.NAMESPACE_ERR, name, null, 0);
       }
     int len = name.length();
     if (len == 0)
       {
-        throw new DomEx (DomEx.NAMESPACE_ERR, name, null, 0);
+        throw new DomDOMException(DOMException.NAMESPACE_ERR, name, null, 0);
       }
 
     // dog: rewritten to use the rules for XML 1.0 and 1.1
@@ -407,7 +406,8 @@
             (c < 0xfdf0 || c > 0xfffd) &&
             (c < 0x10000 || c > 0xeffff))
           {
-            throw new DomEx(DomEx.INVALID_CHARACTER_ERR, name, null, c);
+            throw new DomDOMException(DOMException.INVALID_CHARACTER_ERR,
+                                      name, null, c);
           }
       }
     else
@@ -425,14 +425,16 @@
                 (c >= 0x20dd && c <= 0x20e0))
               {
                 // Compatibility area and Unicode 2.0 exclusions
-                throw new DomEx(DomEx.INVALID_CHARACTER_ERR, name, null, c);
+                throw new DomDOMException(DOMException.INVALID_CHARACTER_ERR,
+                                          name, null, c);
               }
             break;
           default:
             if (c != ':' && c != '_' && (c < 0x02bb || c > 0x02c1) &&
                 c != 0x0559 && c != 0x06e5 && c != 0x06e6)
               {
-                throw new DomEx(DomEx.INVALID_CHARACTER_ERR, name, null, c);
+                throw new DomDOMException(DOMException.INVALID_CHARACTER_ERR,
+                                          name, null, c);
               }
           }
       }
@@ -464,7 +466,8 @@
                 (c < 0x0300 || c > 0x036f) &&
                 (c < 0x203f || c > 0x2040))
               {
-                throw new DomEx(DomEx.INVALID_CHARACTER_ERR, name, null, c);
+                throw new DomDOMException(DOMException.INVALID_CHARACTER_ERR, name,
+                                          null, c);
               }
           }
         else
@@ -487,7 +490,8 @@
                     (c >= 0x20dd && c <= 0x20e0))
                   {
                     // Compatibility area and Unicode 2.0 exclusions
-                    throw new DomEx(DomEx.INVALID_CHARACTER_ERR, name, null, c);
+                    throw new DomDOMException(DOMException.INVALID_CHARACTER_ERR,
+                                              name, null, c);
                   }
                 break;
               default:
@@ -495,7 +499,8 @@
                     c != 0x0387 && (c < 0x02bb || c > 0x02c1) &&
                     c != 0x0559 && c != 0x06e5 && c != 0x06e6 && c != 0x00b7)
                   {
-                    throw new DomEx(DomEx.INVALID_CHARACTER_ERR, name, null, c);
+                    throw new DomDOMException(DOMException.INVALID_CHARACTER_ERR,
+                                              name, null, c);
                   }
               }
           }
@@ -517,7 +522,8 @@
         if (index == 0 || index == (len - 1) ||
             name.lastIndexOf(':') != index)
           {
-            throw new DomEx(DomEx.NAMESPACE_ERR, name, null, 0);
+            throw new DomDOMException(DOMException.NAMESPACE_ERR,
+                                      name, null, 0);
           }
       }
   }
@@ -552,8 +558,8 @@
                 continue;
               }
           }
-        throw new DomEx(DomEx.INVALID_CHARACTER_ERR,
-                        new String(buf, off, len), null, c);
+        throw new DomDOMException(DOMException.INVALID_CHARACTER_ERR,
+                                  new String(buf, off, len), null, c);
       }
   }
 
@@ -602,22 +608,23 @@
         if (namespaceURI != null
             && !XMLConstants.XML_NS_URI.equals(namespaceURI))
           {
-            throw new DomEx(DomEx.NAMESPACE_ERR,
-                            "xml namespace is always " +
-                            XMLConstants.XML_NS_URI, this, 0);
+            throw new DomDOMException(DOMException.NAMESPACE_ERR,
+                                      "xml namespace is always " +
+                                      XMLConstants.XML_NS_URI, this, 0);
           }
         namespaceURI = XMLConstants.XML_NS_URI;
       }
     else if (XMLConstants.XMLNS_ATTRIBUTE.equals(name) ||
              name.startsWith("xmlns:"))
       {
-        throw new DomEx(DomEx.NAMESPACE_ERR,
-                        "xmlns is reserved", this, 0);
+        throw new DomDOMException(DOMException.NAMESPACE_ERR,
+                                  "xmlns is reserved", this, 0);
       }
     else if (namespaceURI == null && name.indexOf(':') != -1)
       {
-        throw new DomEx(DomEx.NAMESPACE_ERR,
-                        "prefixed name '" + name + "' needs a URI", this, 0);
+        throw new DomDOMException(DOMException.NAMESPACE_ERR,
+                                  "prefixed name '" + name +
+                                  "' needs a URI", this, 0);
       }
     
     Element  element = new DomElement(this, namespaceURI, name);
@@ -660,7 +667,7 @@
    */
   public DocumentFragment createDocumentFragment()
   {
-    return new DomFragment(this);
+    return new DomDocumentFragment(this);
   }
 
   /**
@@ -711,7 +718,7 @@
       {
         checkChar(value, "1.1".equals(version));
       }
-    return new DomCDATA(this, value);
+    return new DomCDATASection(this, value);
   }
 
   /**
@@ -723,7 +730,7 @@
       {
         checkChar(buf, off, len, "1.1".equals(version));
       }
-    return new DomCDATA(this, buf, off, len);
+    return new DomCDATASection(this, buf, off, len);
   }
 
   /**
@@ -739,12 +746,13 @@
         checkName(target, xml11);
         if ("xml".equalsIgnoreCase(target))

*** Patch too long, truncated ***



More information about the kaffe mailing list