demobox commented on this pull request.


> @@ -344,7 +349,17 @@ private void discoverCommands(CommandProcessorImpl 
> commandProcessor, ClassLoader
                         @Override
                         public Action createNewAction() {
                             try {
-                                return ((Class<? extends Action>) 
actionClass).newInstance();
+                               Action action = ((Class< ? extends Action>) 
actionClass).newInstance();
+                               if (action instanceof ComputeCommandBase) {
+                                   ShellTableFactory shellTableFactory = 
((ComputeCommandBase) action).getShellTableFactory();
+                                   if (shellTableFactory instanceof 
BasicShellTableFactory) {
+                                       BasicShellTableFactory factory = 
(BasicShellTableFactory) shellTableFactory;
+                                       if (factory.getScriptEngineManager() == 
null) {
+                                           factory.setScriptEngineManager(new 
ScriptEngineManager());

@nacx Do we know why this is needed? It looks like we're reaching quite a long 
way into the domain model here to check and set something - should that thing 
not be set correctly in the first place?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-cli/pull/35#pullrequestreview-7919057

Reply via email to