polygene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Merlin <p...@nosphere.org>
Subject Re: Bug in @This injections??
Date Wed, 18 Nov 2015 08:38:43 GMT
Niclas Hedhman a écrit :
> 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.
My "no luck" was in the middle between "it works as expected" and "I'm
not sure what Niclas said" :-)

Tried with your code and it fails with:

Caused by: java.lang.ArrayIndexOutOfBoundsException: 1
	at org.apache.zest.runtime.composite.ConstructorsModel.newConstructorModel(ConstructorsModel.java:130)

 

Kent Sølvsten a écrit :
> It looks like constructor injection *sometimes* works, depending on the
> details.
>
> I made a few experiments, and in some cases it "works" - but a package
> protected constructor or the mixin declared as a non-static inner class
> are at least 2 of the cases giving problems.
> There may be more.
>
> @Niclas: Can you push your concrete testcase to git (possibly ignored) -
> so we are sure we are not comparing apples n' oranges?

I do not have time to push this forward today but the code above exhibit
some issue. We need to wrap up the details and add coverage.

Jacoco reports could help here.
https://builds.apache.org/job/Zest(JavaEdition)-develop-java8-check/ws/build/reports/coverage/index.html

/Paul


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message