-
-
Notifications
You must be signed in to change notification settings - Fork 639
New issue
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
Implement Traversable#reject #2157
Conversation
JDK9 build failed with |
public M removeKeys(Predicate<? super K> predicate) { | ||
Objects.requireNonNull(predicate, "predicate is null"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe you should save this checking. This will be more concrete if you will throw an exception in the called method but not in its implementation. This also applies to other deprecated methods. There are many methods in Vavr where this rule is not respected, but I believe that it should
a7c9d8c
to
c700980
Compare
@ruslansennov fixed. |
thank you!
this PR adds new methods to the |
c700980
to
1984f49
Compare
Codecov Report
@@ Coverage Diff @@
## master #2157 +/- ##
============================================
+ Coverage 97.45% 97.46% +0.01%
- Complexity 5206 5238 +32
============================================
Files 92 92
Lines 11934 11997 +63
Branches 1576 1578 +2
============================================
+ Hits 11630 11693 +63
Misses 148 148
Partials 156 156
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clean PR!
It shows it isn't you first PR 😄
Many thanks for you ongoing efforts!
@@ -164,9 +164,16 @@ public Q removeAll(Iterable<? extends T> elements) { | |||
return Collections.removeAll((Q) this, elements); | |||
} | |||
|
|||
@SuppressWarnings("unchecked") | |||
@Deprecated |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is good to mark it! Maybe we can remove the method for Vavr 1.0.0 - but for now it can stay as-is. Thx!
@@ -58,11 +58,11 @@ | |||
* <li>{@link #filter(BiPredicate)}</li> | |||
* <li>{@link #filterKeys(Predicate)}</li> | |||
* <li>{@link #filterValues(Predicate)}</li> | |||
* <li>{@link #reject(BiPredicate)}</li> | |||
* <li>{@link #rejectKeys(Predicate)}</li> | |||
* <li>{@link #rejectValues(Predicate)}</li> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great, thx!
* Implement Traversable#reject * Replace Seq#removeAll(Predicate) with Traversable#reject(Predicate) * Remove `reject` implementation from Queue and PriorityQueue
* Implement Traversable#reject * Replace Seq#removeAll(Predicate) with Traversable#reject(Predicate) * Remove `reject` implementation from Queue and PriorityQueue
* Implement Traversable#reject * Replace Seq#removeAll(Predicate) with Traversable#reject(Predicate) * Remove `reject` implementation from Queue and PriorityQueue
Fix #2156.
P.S.
A also replace
Map#removeAll
,Map#removeKeys
andMap#removeValues
withreject*
variant. With deprecation of course.