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

Flavia Rainone (JIRA) jira-events at lists.jboss.org
Mon Jul 28 15:52:52 EDT 2008


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