spring-projects / spring-projects/spring-data-rest
Parameterized field (e.g. Optional<Long>) cause NullPointerException in UriToEntityConverter [DATAREST-764]
Open
@odrotbohm is already working on this.
Since Dec 31, 2020.
type: bug
- Dominant language
- Java
- Stars
- 958
- Forks
- 568
- PR merge metrics
- No merged PRs in 30d
Description
Vincent Jaouën opened DATAREST-764 and commented
Having a Parameterized field such as Optional<Long> in an entity cause a NullPointerException in UriToEntityConverter.
Steps to reproduce
- decompress the provided project [^test-optional.tar.gz]
- run
mvn spring-boot:run - watch the console for and watch for the
NullPointerException(see attached [^stacktrace.txt])
Here how the project was built
- start from the spring-data-mongo example provided here http://spring.io/guides/gs/accessing-data-mongodb/
- add an
Optional<String>field to the Customer class. - add the
spring-data-restdependency to the pom.xml
Regards,
Vincent
Affects: 2.4.2 (Gosling SR2)
Attachments:
- stacktrace.txt (45.86 kB)
- test-optional.tar.gz (1.84 kB)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.