We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
场景描述: 使用magic模式进行返回列表分割缓存存储,当返回值中含有NULL时,引发NPE 使用代码: @LocalCache(expire = 500) @Cache(expire = 600, expireExpression = "null == #retVal ? 30: 600", key = "", magic = @Magic(key = "'user-magic-'+ #retVal.userId"), autoload = true) @Override public List<UserInfo> loadAllUsers() { return LongStream.rangeClosed(1, 105).mapToObj(this::createUser).collect(Collectors.toList()); } 发生错误源代码: AbstractScriptParser#getDefinedCacheKey SpringELParser#getElValue 原因:未对返回值做null判断,返回值列表中有有NULL,出现错误
@LocalCache(expire = 500) @Cache(expire = 600, expireExpression = "null == #retVal ? 30: 600", key = "", magic = @Magic(key = "'user-magic-'+ #retVal.userId"), autoload = true) @Override public List<UserInfo> loadAllUsers() { return LongStream.rangeClosed(1, 105).mapToObj(this::createUser).collect(Collectors.toList()); }
The text was updated successfully, but these errors were encountered:
欢迎提PR。
Sorry, something went wrong.
No branches or pull requests
场景描述: 使用magic模式进行返回列表分割缓存存储,当返回值中含有NULL时,引发NPE
使用代码:
@LocalCache(expire = 500) @Cache(expire = 600, expireExpression = "null == #retVal ? 30: 600", key = "", magic = @Magic(key = "'user-magic-'+ #retVal.userId"), autoload = true) @Override public List<UserInfo> loadAllUsers() { return LongStream.rangeClosed(1, 105).mapToObj(this::createUser).collect(Collectors.toList()); }
发生错误源代码:
AbstractScriptParser#getDefinedCacheKey
SpringELParser#getElValue
原因:未对返回值做null判断,返回值列表中有有NULL,出现错误
The text was updated successfully, but these errors were encountered: