test_class.declarator: logger = LoggerFactory.getLogger(ThreadUtilTest.class)
test_class.modifier: private static final
test_class.original_string: private static final Logger logger = LoggerFactory.getLogger(ThreadUtilTest.class);
test_class.type: Logger
test_class.var_name: logger
test_class.file: ch-commons-util/src/test/java/com/cloudhopper/commons/util/ThreadUtilTest.java
test_class.identifier: ThreadUtilTest
test_case.body: @Test
      public void getAllThreadsMatching() {
          // try various regular expressions
  
          Thread[] allThreads0 = ThreadUtil.getAllThreadsMatching("main");
          Assert.assertEquals(1, allThreads0.length);
  
          Thread[] allThreads1 = ThreadUtil.getAllThreadsMatching("(?i).*Main.*");
          Assert.assertEquals(1, allThreads1.length);
  
          // the two previous should match
          Assert.assertEquals(allThreads0[0].getId(), allThreads1[0].getId());
  
          Thread[] allThreads2 = ThreadUtil.getAllThreadsMatching(".*main.*");
          Assert.assertEquals(1, allThreads2.length);
  
          // the two previous should match
          Assert.assertEquals(allThreads0[0].getId(), allThreads2[0].getId());
          
          // no matches
          Thread[] allThreads3 = ThreadUtil.getAllThreadsMatching(".*Main.*");
          Assert.assertEquals(0, allThreads3.length);
      }
test_case.class_method_signature: ThreadUtilTest.getAllThreadsMatching()
test_case.full_signature: @Test public void getAllThreadsMatching()
test_case.identifier: getAllThreadsMatching
test_case.invocations: getAllThreadsMatching assertEquals getAllThreadsMatching assertEquals assertEquals getId getId getAllThreadsMatching assertEquals assertEquals getId getId getAllThreadsMatching assertEquals
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void getAllThreadsMatching()
focal_class.file: ch-commons-util/src/main/java/com/cloudhopper/commons/util/ThreadUtil.java
focal_class.identifier: ThreadUtil
focal_class.class_method_signature: ThreadUtil.getRootThreadGroup()
focal_class.full_signature: static public ThreadGroup getRootThreadGroup()
focal_class.identifier: getRootThreadGroup
focal_class.modifiers: static public
focal_class.parameters: ()
focal_class.return: ThreadGroup
focal_class.signature: ThreadGroup getRootThreadGroup()
focal_class.class_method_signature: ThreadUtil.getAllThreads()
focal_class.full_signature: static public Thread[] getAllThreads()
focal_class.identifier: getAllThreads
focal_class.modifiers: static public
focal_class.parameters: ()
focal_class.return: Thread[]
focal_class.signature: Thread[] getAllThreads()
focal_class.class_method_signature: ThreadUtil.getThread(final long id)
focal_class.full_signature: static public Thread getThread(final long id)
focal_class.identifier: getThread
focal_class.modifiers: static public
focal_class.parameters: (final long id)
focal_class.return: Thread
focal_class.signature: Thread getThread(final long id)
focal_class.class_method_signature: ThreadUtil.getAllThreadsMatching(final String regex)
focal_class.full_signature: static public Thread[] getAllThreadsMatching(final String regex)
focal_class.identifier: getAllThreadsMatching
focal_class.modifiers: static public
focal_class.parameters: (final String regex)
focal_class.return: Thread[]
focal_class.signature: Thread[] getAllThreadsMatching(final String regex)
focal_method.body: static public Thread[] getAllThreadsMatching(final String regex) {
          if (regex == null)
              throw new NullPointerException("Null thread name regex");
          final Thread[] threads = getAllThreads();
          ArrayList<Thread> matchingThreads = new ArrayList<Thread>();
          for (Thread thread : threads) {
              if (thread.getName().matches(regex)) {
                  matchingThreads.add(thread);
              }
          }
          return matchingThreads.toArray(new Thread[0]);
      }
focal_method.class_method_signature: ThreadUtil.getAllThreadsMatching(final String regex)
focal_method.full_signature: static public Thread[] getAllThreadsMatching(final String regex)
focal_method.identifier: getAllThreadsMatching
focal_method.invocations: getAllThreads matches getName add toArray
focal_method.modifiers: static public
focal_method.parameters: (final String regex)
focal_method.return: Thread[]
focal_method.signature: Thread[] getAllThreadsMatching(final String regex)