Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
Description
The current approach to support optional injections requires to annotate the field with @Optional plus proper handling within the javacode (null checks etc), which can be forgotten.
So instead of
@Inject @Optional
String fieldname;
it should also be possible to use this
@Inject
Optional<String> fieldname;
with the very same semantic. But the developer is forced to deal with the case that the value is not present.