spring-projects / spring-projects/spring-data-rest

Parameterized field (e.g. Optional<Long>) cause NullPointerException in UriToEntityConverter [DATAREST-764]

Open
#1,138 0 comments 0 reactions 1 assignee View on GitHub

@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
  1. decompress the provided project [^test-optional.tar.gz]
  2. run mvn spring-boot:run
  3. watch the console for and watch for the NullPointerException (see attached [^stacktrace.txt])
Here how the project was built
  1. start from the spring-data-mongo example provided here http://spring.io/guides/gs/accessing-data-mongodb/
  2. add an Optional<String> field to the Customer class.
  3. add the spring-data-rest dependency to the pom.xml

Regards,

Vincent


Affects: 2.4.2 (Gosling SR2)

Attachments:

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.