[jboss-jira] [JBoss JIRA] Commented: (JBAOP-618) AspectManager.getTempAdvisorIfNotExist causes infinite loop

Flavia Rainone (JIRA) jira-events at lists.jboss.org
Tue Jul 29 15:22:53 EDT 2008


    [ https://jira.jboss.org/jira/browse/JBAOP-618?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12422931#action_12422931 ] 

Flavia Rainone commented on JBAOP-618:
--------------------------------------

If you think so, I'll do the iteration.
Just an observation, as this method is frequently used by the graph, in the joinpoint graph branch I have created a cache for the results of this method, which improved the performance with the graph.

> AspectManager.getTempAdvisorIfNotExist causes infinite loop
> -----------------------------------------------------------
>
>                 Key: JBAOP-618
>                 URL: https://jira.jboss.org/jira/browse/JBAOP-618
>             Project: JBoss AOP
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>    Affects Versions: 2.0.0.CR15
>            Reporter: Flavia Rainone
>            Assignee: Flavia Rainone
>             Fix For: 2.0.0.GA
>
>
> This method contains a loop (lines 1207-1227)
>       while (superClass != null)
>        {
>                try
>                {
>                   Field field = superClass.getDeclaredField(Instrumentor.HELPER_FIELD_NAME);
>                   SecurityActions.setAccessible(field);
>                   advisor = (ClassAdvisor) field.get(null);
>                   if (advisor != null)
>                   {
>                      return advisor;
>                   }
>                   else
>                   {
>                      break;
>                   }
>                }
>                catch (NoSuchFieldException e)
>                {
>                   superClass = clazz.getSuperclass();
>                }
>             }
> With an infinite loop. Before entering this loop, superClazz value is assigned to be equal to clazz. If clazz is not advised, we get a NSFE, and go to clazz superclass. But, if this class is not advised, we will enter infinite loop, as we will check clazz's superclass again and again and again.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jboss-jira mailing list