-
Bug
-
Resolution: Done
-
Major
-
None
-
None
Assume we define a following injection points:
@Inject @ConfigProperty(name = "myPets", defaultValue = "horse,monkey") private String[] myArrayPets; @Inject @ConfigProperty(name = "myPets", defaultValue = "cat,lama") private List<String> myListPets; @Inject @ConfigProperty(name = "myPets", defaultValue = "dog,mouse") private Set<String> mySetPets;
Passing a -DmyPets=snake,ox property work as expected:
myArrayPets : [snake,ox] myListPets : [snake,ox] mySetPets : [snake,ox]
but trying to use the defults I get:
myArrayPets : [horse,monkey] myListPets : <empty list> mySetPets : <empty set>
defaults are not applied to List and Set fields, no exception is thrown.
Another inconsistency between Array and Set+List I run into is behaviour on missing property (myPets is not set):
Array
@Inject @ConfigProperty(name = "myPets") private String[] myArrayPets; >>> 08:34:05,178 ERROR [stderr] (MSC service thread 1-2) org.jboss.weld.exceptions.DeploymentException: Error while validating Configuration 08:34:05,178 ERROR [stderr] (MSC service thread 1-2) No Config Value exists for myPets myArrayPets : [org.eclipse.microprofile.config.configproperty.unconfigureddvalue]
Set, List
@Inject @ConfigProperty(name = "myPets") private List<String> myListPets; @Inject @ConfigProperty(name = "myPets") private Set<String> mySetPets; >>> no errors myListPets : <empty list> mySetPets : <empty set>
- blocks
-
CLOUD-2729 Support Eclipse MicroProfile Config
- Verified