aloyszhang commented on code in PR #9978:
URL: https://github.com/apache/inlong/pull/9978#discussion_r1560649047
##########
inlong-audit/audit-service/src/main/java/org/apache/inlong/audit/cache/AbstractCache.java:
##########
@@ -82,7 +83,11 @@ public Cache<String, StatData> getCache() {
* @return
*/
public List<StatData> getData(String key) {
- return Arrays.asList(cache.getIfPresent(key));
+ StatData statData = cache.getIfPresent(key);
+ if (null == statData) {
+ return new LinkedList<>();
+ }
+ return Arrays.asList(statData);
Review Comment:
```suggestion
return Collections.singletonList(statData);
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]