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
Null case of @Default not covered #1858
Comments
Doh! Are you interested in sending a pull request, or shall I send one based on your suggestion? |
Seems that to write correct test cases, I need to take time to have comprehensive understanding of test structures. So I appreciate if you can take it instead 🙇 |
Sure. No problem! |
trustin
added a commit
to trustin/armeria
that referenced
this issue
Jun 28, 2019
Motivation: A `NoSuchElementException` is raised during server startup time if a user specified a `@Default` annotation without a value: public class MyAnnotatedService { @get("/foo") public String foo(@param @default String value) { return String.valueOf(value); } } Modifications: - Allow having no value in `@Default` annotation Result: - Fixes line#1858
Will be fixed via #1864 |
trustin
added a commit
that referenced
this issue
Jun 28, 2019
Motivation: A `NoSuchElementException` is raised during server startup time if a user specified a `@Default` annotation without a value: public class MyAnnotatedService { @get("/foo") public String foo(@param @default String value) { return String.valueOf(value); } } Modifications: - Allow having no value in `@Default` annotation Result: - Fixes #1858
fmguerreiro
pushed a commit
to fmguerreiro/armeria
that referenced
this issue
Sep 19, 2020
…e#1864) Motivation: A `NoSuchElementException` is raised during server startup time if a user specified a `@Default` annotation without a value: public class MyAnnotatedService { @get("/foo") public String foo(@param @default String value) { return String.valueOf(value); } } Modifications: - Allow having no value in `@Default` annotation Result: - Fixes line#1858
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
armeria/core/src/main/java/com/linecorp/armeria/internal/annotation/AnnotatedValueResolver.java
Line 1026 in 61a72e9
When intent to use
null
for default value like@Param("foo") @Default FooType foo
,AnnotatedValueResolver
doesn't check ifOptional.isPresent
but directly get underlying value, which will be ended up withNo value present
.Expected is following:
The text was updated successfully, but these errors were encountered: