SpringBeanLocator getBeanNameOfClass move if-test outside of while-loop
-----------------------------------------------------------------------

                 Key: WICKET-3245
                 URL: https://issues.apache.org/jira/browse/WICKET-3245
             Project: Wicket
          Issue Type: Improvement
          Components: wicket-spring
    Affects Versions: 1.5-M3
         Environment: All
            Reporter: Richard Emberson
            Priority: Trivial


Move the if-test outside of while-loop

    while (it.hasNext())
    {
      final String possibility = it.next();
      if (ctx instanceof AbstractApplicationContext)
      {
        BeanDefinition beanDef = 
getBeanDefinition(((AbstractApplicationContext)ctx)
            .getBeanFactory(), possibility);
        if (BeanFactoryUtils.isFactoryDereference(possibility) ||
            possibility.startsWith("scopedTarget.") || 
!beanDef.isAutowireCandidate())
        {   
          it.remove();
        }   
      }     
    }   

    if (ctx instanceof AbstractApplicationContext)
    {
      while (it.hasNext())
      {
        final String possibility = it.next();
        BeanDefinition beanDef = 
getBeanDefinition(((AbstractApplicationContext)ctx)
            .getBeanFactory(), possibility);
        if (BeanFactoryUtils.isFactoryDereference(possibility) ||
            possibility.startsWith("scopedTarget.") || 
!beanDef.isAutowireCandidate())
        {
          it.remove();
        }
      }
    }


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to