in camel-upgrade-recipes/src/main/java/org/apache/camel/upgrade/camel40/java/CamelBeanRecipe.java [107:121]
private String extractMethodName(String methodCallString) {
// Regular expression to match the method call pattern
Pattern pattern = Pattern.compile("^([a-zA-Z_$][a-zA-Z0-9_$]*)\\(.+\\)$");
Matcher matcher = pattern.matcher(methodCallString);
// Check if the string matches the method call pattern
if (matcher.matches()) {
// Extract the method name from the matched group
String methodName = matcher.group(1);
return methodName;
} else {
// Return null if the string doesn't match the method call pattern
return null;
}
}