You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by "Will Scheidegger (JIRA)" <ji...@apache.org> on 2011/08/22 12:41:29 UTC

[jira] [Created] (OCM-45) ReflectionUtils.implementsInterface() only checks one interface and returns

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


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.

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

        

[jira] [Updated] (OCM-45) ReflectionUtils.implementsInterface() only checks one interface and returns

Posted by "Will Scheidegger (JIRA)" <ji...@apache.org>.
     [ 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

        

[jira] [Resolved] (OCM-45) ReflectionUtils.implementsInterface() only checks one interface and returns

Posted by "Alex Parvulescu (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OCM-45?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alex Parvulescu resolved OCM-45.
--------------------------------

       Resolution: Fixed
    Fix Version/s: 1.6.0
         Assignee: Alex Parvulescu

Thanks Will!

I've also added a tiny test based on the emails from the mailing list :)

Fixed in revision #1160997

> 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
>            Assignee: Alex Parvulescu
>              Labels: patch, reflection
>             Fix For: 1.6.0
>
>         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.

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

        

[jira] [Updated] (OCM-45) ReflectionUtils.implementsInterface() only checks one interface and returns

Posted by "Will Scheidegger (JIRA)" <ji...@apache.org>.
     [ 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:


# 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


  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.


> 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
>   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:
> # 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

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

        

[jira] [Updated] (OCM-45) ReflectionUtils.implementsInterface() only checks one interface and returns

Posted by "Will Scheidegger (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OCM-45?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

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

    Attachment: ReflectionUtils.patch

> 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

        

[jira] [Updated] (OCM-45) ReflectionUtils.implementsInterface() only checks one interface and returns

Posted by "Will Scheidegger (JIRA)" <ji...@apache.org>.
     [ 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.  (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:


{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})

> 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.

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