Hi,
When one of the attribute values is an empty string, (attr="") the following
exception occurs:
java.lang.ArrayIndexOutOfBoundsException at
org.exolab.castor.types.Date.parseDateInternal(Date.java:304) at
org.exolab.castor.types.Date.parseDate(Date.java:291) at
org.exolab.castor.xml.schema.util.DatatypeHandler.guessType(DatatypeHandler.
java:177) at
org.exolab.castor.xml.schema.util.XMLInstance2SchemaHandler.startElement(XML
Instance2SchemaHandler.java:419)
To solve this, a small change needs to be made to the guessType method in
the DataTypeHandler class, since we can't guess the type for an empty string
anyway, the type returned should probably default to STRING_TYPE???
Attached is the change.
Edwin
--- DataTypeHandler.java.old Wed Mar 12 09:36:44 2003
+++ DataTypeHandler.java Wed Mar 12 09:35:56 2003
@@ -138,6 +138,7 @@
**/
public static String guessType(String value) {
if (value == null) return null;
+ if ( value.length() == 0) return STRING_TYPE;
//-- check for integer, must be done before check for long
try {