Re: [PR] [XBEAN-453] try to explicit the parameter types matched instead of us… [geronimo-xbean]

rzo1 (via GitHub) <[email protected]>
Newsgroups gmane.comp.java.geronimo.devel
Message-ID <PR_kwDOAAOrUs67HAJJ-2be7faef-b9c6-4f38-a50f-d117dfceca5b@gitbox.apache.org>
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: dev-unsubscribe-nmThH5wfGryY1pf4d8vP8EB+6BGkLq7r@public.gmane.org

For queries about this service, please contact Infrastructure at:
users-pF6z+fRhj9EyzMRdD/[email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.