You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by mu...@apache.org on 2010/05/16 11:45:20 UTC

svn commit: r944783 - /xerces/java/trunk/src/org/apache/xerces/jaxp/datatype/DurationImpl.java

Author: mukulg
Date: Sun May 16 09:45:19 2010
New Revision: 944783

URL: http://svn.apache.org/viewvc?rev=944783&view=rev
Log:
null check of, variable 'lexicalRepresentation' looks like at a wrong place (this could lead to a null pointer dereference at, s.length()). this commit solves this issue.

Modified:
    xerces/java/trunk/src/org/apache/xerces/jaxp/datatype/DurationImpl.java

Modified: xerces/java/trunk/src/org/apache/xerces/jaxp/datatype/DurationImpl.java
URL: http://svn.apache.org/viewvc/xerces/java/trunk/src/org/apache/xerces/jaxp/datatype/DurationImpl.java?rev=944783&r1=944782&r2=944783&view=diff
==============================================================================
--- xerces/java/trunk/src/org/apache/xerces/jaxp/datatype/DurationImpl.java (original)
+++ xerces/java/trunk/src/org/apache/xerces/jaxp/datatype/DurationImpl.java Sun May 16 09:45:19 2010
@@ -421,16 +421,16 @@ class DurationImpl
         throws IllegalArgumentException {
         // only if I could use the JDK1.4 regular expression ....
 
+        if (lexicalRepresentation == null) {
+           throw new NullPointerException();
+        }
+        
         final String s = lexicalRepresentation;
         boolean positive;
         int[] idx = new int[1];
         int length = s.length();
         boolean timeRequired = false;
 
-        if (lexicalRepresentation == null) {
-            throw new NullPointerException();
-        }
-
         idx[0] = 0;
         if (length != idx[0] && s.charAt(idx[0]) == '-') {
             idx[0]++;



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xerces.apache.org
For additional commands, e-mail: commits-help@xerces.apache.org