[ 
https://issues.apache.org/jira/browse/OCM-45?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Will Scheidegger updated OCM-45:
--------------------------------

    Description: 
When checking the interface of the provided class the method always returns 
after checking the first interface. The loop which should run over all 
interfaces has an fixed "return" statement. The attached patch has fixed the 
problem for me.

Hm... can't see how to attach the patch file, so here goes copy&paste:


{noformat}
# This patch file was generated by NetBeans IDE
# It uses platform neutral UTF-8 encoding and \n newlines.
--- Base (BASE)
+++ Locally Modified (Based On LOCAL)
@@ -219,10 +219,9 @@
                if (clazz.getInterfaces() != null  )
                {
                   for ( Class foundInterface : clazz.getInterfaces() ) {
-                          if ( foundInterface == interfaceClass ) {
+                          if ( foundInterface == interfaceClass || 
implementsInterface(foundInterface, interfaceClass)) {
                                  return true;
                           }
-                          return implementsInterface(foundInterface, 
interfaceClass) ;
                   }
                }
                // Try to find from the ancestors
{noformat}

  was:
When checking the interface of the provided class the method always returns 
after checking the first interface. The loop which should run over all 
interfaces has an fixed "return" statement. The attached patch has fixed the 
problem for me.

Hm... can't see how to attach the patch file, so here goes copy&paste:


# This patch file was generated by NetBeans IDE
# It uses platform neutral UTF-8 encoding and \n newlines.
--- Base (BASE)
+++ Locally Modified (Based On LOCAL)
@@ -219,10 +219,9 @@
                if (clazz.getInterfaces() != null  )
                {
                   for ( Class foundInterface : clazz.getInterfaces() ) {
-                          if ( foundInterface == interfaceClass ) {
+                          if ( foundInterface == interfaceClass || 
implementsInterface(foundInterface, interfaceClass)) {
                                  return true;
                           }
-                          return implementsInterface(foundInterface, 
interfaceClass) ;
                   }
                }
                // Try to find from the ancestors



> ReflectionUtils.implementsInterface() only checks one interface and returns
> ---------------------------------------------------------------------------
>
>                 Key: OCM-45
>                 URL: https://issues.apache.org/jira/browse/OCM-45
>             Project: Jackrabbit OCM
>          Issue Type: Bug
>    Affects Versions: 1.6.0
>            Reporter: Will Scheidegger
>              Labels: patch, reflection
>         Attachments: ReflectionUtils.patch
>
>   Original Estimate: 0.5h
>  Remaining Estimate: 0.5h
>
> When checking the interface of the provided class the method always returns 
> after checking the first interface. The loop which should run over all 
> interfaces has an fixed "return" statement. The attached patch has fixed the 
> problem for me.
> Hm... can't see how to attach the patch file, so here goes copy&paste:
> {noformat}
> # This patch file was generated by NetBeans IDE
> # It uses platform neutral UTF-8 encoding and \n newlines.
> --- Base (BASE)
> +++ Locally Modified (Based On LOCAL)
> @@ -219,10 +219,9 @@
>               if (clazz.getInterfaces() != null  )
>               {
>                  for ( Class foundInterface : clazz.getInterfaces() ) {
> -                        if ( foundInterface == interfaceClass ) {
> +                        if ( foundInterface == interfaceClass || 
> implementsInterface(foundInterface, interfaceClass)) {
>                                 return true;
>                          }
> -                        return implementsInterface(foundInterface, 
> interfaceClass) ;
>                  }
>               }
>               // Try to find from the ancestors
> {noformat}

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to