butek 02/04/08 08:43:14
Modified: java/src/org/apache/axis/encoding
SerializationContextImpl.java
java/src/org/apache/axis/encoding/ser
SimpleDeserializer.java
Log:
Slight performance improvement suggested by Richard Emberson
([EMAIL PROTECTED]).
Since String (and Boolean and byte[]) are final classes, we don't have to
check "String.class.isAssignableFrom(c)". "c == String.class" is sufficient.
Revision Changes Path
1.19 +2 -2
xml-axis/java/src/org/apache/axis/encoding/SerializationContextImpl.java
Index: SerializationContextImpl.java
===================================================================
RCS file:
/home/cvs/xml-axis/java/src/org/apache/axis/encoding/SerializationContextImpl.java,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- SerializationContextImpl.java 5 Apr 2002 21:24:33 -0000 1.18
+++ SerializationContextImpl.java 8 Apr 2002 15:43:14 -0000 1.19
@@ -433,12 +433,12 @@
if (javaType.isPrimitive()) return true;
- if (String.class.isAssignableFrom(javaType)) return true;
+ if (javaType == String.class) return true;
if (Calendar.class.isAssignableFrom(javaType)) return true;
if (Date.class.isAssignableFrom(javaType)) return true;
if (Hex.class.isAssignableFrom(javaType)) return true;
if (Element.class.isAssignableFrom(javaType)) return true;
- if (byte[].class.isAssignableFrom(javaType)) return true;
+ if (javaType == byte[].class) return true;
// There has been discussion as to whether arrays themselves should
// be regarded as multi-ref.
1.9 +1 -2
xml-axis/java/src/org/apache/axis/encoding/ser/SimpleDeserializer.java
Index: SimpleDeserializer.java
===================================================================
RCS file:
/home/cvs/xml-axis/java/src/org/apache/axis/encoding/ser/SimpleDeserializer.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- SimpleDeserializer.java 28 Mar 2002 18:41:16 -0000 1.8
+++ SimpleDeserializer.java 8 Apr 2002 15:43:14 -0000 1.9
@@ -213,8 +213,7 @@
public Object makeValue(String source) throws Exception
{
// If the javaType is a boolean, except a number of different sources
- if (javaType == boolean.class ||
- Boolean.class.isAssignableFrom(javaType)) {
+ if (javaType == boolean.class || javaType == Boolean.class) {
// This is a pretty lame test, but it is what the previous code did.
switch (source.charAt(0)) {
case '0': case 'f': case 'F':