commons-dev mailing list archives

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

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>

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

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



Send from my mobile device
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message