-
Notifications
You must be signed in to change notification settings - Fork 115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clarification of config.getValue() for an Optional #675
Comments
Good observation! This was an oversight when adding OptionalInt, OptionalDouble, OptionalLong. Effectively, when the type is Optionalxxx, the getValue will return an Optionalxxx. If we throw |
A related case that we may also want to clarify is when you call |
Description
Should
config.getValue("int.missing.key", OptionalInt.class)
throw aNoSuchElementException
according to this bit of spec? (whereint.missing.key
is not defined in a config source)microprofile-config/api/src/main/java/org/eclipse/microprofile/config/Config.java
Lines 130 to 131 in 03c6f05
If yes, It seems like this could be a relatively common mistake, which suggests to me it may be worth having a TCK for (If there isn't one already- I couldn't find one)
The text was updated successfully, but these errors were encountered: