@Test public void testAnonymousClass() { LinkedList<Candidate> list = new LinkedList<Candidate>(); String value = "prefix at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184) suffix"; recognizer.recognize(value, list); Assert.assertEquals(1, list.size()); checkClassCandidate(list.get(0), "org.junit.runners.ParentRunner", "ParentRunner", 184, null, value.indexOf("at org"), value.indexOf(" suffix"), value.indexOf("(") + 1, value.indexOf(")")); }
@Override public void recognize(String content, List<Candidate> candidates) { Matcher matcher = STACKTRACE_PATTERN.matcher(content); while(matcher.find()) { String className; String signature = matcher.group(2); if(signature.contains(".access$")) { signature = signature.replaceFirst("\\.access\\$\\d+", ".access"); } if(signature.contains("$")) { className = signature.substring(0, signature.indexOf("$")); } else { className = signature.substring(0, signature.lastIndexOf(".")); } String line = matcher.group(6); candidates.add(new ClassCandidate(matcher.start(), matcher.end(), matcher.start(3), matcher.end(3), className, matcher.group(4), line == null? 0: Integer.valueOf(line), null)); } }
JavaStackTraceRecognizer extends ClassRecognizer { @Override public void recognize(String content, List<Candidate> candidates) { Matcher matcher = STACKTRACE_PATTERN.matcher(content); while(matcher.find()) { String className; String signature = matcher.group(2); if(signature.contains(".access$")) { signature = signature.replaceFirst("\\.access\\$\\d+", ".access"); } if(signature.contains("$")) { className = signature.substring(0, signature.indexOf("$")); } else { className = signature.substring(0, signature.lastIndexOf(".")); } String line = matcher.group(6); candidates.add(new ClassCandidate(matcher.start(), matcher.end(), matcher.start(3), matcher.end(3), className, matcher.group(4), line == null? 0: Integer.valueOf(line), null)); } } }
JavaStackTraceRecognizer extends ClassRecognizer { @Override public void recognize(String content, List<Candidate> candidates) { Matcher matcher = STACKTRACE_PATTERN.matcher(content); while(matcher.find()) { String className; String signature = matcher.group(2); if(signature.contains(".access$")) { signature = signature.replaceFirst("\\.access\\$\\d+", ".access"); } if(signature.contains("$")) { className = signature.substring(0, signature.indexOf("$")); } else { className = signature.substring(0, signature.lastIndexOf(".")); } String line = matcher.group(6); candidates.add(new ClassCandidate(matcher.start(), matcher.end(), matcher.start(3), matcher.end(3), className, matcher.group(4), line == null? 0: Integer.valueOf(line), null)); } }  }
JavaStackTraceRecognizer extends ClassRecognizer { @Override public void recognize(String content, List<Candidate> candidates) { Matcher matcher = STACKTRACE_PATTERN.matcher(content); while(matcher.find()) { String className; String signature = matcher.group(2); if(signature.contains(".access$")) { signature = signature.replaceFirst("\\.access\\$\\d+", ".access"); } if(signature.contains("$")) { className = signature.substring(0, signature.indexOf("$")); } else { className = signature.substring(0, signature.lastIndexOf(".")); } String line = matcher.group(6); candidates.add(new ClassCandidate(matcher.start(), matcher.end(), matcher.start(3), matcher.end(3), className, matcher.group(4), line == null? 0: Integer.valueOf(line), null)); } }  @Override void recognize(String content, List<Candidate> candidates); }
JavaStackTraceRecognizer extends ClassRecognizer { @Override public void recognize(String content, List<Candidate> candidates) { Matcher matcher = STACKTRACE_PATTERN.matcher(content); while(matcher.find()) { String className; String signature = matcher.group(2); if(signature.contains(".access$")) { signature = signature.replaceFirst("\\.access\\$\\d+", ".access"); } if(signature.contains("$")) { className = signature.substring(0, signature.indexOf("$")); } else { className = signature.substring(0, signature.lastIndexOf(".")); } String line = matcher.group(6); candidates.add(new ClassCandidate(matcher.start(), matcher.end(), matcher.start(3), matcher.end(3), className, matcher.group(4), line == null? 0: Integer.valueOf(line), null)); } }  @Override void recognize(String content, List<Candidate> candidates);  }