axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steve Green <ste...@epok.net>
Subject Deserializing Booleans (and maybe other primitives)
Date Wed, 05 Jan 2005 16:30:08 GMT
Developers,

I did a CVS up yesterday.  It seems that some recent refactoring may 
have broken the way Booleans are deserialized.  This is what I am 
seeing.

I have a SOAP header coming in with mustUnderstand="1".  That "1" is 
finding it's way to new Boolean("1"), which gets evaluated as false.

SimpleDeserializer has makeBasicValue() which looks for "1" (as well as 
"t" and "T"), but makeBasicValue() is never called because 
SimpleDeserializerFactory doesn't consider Boolean as a basic type.

     private static boolean isBasic(Class javaType) {
         return (javaType.isPrimitive() ||
                 javaType == java.lang.String.class ||
                 javaType == org.apache.axis.types.URI.class);
     }

One possible fix would be to reflect the java class, looking for the 
TYPE field, or to simply test for java.lang.Boolean.class, but 
admittedly I don't know this code well enough to propose anything.

makeBasicValue() also has special case code for a bunch of the other 
primitives too.  I am suspecting isBasic() needs to deal with them too, 
or perhaps makeBasicValue() doesn't need those cases anymore.

If someone can chime in on the best way to fix the problem, I'll create 
a report and attach a fix.

~S


Mime
View raw message