My testcase for QI-219 contains the following test entity;
interface InputEntity<T> extends EntityComposite
{
interface State
{
Property<Boolean> enabled();
Property<Integer> priority();
Property<Emitter> emitter();
}
}
but since State is not referenced anywhere, I get a funky exception
(fixing that), so I add a reference;
@Mixins( InputEntity.Dummy.class )
static interface InputEntity<T> extends EntityComposite
{
interface State
{
Property<Boolean> enabled();
Property<Integer> priority();
Property<Emitter> emitter();
}
public abstract class Dummy
implements InputEntity
{
@This private State state;
}
}
Strangely enough that is not enough. But if I add a dummy method,
@Mixins( InputEntity.Dummy.class )
static interface InputEntity<T> extends EntityComposite
{
void doStuff();
interface State
{
Property<Boolean> enabled();
Property<Integer> priority();
Property<Emitter> emitter();
}
public abstract class Dummy
implements InputEntity
{
@This private State state;
int count;
@Override public void doStuff()
{
if( state.enabled().get() )
{
count++;
}
}
}
}
The State mixin is correctly found. I assume that this is related to
some "method looping" when the Mixins are handled on start-up.
My question is; Is this a reasonable limitation, or should the @This
reference be found no matter what? (Needs to be documented as well)
Cheers
--
Niclas Hedhman, Software Developer
http://www.qi4j.org - New Energy for Java
I live here; http://tinyurl.com/2qq9er
I work here; http://tinyurl.com/2ymelc
I relax here; http://tinyurl.com/2cgsug
_______________________________________________
qi4j-dev mailing list
[email protected]
http://lists.ops4j.org/mailman/listinfo/qi4j-dev