commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nia...@apache.org
Subject svn commit: r1037577 - /commons/proper/beanutils/trunk/src/main/java/org/apache/commons/beanutils/MethodUtils.java
Date Sun, 21 Nov 2010 23:48:12 GMT
Author: niallp
Date: Sun Nov 21 23:48:12 2010
New Revision: 1037577

URL: http://svn.apache.org/viewvc?rev=1037577&view=rev
Log:
BEANUTILS-381 Fix test case broken by changes

Modified:
    commons/proper/beanutils/trunk/src/main/java/org/apache/commons/beanutils/MethodUtils.java

Modified: commons/proper/beanutils/trunk/src/main/java/org/apache/commons/beanutils/MethodUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/beanutils/trunk/src/main/java/org/apache/commons/beanutils/MethodUtils.java?rev=1037577&r1=1037576&r2=1037577&view=diff
==============================================================================
--- commons/proper/beanutils/trunk/src/main/java/org/apache/commons/beanutils/MethodUtils.java
(original)
+++ commons/proper/beanutils/trunk/src/main/java/org/apache/commons/beanutils/MethodUtils.java
Sun Nov 21 23:48:12 2010
@@ -1119,6 +1119,13 @@ public class MethodUtils {
     private static float getObjectTransformationCost(Class srcClass, Class destClass) {
         float cost = 0.0f;
         while (srcClass != null && !destClass.equals(srcClass)) {
+            if (destClass.isPrimitive()) {
+                Class destClassWrapperClazz = getPrimitiveWrapper(destClass);
+                if (destClassWrapperClazz != null && destClassWrapperClazz.equals(srcClass))
{
+                    cost += 0.25f;
+                    break;
+                }
+            }
             if (destClass.isInterface() && isAssignmentCompatible(destClass,srcClass))
{
                 // slight penalty for interface match. 
                 // we still want an exact match to override an interface match, but  



Mime
View raw message