[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-808) StatckOverflowError if factory specifies it's component

John Ray (JIRA) jira-events at lists.jboss.org
Fri Feb 9 23:57:31 EST 2007


StatckOverflowError if factory specifies it's component
-------------------------------------------------------

                 Key: JBSEAM-808
                 URL: http://jira.jboss.com/jira/browse/JBSEAM-808
             Project: JBoss Seam
          Issue Type: Bug
         Environment: Latest from CVS
            Reporter: John Ray


I accidently specified the name of my component instead of a context variable and this resulted in a StatckOverflowError. For example

@Stateful
@Name("foo")
@Scope(ScopeType.EVENT)
public class FooAction implements Foo {

    @Out("bar")
    private String bar;

    @Factory("foo")
    public void initBar() {
        ...
    } 
}

I'd sugest changing the code in org.jboss.seam.Component at line 490 to include an if/throw. I highlighted the 2 new lines with an asterisk

            if ( method.isAnnotationPresent(org.jboss.seam.annotations.Factory.class) )
            {
               Init init = (Init) applicationContext.get( Seam.getComponentName(Init.class) ); //can't use Init.instance() here 'cos of unit tests
               String contextVariable = toName( method.getAnnotation(org.jboss.seam.annotations.Factory.class).value(), method );
*               if (contextVariable.equals(name))
*                   throw new IllegalStateException("@Factory method can not be for it's own component: " + name);
               init.addFactoryMethod(contextVariable, method, this);
            }




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

        



More information about the seam-issues mailing list