]
Pete Muir updated JBSEAM-808:
-----------------------------
Fix Version/s: 2.1.0.BETA2
(was: 2.1.0.GA)
StatckOverflowError if factory specifies it's component
-------------------------------------------------------
Key: JBSEAM-808
URL:
https://jira.jboss.org/jira/browse/JBSEAM-808
Project: Seam
Issue Type: Bug
Components: Core
Environment: Latest from CVS
Reporter: John Ray
Fix For: 2.1.0.BETA2
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: