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 getAllThreads() {
          Thread[] allThreads = ThreadUtil.getAllThreads();
  
          //for (Thread t : allThreads) {
          //    logger.info(t.getId() + ": " + t.getName());
          //}
  
          // sort of hard to predict how this test may be called, so we'll just
          // check that at least 4 threads were returned
          // 2: Reference Handler
          // 3: Finalizer
          // 4: Signal Dispatcher
          // 1: main
          Assert.assertEquals(true, allThreads.length >= 4);
      }
test_case.class_method_signature: ThreadUtilTest.getAllThreads()
test_case.full_signature: @Test public void getAllThreads()
test_case.identifier: getAllThreads
test_case.invocations: getAllThreads assertEquals
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void getAllThreads()
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[] getAllThreads() {
          final ThreadGroup root = getRootThreadGroup();
          final ThreadMXBean thbean = ManagementFactory.getThreadMXBean();
          int nAlloc = thbean.getThreadCount();
          int n = 0;
          Thread[] threads;
          do {
              nAlloc *= 2;
              threads = new Thread[nAlloc];
              n = root.enumerate(threads, true);
          } while (n == nAlloc);
          return java.util.Arrays.copyOf(threads, n);
      }
focal_method.class_method_signature: ThreadUtil.getAllThreads()
focal_method.full_signature: static public Thread[] getAllThreads()
focal_method.identifier: getAllThreads
focal_method.invocations: getRootThreadGroup getThreadMXBean getThreadCount enumerate copyOf
focal_method.modifiers: static public
focal_method.parameters: ()
focal_method.return: Thread[]
focal_method.signature: Thread[] getAllThreads()