I've fixed a couple of small bugs in SAXParser and QName.

SAXParser incorrectly throws SAXNotSupportedException, the spec says
that this exception should be thrown if the property is recognized, but
not supported.

QName should throw IllegalArgumentException if the passed String is
null.

I've also fixed an indentation problem I've left out from my previous
CopyOnWriteArrayList patch.

Mario

2008-03-27  Mario Torre  <[EMAIL PROTECTED]>

        * gnu/xml/stream/SAXParser.java (getProperty): throw
        SAXNotRecognizedException instead of SAXNotSupportedException
        after fall through all known properties.
        * javax/xml/namespace/QName.java (valueOf): throw
        IllegalArgumentException if string is null.
        * java/util/concurrent/CopyOnWriteArrayList.java (lastIndexOf):
        fixed indentation.
        (indexOf): likewise. 

-- 
Mario Torre, Software Developer, http://www.jroller.com/neugens/
aicas Allerton Interworks Computer Automated Systems GmbH
Haid-und-Neu-Straße 18 * D-76131 Karlsruhe * Germany
http://www.aicas.com   * Tel: +49-721-663 968-53
pgp key: http://subkeys.pgp.net/ PGP Key ID: 80F240CF
Fingerprint: BA39 9666 94EC 8B73 27FA  FC7C 4086 63E3 80F2 40CF

USt-Id: DE216375633, Handelsregister HRB 109481, AG Mannheim
Geschäftsführer: Dr. James J. Hunt

Please, support open standards:
http://opendocumentfellowship.org/petition/
http://www.nosoftwarepatents.com/
### Eclipse Workspace Patch 1.0
#P classpath
Index: gnu/xml/stream/SAXParser.java
===================================================================
RCS file: /sources/classpath/classpath/gnu/xml/stream/SAXParser.java,v
retrieving revision 1.25
diff -u -r1.25 SAXParser.java
--- gnu/xml/stream/SAXParser.java	18 Sep 2007 21:52:32 -0000	1.25
+++ gnu/xml/stream/SAXParser.java	27 Mar 2008 17:34:20 -0000
@@ -233,7 +233,7 @@
       return baseAware ? Boolean.TRUE : Boolean.FALSE;
     if ((GNU_PROPERTIES + "document-xml-encoding").equals(name))
       return xmlEncoding;
-    throw new SAXNotSupportedException(name);
+    throw new SAXNotRecognizedException(name);
   }
 
   public boolean isXIncludeAware()
Index: java/util/concurrent/CopyOnWriteArrayList.java
===================================================================
RCS file: /sources/classpath/classpath/java/util/concurrent/CopyOnWriteArrayList.java,v
retrieving revision 1.9
diff -u -r1.9 CopyOnWriteArrayList.java
--- java/util/concurrent/CopyOnWriteArrayList.java	26 Mar 2008 16:07:29 -0000	1.9
+++ java/util/concurrent/CopyOnWriteArrayList.java	27 Mar 2008 17:34:20 -0000
@@ -236,7 +236,7 @@
 
     for (int i = index; i < data.length; i++)
       if (equals(e, data[i]))
-	return i;
+        return i;
     return -1;
   }
 
@@ -272,7 +272,7 @@
 
     for (int i = index; i >= 0; i--)
       if (equals(e, data[i]))
-	return i;
+        return i;
     return -1;
   }
 
Index: javax/xml/namespace/QName.java
===================================================================
RCS file: /sources/classpath/classpath/javax/xml/namespace/QName.java,v
retrieving revision 1.9
diff -u -r1.9 QName.java
--- javax/xml/namespace/QName.java	11 Jan 2006 22:05:45 -0000	1.9
+++ javax/xml/namespace/QName.java	27 Mar 2008 17:34:20 -0000
@@ -146,6 +146,9 @@
 
   public static QName valueOf(String qNameAsString)
   {
+    if (qNameAsString == null)
+      throw new IllegalArgumentException("qNameAsString can't be null");
+    
     String namespaceUri = "", prefix = null;
     int start = qNameAsString.indexOf('{');
     int end = qNameAsString.indexOf('}');

Reply via email to