I don't know what you mean by "no luck". Is it, "it works as expected" or
"it doesn't work as Niclas claims" ?
@Mixins(AbcMixin.class)
public interface Abc extends TransientComposite {
}
public interface Def
{
Property<String> def();
}
public class AbcMixin
implements Abc
{
public AbcMixin( @This Def privateMixin ) // a Def instance is not
given
{
}
}
but if I add Def to the Abc,
public interface Abc extends Def, TransientComposite{}
then there is a value in the constructor.
If you had problem understanding what *I* meant, then I hope this is
clearer.
Cheers
Niclas
On Mon, Nov 16, 2015 at 11:24 PM, Paul Merlin <[email protected]> wrote:
> Hey,
>
> Catching up ...
>
> Niclas Hedhman a écrit :
> > I think that "Private @This" doesn't work for Constructor injections at
> the
> > moment.
> >
> > Not sure if that is because it can't be done, or because the
> implementation
> > is lacking the feature.
> >
> > Looking at the ThisInjectionProviderFactory, I can't figure out how this
> is
> > supposed to work at all. And if anyone has interest, please enlighten me
> of
> > what we ned to do to support this properly. The previous
> decorator-feature
> > I mention, depends on this :-(
>
> Niclas Hedhman a écrit :
> > So, for @This injection in fields, the type is somehow added to the
> > Composite, but when it is injected in the Constructor, it seems to only
> > take the public Composite type interfaces...
>
> I tried to understand/reproduce the issue but couldn't.
> Also added some tests in ConstructorInjectionOfThisTest and
> PrivateMixinTest by the way, with no luck. The latter existing test was
> wrong as under-test Work fragment was declared as a *public* mixin.
>
> /Paul
>
>
--
Niclas Hedhman, Software Developer
http://zest.apache.org - New Energy for Java