[LANG] Request for Comments for LANG-1417

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[LANG] Request for Comments for LANG-1417

Benedikt Ritter-4
Hi,

I've implemented a proposal to get rid of ThreadPredicate and
ThreadGroupPredicate in ThreadUtils [1]. I have two questions about this
issue:

1) It does not seem possible to let our custom pre Java 8 predicates extend
java.util.function.Predicate. I've explained why I think this is not
possible in LANG-1417 [2]. I'd like to here comments about that. Am I
missing something?
2) Should be put the new java.util.function.Predicate based API inside
ThreadUtils or should we deprecate ThreadUtils all together und create a
new version of the class (ThreadUtils2 / ThreadUtilsJava8 /
org.apache.commons.thread.ThreadUtils) that only operates on Predicates?

Regards,
Benedikt

[1] https://github.com/apache/commons-lang/349
[2] https://issues.apache.org/jira/browse/LANG-1417
Reply | Threaded
Open this post in threaded view
|

Re: [LANG] Request for Comments for LANG-1417

Pascal Schumacher
Hi Benedikt,

not sure if anything is gained this change.

It is already possible use lambda expressions or method references
instead of ThreadPredicate/ThreadGroupPredicate.

Users will have to change their code to avoid deprecation warnings.

I would prefer to just annotate ThreadPredicate and ThreadGroupPredicate
with @FunctionalInterface and be done.

Regards,
Pascal

Am 28.08.2018 um 11:32 schrieb Benedikt Ritter:

> Hi,
>
> I've implemented a proposal to get rid of ThreadPredicate and
> ThreadGroupPredicate in ThreadUtils [1]. I have two questions about this
> issue:
>
> 1) It does not seem possible to let our custom pre Java 8 predicates extend
> java.util.function.Predicate. I've explained why I think this is not
> possible in LANG-1417 [2]. I'd like to here comments about that. Am I
> missing something?
> 2) Should be put the new java.util.function.Predicate based API inside
> ThreadUtils or should we deprecate ThreadUtils all together und create a
> new version of the class (ThreadUtils2 / ThreadUtilsJava8 /
> org.apache.commons.thread.ThreadUtils) that only operates on Predicates?
>
> Regards,
> Benedikt
>
> [1] https://github.com/apache/commons-lang/349
> [2] https://issues.apache.org/jira/browse/LANG-1417
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: [LANG] Request for Comments for LANG-1417

Benedikt Ritter-4
Am Di., 28. Aug. 2018 um 18:52 Uhr schrieb Pascal Schumacher <
[hidden email]>:

> Hi Benedikt,
>
> not sure if anything is gained this change.
>
> It is already possible use lambda expressions or method references
> instead of ThreadPredicate/ThreadGroupPredicate.
>
> Users will have to change their code to avoid deprecation warnings.
>
> I would prefer to just annotate ThreadPredicate and ThreadGroupPredicate
> with @FunctionalInterface and be done.
>

Good point and probably the best solution! Will adapt my PR.

Thanks,
Benedikt


>
> Regards,
> Pascal
>
> Am 28.08.2018 um 11:32 schrieb Benedikt Ritter:
> > Hi,
> >
> > I've implemented a proposal to get rid of ThreadPredicate and
> > ThreadGroupPredicate in ThreadUtils [1]. I have two questions about this
> > issue:
> >
> > 1) It does not seem possible to let our custom pre Java 8 predicates
> extend
> > java.util.function.Predicate. I've explained why I think this is not
> > possible in LANG-1417 [2]. I'd like to here comments about that. Am I
> > missing something?
> > 2) Should be put the new java.util.function.Predicate based API inside
> > ThreadUtils or should we deprecate ThreadUtils all together und create a
> > new version of the class (ThreadUtils2 / ThreadUtilsJava8 /
> > org.apache.commons.thread.ThreadUtils) that only operates on Predicates?
> >
> > Regards,
> > Benedikt
> >
> > [1] https://github.com/apache/commons-lang/349
> > [2] https://issues.apache.org/jira/browse/LANG-1417
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>