rzo1 commented on code in PR #48:
URL: https://github.com/apache/geronimo-xbean/pull/48#discussion_r2655792564


##########
xbean-reflect/src/main/java/org/apache/xbean/recipe/ReflectionUtil.java:
##########
@@ -841,10 +869,10 @@ public static Method findInstanceFactory(Class typeClass, 
String factoryMethod,
         boolean allowPrivate = options.contains(Option.PRIVATE_FACTORY);
         boolean caseInsesnitive = 
options.contains(Option.CASE_INSENSITIVE_FACTORY);

Review Comment:
   `caseInsesnitive` typo was missed here.



##########
xbean-reflect/src/main/java/org/apache/xbean/recipe/ReflectionUtil.java:
##########
@@ -841,10 +869,10 @@ public static Method findInstanceFactory(Class typeClass, 
String factoryMethod,
         boolean allowPrivate = options.contains(Option.PRIVATE_FACTORY);
         boolean caseInsesnitive = 
options.contains(Option.CASE_INSENSITIVE_FACTORY);
 
-        List<Method> methods = new 
ArrayList<Method>(Arrays.asList(typeClass.getMethods()));
+        Set<Method> methods = new 
HashSet<Method>(Arrays.asList(typeClass.getMethods()));
         methods.addAll(Arrays.asList(typeClass.getDeclaredMethods()));
         for (Method method : methods) {
-            if (method.getName().equals(factoryMethod) || (caseInsesnitive && 
method.getName().equalsIgnoreCase(method.getName()))) {
+            if (method.getName().equals(factoryMethod) || (caseInsesnitive && 
method.getName().equalsIgnoreCase(factoryMethod))) {

Review Comment:
   Good catch! I think the same happens for `findStaticFactory(...)` too, so we 
want to fix it too.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to