Hi Arvis,

Arvid Huss a écrit :
Hi folks,

recently I discovered in Qi4j 1.3.x that the "first" initialisation of
service configurations that extend the Enabled interface produces rather
random results.
The expectation would have been that the enabled() Boolean would be
initialised according to the @UseDefaults annotation att the method
declaration or
by a later use of module.forMixin( Enabled.class
).declareDefaults().enabled.set( Boolean.TRUE ) in an Assembly. In fact the
first initialisation of such a configuration
can have unpredictable results when run multiple times.
Are you able to reproduce this in a small testcase?


My guess ist that the entity finder gets hold of another instance of
Enabled interface than the one extended by the service configuration, hence
the possibility to
get the initial value for a completely different service configuration
instead.
Asking for an injection like this ;

    @This Configuration<Enabled> config;

will trigger an Entity lookup using the enclosing service's identity.
I cannot see how it could get the wrong configuration entity.


I'm aware of that we will probable not cut a new 1.3.x release of Qi4j and
that is not really necessary either since there exists a workaround to
force the Enabled interface to be initialised with
an accurate value the first time. The use of a properties file for the
initialisation. As a fact I'm using all 3 configuration possibilities
together right now and that works fine for the time being.

But the same behavior could show up during resolution of other ambiguos
types  together with entity lookups.

Anyone else ran into similar issues?

brg
  Arvid
/Paul

_______________________________________________
qi4j-dev mailing list
[email protected]
http://lists.ops4j.org/mailman/listinfo/qi4j-dev

Reply via email to