diff options
author | pascalschumacher <pascalschumacher@gmx.net> | 2018-11-18 11:59:34 +0100 |
---|---|---|
committer | pascalschumacher <pascalschumacher@gmx.net> | 2018-11-19 22:04:35 +0100 |
commit | 89cbfa54b041541077b8158b667ee3830a8abe5c (patch) | |
tree | 799db29a69cc6df137657ed1d965fae85f672fb9 /src/main/java/org/apache/commons/lang3/ThreadUtils.java | |
parent | c4d0dbcb56b8980b1b3b7c85d00ad6540788c08e (diff) | |
download | apache-commons-lang-89cbfa54b041541077b8158b667ee3830a8abe5c.tar.gz |
Make whitespace use after tokens consistent and add a checkstyle rule to enforce it.
Diffstat (limited to 'src/main/java/org/apache/commons/lang3/ThreadUtils.java')
-rw-r--r-- | src/main/java/org/apache/commons/lang3/ThreadUtils.java | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/main/java/org/apache/commons/lang3/ThreadUtils.java b/src/main/java/org/apache/commons/lang3/ThreadUtils.java index caf6fa0d2..16986e0de 100644 --- a/src/main/java/org/apache/commons/lang3/ThreadUtils.java +++ b/src/main/java/org/apache/commons/lang3/ThreadUtils.java @@ -52,7 +52,7 @@ public class ThreadUtils { public static Thread findThreadById(final long threadId, final ThreadGroup threadGroup) { Validate.isTrue(threadGroup != null, "The thread group must not be null"); final Thread thread = findThreadById(threadId); - if(thread != null && threadGroup.equals(thread.getThreadGroup())) { + if (thread != null && threadGroup.equals(thread.getThreadGroup())) { return thread; } return null; @@ -75,7 +75,7 @@ public class ThreadUtils { public static Thread findThreadById(final long threadId, final String threadGroupName) { Validate.isTrue(threadGroupName != null, "The thread group name must not be null"); final Thread thread = findThreadById(threadId); - if(thread != null && thread.getThreadGroup() != null && thread.getThreadGroup().getName().equals(threadGroupName)) { + if (thread != null && thread.getThreadGroup() != null && thread.getThreadGroup().getName().equals(threadGroupName)) { return thread; } return null; @@ -119,13 +119,13 @@ public class ThreadUtils { final Collection<ThreadGroup> threadGroups = findThreadGroups(new NamePredicate(threadGroupName)); - if(threadGroups.isEmpty()) { + if (threadGroups.isEmpty()) { return Collections.emptyList(); } final Collection<Thread> result = new ArrayList<>(); final NamePredicate threadNamePredicate = new NamePredicate(threadName); - for(final ThreadGroup group : threadGroups) { + for (final ThreadGroup group : threadGroups) { result.addAll(findThreads(group, false, threadNamePredicate)); } return Collections.unmodifiableCollection(result); @@ -170,7 +170,7 @@ public class ThreadUtils { */ public static ThreadGroup getSystemThreadGroup() { ThreadGroup threadGroup = Thread.currentThread().getThreadGroup(); - while(threadGroup.getParent() != null) { + while (threadGroup.getParent() != null) { threadGroup = threadGroup.getParent(); } return threadGroup; @@ -431,11 +431,11 @@ public class ThreadUtils { threadGroups = new ThreadGroup[count + (count / 2) + 1]; //slightly grow the array size count = group.enumerate(threadGroups, recurse); //return value of enumerate() must be strictly less than the array size according to javadoc - } while(count >= threadGroups.length); + } while (count >= threadGroups.length); final List<ThreadGroup> result = new ArrayList<>(count); - for(int i = 0; i < count; ++i) { - if(predicate.test(threadGroups[i])) { + for (int i = 0; i < count; ++i) { + if (predicate.test(threadGroups[i])) { result.add(threadGroups[i]); } } |