@Test public void testParseNestedInvokedConcourseMethod() { Set<String> methods = SyntaxTools .parseShortInvokedMethods("foo(concourse.bar(x, y))"); Assert.assertEquals(methods, Sets.newHashSet("foo")); }
protected static Set<String> parseShortInvokedMethods(String line) { Set<String> methods = Sets.newHashSet(); Set<String> blacklist = Sets.newHashSet("time", "date"); String regex = "\\b(?!" + StringUtils.join(blacklist, "|") + ")[\\w\\.]+\\("; Pattern pattern = Pattern.compile(regex); Matcher matcher = pattern.matcher(line); while (matcher.find()) { if(!matcher.group().startsWith("concourse.")) { methods.add(matcher.group().replace("(", "")); } } return methods; }
SyntaxTools { protected static Set<String> parseShortInvokedMethods(String line) { Set<String> methods = Sets.newHashSet(); Set<String> blacklist = Sets.newHashSet("time", "date"); String regex = "\\b(?!" + StringUtils.join(blacklist, "|") + ")[\\w\\.]+\\("; Pattern pattern = Pattern.compile(regex); Matcher matcher = pattern.matcher(line); while (matcher.find()) { if(!matcher.group().startsWith("concourse.")) { methods.add(matcher.group().replace("(", "")); } } return methods; } }
SyntaxTools { protected static Set<String> parseShortInvokedMethods(String line) { Set<String> methods = Sets.newHashSet(); Set<String> blacklist = Sets.newHashSet("time", "date"); String regex = "\\b(?!" + StringUtils.join(blacklist, "|") + ")[\\w\\.]+\\("; Pattern pattern = Pattern.compile(regex); Matcher matcher = pattern.matcher(line); while (matcher.find()) { if(!matcher.group().startsWith("concourse.")) { methods.add(matcher.group().replace("(", "")); } } return methods; } private  SyntaxTools(); }
SyntaxTools { protected static Set<String> parseShortInvokedMethods(String line) { Set<String> methods = Sets.newHashSet(); Set<String> blacklist = Sets.newHashSet("time", "date"); String regex = "\\b(?!" + StringUtils.join(blacklist, "|") + ")[\\w\\.]+\\("; Pattern pattern = Pattern.compile(regex); Matcher matcher = pattern.matcher(line); while (matcher.find()) { if(!matcher.group().startsWith("concourse.")) { methods.add(matcher.group().replace("(", "")); } } return methods; } private  SyntaxTools(); static String handleMissingArgCommas(String line,
            List<String> methods); static String handleShortSyntax(String line, List<String> options); }
SyntaxTools { protected static Set<String> parseShortInvokedMethods(String line) { Set<String> methods = Sets.newHashSet(); Set<String> blacklist = Sets.newHashSet("time", "date"); String regex = "\\b(?!" + StringUtils.join(blacklist, "|") + ")[\\w\\.]+\\("; Pattern pattern = Pattern.compile(regex); Matcher matcher = pattern.matcher(line); while (matcher.find()) { if(!matcher.group().startsWith("concourse.")) { methods.add(matcher.group().replace("(", "")); } } return methods; } private  SyntaxTools(); static String handleMissingArgCommas(String line,
            List<String> methods); static String handleShortSyntax(String line, List<String> options);  }