You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by bu...@apache.org on 2003/09/22 12:50:16 UTC

DO NOT REPLY [Bug 23324] New: - Wrong use of Class.isAssignableFrom in XMLIntrospectorHelper.isPrimitiveType

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=23324>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=23324

Wrong use of Class.isAssignableFrom in XMLIntrospectorHelper.isPrimitiveType

           Summary: Wrong use of Class.isAssignableFrom in
                    XMLIntrospectorHelper.isPrimitiveType
           Product: Commons
           Version: 1.0 Alpha
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Betwixt
        AssignedTo: commons-dev@jakarta.apache.org
        ReportedBy: lari.hotari@sagire.fi


There is a bug in XMLIntropectorHelper.isPrimitiveType method. It does not
return the correct value for example when you have a custom class which extends
java.util.Date.

Here is a patch to fix the incorrect usage of Class.isAssignableFrom in
XMLIntropectorHelper.java (isPrimitiveType method):

--- XMLIntrospectorHelper.java.orig	2003-08-21 15:58:11.000000000 +0300
+++ XMLIntrospectorHelper.java	2003-08-21 15:59:33.000000000 +0300
@@ -461,14 +461,14 @@
             return false;
         }
         return type.getName().startsWith( "java.lang." )
-            || type.isAssignableFrom( Number.class ) 
-            || type.isAssignableFrom( String.class ) 
-            || type.isAssignableFrom( Date.class ) 
-            || type.isAssignableFrom( java.sql.Date.class ) 
-            || type.isAssignableFrom( java.sql.Time.class ) 
-            || type.isAssignableFrom( java.sql.Timestamp.class ) 
-            || type.isAssignableFrom( java.math.BigDecimal.class ) 
-            || type.isAssignableFrom( java.math.BigInteger.class );
+            || Number.class.isAssignableFrom( type ) 
+            || String.class.isAssignableFrom( type ) 
+            || Date.class.isAssignableFrom( type ) 
+            || java.sql.Date.class.isAssignableFrom( type ) 
+            || java.sql.Time.class.isAssignableFrom( type ) 
+            || java.sql.Timestamp.class.isAssignableFrom( type ) 
+            || java.math.BigDecimal.class.isAssignableFrom( type ) 
+            || java.math.BigInteger.class.isAssignableFrom( type );
     }
     
     // Implementation methods

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org