spring-projects / spring-projects/spring-batch
Allow for null-safe nested paths in BeanWrapperFieldExtractor [BATCH-2531]
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 3k
- Forks
- 2.5k
- Avg merge
- 6d 53m
- Merged PRs (30d)
- 3
Description
Krishna Bhamidipati opened BATCH-2531 and commented
Hello!
Currently, nested paths are not null-safe in BeanWrapperFieldExtractor. For example if the property name is
a.b.c
where a is not null but b is null, it throws an exception like:
org.springframework.beans.NullValueInNestedPathException: Value of nested property 'a.b' is null
It would be nice to either:
- support a null-safe ?. operator like SpEL (http://docs.spring.io/spring/docs/current/spring-framework-reference/html/expressions.html#expressions-operator-safe-navigation)
- create a new property on BeanWrapperFieldExtractor that is able to set the BeanWrapper#setAutoGrowNestedPaths boolean property to true
Affects: 3.0.3
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.
Research direction
Start by inspecting BeanWrapperFieldExtractor and its nested-property handling in the Spring Batch source. Compare the proposed safe-navigation and auto-grow approaches, then verify the chosen behavior when an intermediate property such as a.b is null. Done means null-safe nested extraction is defined and covered by regression tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100