@Test public void testMultiple() { LinkedList<Candidate> list = new LinkedList<Candidate>(); String value = "prefix /usr/src/test/java/hello/HelloWorldTest.java:[19,27] middle\n" + "/var/src/other/OtherWorldTest.java:[11,27] suffix"; recognizer.recognize(value, list); Assert.assertEquals(2, list.size()); checkClassCandidate(list.get(0), "HelloWorldTest", "HelloWorldTest", 19, null, value.indexOf("/usr"), value.indexOf(" middle"), value.indexOf("HelloWorldTest"), value.indexOf(":[19,27]")); checkClassCandidate(list.get(1), "OtherWorldTest", "OtherWorldTest", 11, null, value.indexOf("/var"), value.indexOf(" suffix"), value.indexOf("OtherWorldTest"), value.indexOf(":[11,27]")); }
@Override public void recognize(String content, List<Candidate> candidates) { Matcher matcher = COMPILE_PATTERN.matcher(content); while(matcher.find()) { candidates.add(new ClassCandidate(matcher.start(), matcher.end(), matcher.start(2), matcher.end(2), matcher.group(3), matcher.group(3), Integer.valueOf(matcher.group(4)), null)); } }
JavaCompileRecognizer extends ClassRecognizer { @Override public void recognize(String content, List<Candidate> candidates) { Matcher matcher = COMPILE_PATTERN.matcher(content); while(matcher.find()) { candidates.add(new ClassCandidate(matcher.start(), matcher.end(), matcher.start(2), matcher.end(2), matcher.group(3), matcher.group(3), Integer.valueOf(matcher.group(4)), null)); } } }
JavaCompileRecognizer extends ClassRecognizer { @Override public void recognize(String content, List<Candidate> candidates) { Matcher matcher = COMPILE_PATTERN.matcher(content); while(matcher.find()) { candidates.add(new ClassCandidate(matcher.start(), matcher.end(), matcher.start(2), matcher.end(2), matcher.group(3), matcher.group(3), Integer.valueOf(matcher.group(4)), null)); } }  }
JavaCompileRecognizer extends ClassRecognizer { @Override public void recognize(String content, List<Candidate> candidates) { Matcher matcher = COMPILE_PATTERN.matcher(content); while(matcher.find()) { candidates.add(new ClassCandidate(matcher.start(), matcher.end(), matcher.start(2), matcher.end(2), matcher.group(3), matcher.group(3), Integer.valueOf(matcher.group(4)), null)); } }  @Override void recognize(String content, List<Candidate> candidates); }
JavaCompileRecognizer extends ClassRecognizer { @Override public void recognize(String content, List<Candidate> candidates) { Matcher matcher = COMPILE_PATTERN.matcher(content); while(matcher.find()) { candidates.add(new ClassCandidate(matcher.start(), matcher.end(), matcher.start(2), matcher.end(2), matcher.group(3), matcher.group(3), Integer.valueOf(matcher.group(4)), null)); } }  @Override void recognize(String content, List<Candidate> candidates);  }