You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Benedikt Ritter <br...@apache.org> on 2018/08/28 09:32:56 UTC

[LANG] Request for Comments for LANG-1417

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

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

Posted by Benedikt Ritter <br...@apache.org>.
Am Di., 28. Aug. 2018 um 18:52 Uhr schrieb Pascal Schumacher <
pascalschumacher@gmx.net>:

> 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: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
>

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

Posted by Pascal Schumacher <pa...@gmx.net>.
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: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org