You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by di...@apache.org on 2005/07/21 05:25:23 UTC
cvs commit: ws-axis/java/src/org/apache/axis/encoding/ser DateDeserializer.java
dims 2005/07/20 20:25:23
Modified: java/src/org/apache/axis/encoding/ser DateDeserializer.java
Log:
Better NumberFormatException if the size is less than expected. (prevents a mis-leading java.lang.StringIndexOutOfBoundsException as mentioned in AXIS-2078)
Revision Changes Path
1.16 +6 -6 ws-axis/java/src/org/apache/axis/encoding/ser/DateDeserializer.java
Index: DateDeserializer.java
===================================================================
RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/encoding/ser/DateDeserializer.java,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- DateDeserializer.java 13 Jun 2005 13:42:22 -0000 1.15
+++ DateDeserializer.java 21 Jul 2005 03:25:23 -0000 1.16
@@ -56,18 +56,18 @@
// validate fixed portion of format
if ( source != null ) {
+ if (source.length() < 10)
+ throw new NumberFormatException(
+ Messages.getMessage("badDate00"));
+
if (source.charAt(0) == '+')
source = source.substring(1);
-
+
if (source.charAt(0) == '-') {
source = source.substring(1);
bc = true;
}
-
- if (source.length() < 10)
- throw new NumberFormatException(
- Messages.getMessage("badDate00"));
-
+
if (source.charAt(4) != '-' || source.charAt(7) != '-')
throw new NumberFormatException(
Messages.getMessage("badDate00"));