Author: mrglavas
Date: Fri Feb  5 04:06:33 2010
New Revision: 906804

URL: http://svn.apache.org/viewvc?rev=906804&view=rev
Log:
Fixing JIRA Bug #1416: http://issues.apache.org/jira/browse/XERCESJ-1416. An 
NPE could occur when the value of the duration is invalid. Check for this 
condition and throw the correct exception.

Modified:
    
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/jaxp/datatype/DurationImpl.java

Modified: 
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/jaxp/datatype/DurationImpl.java
URL: 
http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/jaxp/datatype/DurationImpl.java?rev=906804&r1=906803&r2=906804&view=diff
==============================================================================
--- 
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/jaxp/datatype/DurationImpl.java
 (original)
+++ 
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/jaxp/datatype/DurationImpl.java
 Fri Feb  5 04:06:33 2010
@@ -573,6 +573,9 @@
 
         int idx = tokens.length();
         for (int i = len - 1; i >= 0; i--) {
+            if (parts[i] == null) {
+                throw new IllegalArgumentException(whole);
+            }
             int nidx =
                 tokens.lastIndexOf(
                     parts[i].charAt(parts[i].length() - 1),



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to