[forge-issues] [JBoss JIRA] (FORGE-2529) Creating commands with multi steps is a pain with repeated calls

Claus Ibsen (JIRA) issues at jboss.org
Wed Nov 11 10:36:00 EST 2015


Claus Ibsen created FORGE-2529:
----------------------------------

             Summary: Creating commands with multi steps is a pain with repeated calls
                 Key: FORGE-2529
                 URL: https://issues.jboss.org/browse/FORGE-2529
             Project: Forge
          Issue Type: Enhancement
    Affects Versions: 2.20.1.Final
            Reporter: Claus Ibsen


I think you guys are aware of the surprise you have as a forge addon developer that you get repeated calls for next() / execute() / initializeUI() that you do not expected, and can't seem to grasp the order they are called.

And here I am speaking when a command implements UIWizard.

If something goes wrong you can end up with a stacktrace and exception message that does not give you much clue how to fix.
{code}
16:33:22,214 SEVERE [org.jboss.forge.addon.shell.aesh.CommandAdapter] (AeshProcess: 3) Controller cannot be executed: java.lang.IllegalArgumentException: Controller cannot be executed
	at org.jboss.forge.furnace.util.Assert.isTrue(Assert.java:36) [furnace-api-2.22.7.Final.jar:2.22.7.Final]
	at org.jboss.forge.addon.ui.impl.controller.WizardCommandControllerImpl.execute(WizardCommandControllerImpl.java:129) [ui-impl-2.20.1.Final.jar:2.20.1.Final]
	at org.jboss.forge.addon.ui.impl.controller.NoUIWizardControllerDecorator.execute(NoUIWizardControllerDecorator.java:152) [ui-impl-2.20.1.Final.jar:2.20.1.Final]
	at org.jboss.forge.addon.shell.aesh.CommandAdapter.execute(CommandAdapter.java:98) [shell-impl-2.20.1.Final.jar:2.20.1.Final]
	at org.jboss.forge.addon.shell.aesh.ForgeCommandContainer.executeCommand(ForgeCommandContainer.java:90) [shell-impl-2.20.1.Final.jar:2.20.1.Final]
	at org.jboss.aesh.console.AeshConsoleImpl$AeshConsoleCallbackImpl.execute(AeshConsoleImpl.java:311) [aesh-0.65.1.jar:0.65.1]
	at org.jboss.aesh.console.AeshProcess.run(AeshProcess.java:53) [aesh-0.65.1.jar:0.65.1]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_45]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_45]
	at java.lang.Thread.run(Thread.java:744) [rt.jar:1.7.0_45]
{code}

In past experience I have seen this kind of exception if an exception was thrown in the initializeUI method that sometimes neither is logged in the forge log. So it can take some trail and error to fix.

Anyway just wanted to share that if there is something that can enhance that exception above to give the addon developer a chance to know what was wrong and what he/she can do to fix it.



--
This message was sent by Atlassian JIRA
(v6.4.11#64026)


More information about the forge-issues mailing list