tapestry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jkemn...@apache.org
Subject tapestry-5 git commit: TAP5-2449, TAP5-1493: add the interfaces to the queue in the correct order
Date Thu, 14 Jul 2016 07:11:36 GMT
Repository: tapestry-5
Updated Branches:
  refs/heads/master e048d9542 -> c2a4b9698


TAP5-2449, TAP5-1493: add the interfaces to the queue in the correct order


Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo
Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/c2a4b969
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/c2a4b969
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/c2a4b969

Branch: refs/heads/master
Commit: c2a4b9698993334368359bab2139f4a95a1e56d6
Parents: e048d95
Author: Jochen Kemnade <jkemnade@apache.org>
Authored: Thu Jul 14 09:10:18 2016 +0200
Committer: Jochen Kemnade <jkemnade@apache.org>
Committed: Thu Jul 14 09:10:18 2016 +0200

----------------------------------------------------------------------
 .../ioc/internal/services/PropertyAccessImpl.java  | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/c2a4b969/beanmodel/src/main/java/org/apache/tapestry5/ioc/internal/services/PropertyAccessImpl.java
----------------------------------------------------------------------
diff --git a/beanmodel/src/main/java/org/apache/tapestry5/ioc/internal/services/PropertyAccessImpl.java
b/beanmodel/src/main/java/org/apache/tapestry5/ioc/internal/services/PropertyAccessImpl.java
index 00d08e2..21fcfc3 100644
--- a/beanmodel/src/main/java/org/apache/tapestry5/ioc/internal/services/PropertyAccessImpl.java
+++ b/beanmodel/src/main/java/org/apache/tapestry5/ioc/internal/services/PropertyAccessImpl.java
@@ -116,14 +116,24 @@ public class PropertyAccessImpl implements PropertyAccess
         }
     }
 
-    private <T> void addAll(List<T> list, T[] array)
+    private static <T> void addAll(List<T> list, T[] array)
     {
         if (array.length > 0){
             list.addAll(Arrays.asList(array));
         }
     }
 
-    private void addPropertiesFromExtendedInterfaces(Class forClass, List<PropertyDescriptor>
descriptors)
+    private static <T> void addInterfacesRecursively(List<Class> list, Class<?>
clazz)
+    {
+        Class<?>[] interfaces = clazz.getInterfaces();
+        for (int i = 0; i < interfaces.length; i++) {
+          Class<?> iface = interfaces[i];
+          addInterfacesRecursively(list, iface);
+          list.add(iface);
+        }
+    }
+
+    private static void addPropertiesFromExtendedInterfaces(Class forClass, List<PropertyDescriptor>
descriptors)
             throws IntrospectionException
     {
 
@@ -133,7 +143,7 @@ public class PropertyAccessImpl implements PropertyAccess
         }
         LinkedList<Class> queue = CollectionFactory.newLinkedList();
         // Seed the queue
-        addAll(queue, interfaces);
+        addInterfacesRecursively(queue, forClass);
 
         while (!queue.isEmpty())
         {
@@ -144,7 +154,6 @@ public class PropertyAccessImpl implements PropertyAccess
             // Duplicates occur and are filtered out in ClassPropertyAdapter which stores
             // a property name to descriptor map.
             addAll(descriptors, info.getPropertyDescriptors());
-            addAll(queue, c.getInterfaces());
         }
     }
 


Mime
View raw message