Title: [2087] trunk/xstream/src/java/com/thoughtworks/xstream/core/util/DependencyInjectionFactory.java: Simplify argument match ranking
Revision
2087
Author
joehni
Date
2013-07-03 16:16:38 -0500 (Wed, 03 Jul 2013)

Log Message

Simplify argument match ranking

Modified Paths


Diff

Modified: trunk/xstream/src/java/com/thoughtworks/xstream/core/util/DependencyInjectionFactory.java (2086 => 2087)


--- trunk/xstream/src/java/com/thoughtworks/xstream/core/util/DependencyInjectionFactory.java	2013-07-03 21:02:56 UTC (rev 2086)
+++ trunk/xstream/src/java/com/thoughtworks/xstream/core/util/DependencyInjectionFactory.java	2013-07-03 21:16:38 UTC (rev 2087)
@@ -180,21 +180,9 @@
                     }
                     
                     if (possible) {
-                        if (possibleCtor != null) {
-                            int j = 0;
-                            for(; j < parameterTypes.length; ++j) {
-                                boolean a = (possibleUsedDeps & (1L << j)) > 0;
-                                boolean b = (usedDeps & (1L << j)) > 0;
-                                if ((a && !b) ||(b && !a)) {
-                                    if (b) {
-                                        j = parameterTypes.length; 
-                                    }
-                                    break;
-                                }
-                            }
-                            if (j < parameterTypes.length) {
-                                continue;
-                            }
+                        // the smaller the value, the smaller the indices in the deps array
+                        if (possibleCtor != null && usedDeps >= possibleUsedDeps) {
+                            continue;
                         }
                         possibleCtor = constructor;
                         possibleMatchingDependencies = (List)matchingDependencies.clone();

To unsubscribe from this list please visit:

http://xircles.codehaus.org/manage_email

Reply via email to