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: [email protected]
For additional commands, e-mail: [email protected]