Uncamelify method names as documented

This commit is contained in:
Eric Bottard
2017-08-10 15:39:37 +02:00
parent 136ab89678
commit 39ec7d36c1

View File

@@ -26,6 +26,7 @@ import org.springframework.context.ApplicationContext;
import org.springframework.shell.ConfigurableCommandRegistry;
import org.springframework.shell.MethodTarget;
import org.springframework.shell.MethodTargetRegistrar;
import org.springframework.shell.Utils;
import org.springframework.util.ReflectionUtils;
/**
@@ -52,7 +53,7 @@ public class StandardMethodTargetRegistrar implements MethodTargetRegistrar {
ShellMethod shellMapping = method.getAnnotation(ShellMethod.class);
String[] keys = shellMapping.key();
if (keys.length == 0) {
keys = new String[] {method.getName()};
keys = new String[] {Utils.unCamelify(method.getName())};
}
for (String key : keys) {
MethodTarget target = new MethodTarget(method, bean, shellMapping.value());