fix: 优化contains_all方法中,参数为空时的判断 #29
Merged
zhou-hao merged 6 commits intojetlinks:masterfrom Oct 23, 2025
Merged
Conversation
# Conflicts: # src/main/java/org/jetlinks/reactor/ql/supports/DefaultReactorQLMetadata.java
contains_all参数为null时,应该返回false
Contributor
Author
|
@zhou-hao 大佬帮忙看看 |
zhou-hao
reviewed
Oct 22, 2025
| TreeSet<Object> set = | ||
| CastUtils.castCollection(first, new TreeSet<>(CompareUtils::compare)); | ||
|
|
||
| Flux<?> cache = flux.skip(1).cache(); |
Member
There was a problem hiding this comment.
可以不用cache判断吧?
flux.map(val-> handleContain() )
.defaultIfEmpty()
.all 这样?
Contributor
Author
There was a problem hiding this comment.
不行。flatStream方法会把空数组转换为empty的Flux。无法区分空数组的情况
Contributor
Author
There was a problem hiding this comment.
可以了,改为了用两次defaultIfEmpty判断。按contains_all的语义,空数组应该返回true。
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #29 +/- ##
============================================
+ Coverage 86.94% 87.00% +0.06%
- Complexity 959 962 +3
============================================
Files 63 63
Lines 2574 2586 +12
Branches 359 359
============================================
+ Hits 2238 2250 +12
Misses 172 172
Partials 164 164 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
zhou-hao
reviewed
Oct 23, 2025
| }); | ||
| return flux | ||
| .skip(1) | ||
| .flatMap(val -> Flux |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
contains_all的参数为null时,应该返回false