ws-mirae-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From i..@apache.org
Subject svn commit: r367056 - /webservices/mirae/trunk/src/mirae/jaxp/org/apache/mirae/j2me/xml/sax/AttributesImpl.java
Date Sun, 08 Jan 2006 18:10:14 GMT
Author: ias
Date: Sun Jan  8 10:10:12 2006
New Revision: 367056

URL: http://svn.apache.org/viewcvs?rev=367056&view=rev
Log:
Fix: getType and getValue with element name must return null in case of index of out bound.

Modified:
    webservices/mirae/trunk/src/mirae/jaxp/org/apache/mirae/j2me/xml/sax/AttributesImpl.java

Modified: webservices/mirae/trunk/src/mirae/jaxp/org/apache/mirae/j2me/xml/sax/AttributesImpl.java
URL: http://svn.apache.org/viewcvs/webservices/mirae/trunk/src/mirae/jaxp/org/apache/mirae/j2me/xml/sax/AttributesImpl.java?rev=367056&r1=367055&r2=367056&view=diff
==============================================================================
--- webservices/mirae/trunk/src/mirae/jaxp/org/apache/mirae/j2me/xml/sax/AttributesImpl.java
(original)
+++ webservices/mirae/trunk/src/mirae/jaxp/org/apache/mirae/j2me/xml/sax/AttributesImpl.java
Sun Jan  8 10:10:12 2006
@@ -135,14 +135,22 @@
 	 * @see org.xml.sax.Attributes#getType(int)
 	 */
 	public String getType(int index) {
-		return (String) types.elementAt(index);
+        if (index < 0 || index >= values.size()) {
+            return null;
+        } else {
+            return (String) types.elementAt(index);
+        }
 	}
 
 	/**
 	 * @see org.xml.sax.Attributes#getValue(int)
 	 */
 	public String getValue(int index) {
-		return (String) values.elementAt(index);
+        if (index < 0 || index >= values.size()) {
+            return null;
+        } else {
+            return (String) values.elementAt(index);
+        }
 	}
 
 	/**
@@ -181,28 +189,27 @@
 	 * @see org.xml.sax.Attributes#getType(java.lang.String, java.lang.String)
 	 */
 	public String getType(String uri, String localName) {
-		return (String) types.elementAt(getIndex(uri, localName));
+		return getType(getIndex(uri, localName));
 	}
 
 	/**
 	 * @see org.xml.sax.Attributes#getType(java.lang.String)
 	 */
 	public String getType(String qName) {
-		return (String) types.elementAt(getIndex(qName));
+		return getType(getIndex(qName));
 	}
 
 	/**
 	 * @see org.xml.sax.Attributes#getValue(java.lang.String, java.lang.String)
 	 */
 	public String getValue(String uri, String localName) {
-		return (String) values.elementAt(getIndex(uri, localName));
+        return getValue(getIndex(uri, localName));
 	}
 
 	/**
 	 * @see org.xml.sax.Attributes#getValue(java.lang.String)
 	 */
 	public String getValue(String qName) {
-		return (String) values.elementAt(getIndex(qName));
+        return getValue(getIndex(qName));
 	}
-
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: mirae-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: mirae-dev-help@ws.apache.org


Mime
View raw message