@Test(expected=IllegalArgumentException.class) public void testError7() { NameParser.parseFunction("test1.2"); }
static List<Object> parseFunction(String string) { Matcher matcher = functionAndParameter.matcher(string); if (matcher.matches()) { List<Object> parameters = new ArrayList<Object>(); parameters.add(matcher.group(1)); parameters.addAll(parseParameters(matcher.group(3))); return parameters; } matcher = functionAndStringParameter.matcher(string); if (matcher.matches()) { List<Object> parameters = new ArrayList<Object>(); parameters.add(matcher.group(1)); String quotedString = matcher.group(3); parameters.add(quotedString.substring(1, quotedString.length() - 1)); return parameters; } throw new IllegalArgumentException("Syntax error: function should be like xxx(num1, num2, ...) or xxx(\"string\") and was " + string); }
NameParser { static List<Object> parseFunction(String string) { Matcher matcher = functionAndParameter.matcher(string); if (matcher.matches()) { List<Object> parameters = new ArrayList<Object>(); parameters.add(matcher.group(1)); parameters.addAll(parseParameters(matcher.group(3))); return parameters; } matcher = functionAndStringParameter.matcher(string); if (matcher.matches()) { List<Object> parameters = new ArrayList<Object>(); parameters.add(matcher.group(1)); String quotedString = matcher.group(3); parameters.add(quotedString.substring(1, quotedString.length() - 1)); return parameters; } throw new IllegalArgumentException("Syntax error: function should be like xxx(num1, num2, ...) or xxx(\"string\") and was " + string); } }
NameParser { static List<Object> parseFunction(String string) { Matcher matcher = functionAndParameter.matcher(string); if (matcher.matches()) { List<Object> parameters = new ArrayList<Object>(); parameters.add(matcher.group(1)); parameters.addAll(parseParameters(matcher.group(3))); return parameters; } matcher = functionAndStringParameter.matcher(string); if (matcher.matches()) { List<Object> parameters = new ArrayList<Object>(); parameters.add(matcher.group(1)); String quotedString = matcher.group(3); parameters.add(quotedString.substring(1, quotedString.length() - 1)); return parameters; } throw new IllegalArgumentException("Syntax error: function should be like xxx(num1, num2, ...) or xxx(\"string\") and was " + string); }  }
NameParser { static List<Object> parseFunction(String string) { Matcher matcher = functionAndParameter.matcher(string); if (matcher.matches()) { List<Object> parameters = new ArrayList<Object>(); parameters.add(matcher.group(1)); parameters.addAll(parseParameters(matcher.group(3))); return parameters; } matcher = functionAndStringParameter.matcher(string); if (matcher.matches()) { List<Object> parameters = new ArrayList<Object>(); parameters.add(matcher.group(1)); String quotedString = matcher.group(3); parameters.add(quotedString.substring(1, quotedString.length() - 1)); return parameters; } throw new IllegalArgumentException("Syntax error: function should be like xxx(num1, num2, ...) or xxx(\"string\") and was " + string); }   }
NameParser { static List<Object> parseFunction(String string) { Matcher matcher = functionAndParameter.matcher(string); if (matcher.matches()) { List<Object> parameters = new ArrayList<Object>(); parameters.add(matcher.group(1)); parameters.addAll(parseParameters(matcher.group(3))); return parameters; } matcher = functionAndStringParameter.matcher(string); if (matcher.matches()) { List<Object> parameters = new ArrayList<Object>(); parameters.add(matcher.group(1)); String quotedString = matcher.group(3); parameters.add(quotedString.substring(1, quotedString.length() - 1)); return parameters; } throw new IllegalArgumentException("Syntax error: function should be like xxx(num1, num2, ...) or xxx(\"string\") and was " + string); }    }