Description:
|
It seems the CDI spec is not completely clear in this area: {quote} The get() method may not create a new instance of the given contextual type unless a CreationalContext is given. {quote} But it doesn't specify which of the two methods. The javadoc on the other hand states the {{javax.enterprise.context.spi.Context.get(Contextual<T>, CreationalContext<T>)}} method returns "the contextual instance".
So the problem is a context might try to create a new bean instance even if no
CreationalContext is given.
Nevertheless I think it would be definitely better to call {{javax.enterprise.context.spi.Context.get(Contextual<T>)}} to avoid confusion.
|