commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Benedikt Ritter <benerit...@gmail.com>
Subject [LANG] Add ThreadUtils
Date Sun, 12 Apr 2015 11:14:29 GMT
Hi,

there is currently a discussion on github about the addition of a low level utility class
which helps to retrieve Threads [1]. The latest proposal is to implement a predicate based
approach for filtering threads [2]. My opinion is, that we should not add such an API at all,
because we would have to revert it anyway, when we upgrade [lang] to Java 8. Further more
I don't think it is a good idea to add a generic Pedicate interface to [lang]. This will only
cause confusion for users already using Java 8. So if we really want to add predicate based
API in ThreadUtils, it should IMHO Look like this:

Collection<Thread> ThreadUtils.findThreads(ThreadPredicate filter)

public interface ThreadPredicate {
   boolean test(Thread);
}

Later we can change this to:

Collection<Thread> ThreadUtils.findThreads(java.util.function.Predicate<Thread>
filter)

public interface ThreadPredicate extends java.util.function.Predicate<Thread>

I'd like to hear what others think about this.

Regards,
Benedikt

[1] https://github.com/apache/commons-lang/pull/61
[2] https://github.com/salyh/commons-lang/pull/1

Send from my mobile device
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Mime
View raw message