Re: @jakarta.inject.Inject + not required

2021-06-02 Thread Emond Papegaaij
CDI uses javax.enterprise.inject.Instance to inject optional beans. I don't particular like this solution, but it works. The downside is that it depends on the CDI API. Best regards, Emond On Wed, Jun 2, 2021 at 10:41 AM Martin Grigorov wrote: > > On Wed, Jun 2, 2021 at 11:31 AM Sven Meier

Re: @jakarta.inject.Inject + not required

2021-06-02 Thread Martin Grigorov
On Wed, Jun 2, 2021 at 11:31 AM Sven Meier wrote: > Hi, > > I wasn't aware that Optional actually isn't serializable: > The real problem is that it is `final class`. Even if it was Serializable we would still wrap it in a proxy that looks up the real bean on demand / after deserialization. We

Re: @jakarta.inject.Inject + not required

2021-06-02 Thread Sven Meier
Hi, I wasn't aware that Optional actually isn't serializable: https://stackoverflow.com/questions/24547673/why-java-util-optional-is-not-serializable-how-to-serialize-the-object-with-suc#24564612 "The JSR-335 EG felt fairly strongly that Optional should not be on any more than needed to