ThreadState (String line) { Matcher m = ourThreadStartPattern.matcher(line); if (m.find()) { final ThreadState state = new ThreadState(m.group(1), m.group(3)); if (line.contains(" daemon ")) { state.setDaemon(true); } return state; } m = ourForcedThreadStartPattern.matcher(line); if (m.matches()) { return new ThreadState(m.group(1), m.group(2)); } boolean daemon = line.contains(" [DAEMON]"); if (daemon) { line = StringUtil.replace(line, " [DAEMON]", ""); } m = matchYourKit(line); if (m != null) { ThreadState state = new ThreadState(m.group(1), m.group(2)); state.setDaemon(daemon); return state; } return null; }