@Cached#postCondition条件报错
- Dominant language
- Java
- Stars
- 5.6k
- Forks
- 1.1k
- PR merge metrics
- No merged PRs in 30d
Description
`
@Cached(name = "jetCache:getListById:", key = "#id", expire = 60,
postCondition = "#result != null && #result.size() != 0")
public List getListById(Integer id) {
if (Objects.isNull(id)) {
return Collections.emptyList();
}
return iXXInterface.getXXListById(id);
}
`
当返回 Collections.emptyList()时,报错 EmptyList不能转成 ArrayList
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the @Cached annotation's postCondition handling and reproduce the issue using getListById(Integer id), especially when it returns Collections.emptyList(). Done means the postCondition no longer causes an EmptyList-to-ArrayList conversion error for this return value.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100