Buggy code:
public class DeployHandler extends BatchModeCommandHandler { private final ArgumentWithoutValue force ; private final ArgumentWithoutValue l ; private final ArgumentWithoutValue path ; private final ArgumentWithoutValue name ; private final ArgumentWithoutValue rtName ; private final ArgumentWithValue serverGroups ; private final ArgumentWithoutValue allServerGroups ; private final ArgumentWithoutValue disabled ; private final ArgumentWithoutValue unmanaged ; private final ArgumentWithValue script ; private static final String CLI_ARCHIVE_SUFFIX = ".cli" ; public DeployHandler ( CommandContext ctx ) { } @ Override protected void doHandle ( CommandContext ctx ) throws CommandFormatException { final ModelControllerClient client = ctx . getModelControllerClient ( ) ; ParsedCommandLine args = ctx . getParsedCommandLine ( ) ; boolean l = this . l . isPresent ( args ) ; if ( ( ! ( args . hasProperties ( ) ) ) || l ) { listDeployments ( ctx , l ) ; return ; } final boolean unmanaged = this . unmanaged . isPresent ( args ) ; final String path = this . path . getValue ( args ) ; final File f ; if ( path != null ) { f = new File ( path ) ; if ( ! ( f . exists ( ) ) ) { throw new CommandFormatException ( ( ( "Path<seq2seq4repair_space>" + ( f . getAbsolutePath ( ) ) ) + "<seq2seq4repair_space>doesn't<seq2seq4repair_space>exist." ) ) ; } if ( ( ! unmanaged ) && ( f . isDirectory ( ) ) ) { throw new CommandFormatException ( ( ( f . getAbsolutePath ( ) ) + "<seq2seq4repair_space>is<seq2seq4repair_space>a<seq2seq4repair_space>directory." ) ) ; } } else { f = null ; } if ( isCliArchive ( f ) ) { <START_BUG> final ModelNode request = buildRequest ( ctx ) ; <END_BUG> if ( request == null ) { throw new CommandFormatException ( "Operation<seq2seq4repair_space>request<seq2seq4repair_space>wasn't<seq2seq4repair_space>built." ) ; } try { final ModelNode result = client . execute ( request ) ; if ( Util . isSuccess ( result ) ) { return ; } else { throw new CommandFormatException ( ( "Failed<seq2seq4repair_space>to<seq2seq4repair_space>execute<seq2seq4repair_space>archive<seq2seq4repair_space>script:<seq2seq4repair_space>" + ( Util . getFailureDescription ( result ) ) ) ) ; } } catch ( IOException e ) { throw new CommandFormatException ( ( "Failed<seq2seq4repair_space>to<seq2seq4repair_space>execute<seq2seq4repair_space>archive<seq2seq4repair_space>script:<seq2seq4repair_space>" + ( e . getLocalizedMessage ( ) ) ) , e ) ; } } String name = this . name . getValue ( args ) ; if ( name == null ) { if ( f == null ) { throw new CommandFormatException ( "Either<seq2seq4repair_space>path<seq2seq4repair_space>or<seq2seq4repair_space>--name<seq2seq4repair_space>is<seq2seq4repair_space>required." ) ; } name = f . getName ( ) ; } final String runtimeName = rtName . getValue ( args ) ; final boolean force = this . force . isPresent ( args ) ; final boolean disabled = this . disabled . isPresent ( args ) ; final String serverGroups = this . serverGroups . getValue ( args ) ; final boolean allServerGroups = this . allServerGroups . isPresent ( args ) ; if ( force ) { if ( f == null ) { throw new CommandFormatException ( ( ( this . force . getFullName ( ) ) + "<seq2seq4repair_space>requires<seq2seq4repair_space>a<seq2seq4repair_space>filesystem<seq2seq4repair_space>path<seq2seq4repair_space>of<seq2seq4repair_space>the<seq2seq4repair_space>deployment<seq2seq4repair_space>to<seq2seq4repair_space>be<seq2seq4repair_space>added<seq2seq4repair_space>to<seq2seq4repair_space>the<seq2seq4repair_space>deployment<seq2seq4repair_space>repository." ) ) ; } if ( ( disabled || ( serverGroups != null ) ) || allServerGroups ) { throw new CommandFormatException ( ( ( ( ( ( ( ( ( this . force . getFullName ( ) ) + "<seq2seq4repair_space>only<seq2seq4repair_space>replaces<seq2seq4repair_space>the<seq2seq4repair_space>content<seq2seq4repair_space>in<seq2seq4repair_space>the<seq2seq4repair_space>deployment<seq2seq4repair_space>repository<seq2seq4repair_space>and<seq2seq4repair_space>can't<seq2seq4repair_space>be<seq2seq4repair_space>used<seq2seq4repair_space>in<seq2seq4repair_space>combination<seq2seq4repair_space>with<seq2seq4repair_space>any<seq2seq4repair_space>of<seq2seq4repair_space>" ) + ( this . disabled . getFullName ( ) ) ) + ",<seq2seq4repair_space>" ) + ( this . serverGroups . getFullName ( ) ) ) + "<seq2seq4repair_space>or<seq2seq4repair_space>" ) + ( this . allServerGroups . getFullName ( ) ) ) + '.' ) ) ; } if ( Util . isDeploymentInRepository ( name , client ) ) { replaceDeployment ( ctx , f , name , runtimeName ) ; return ; } else if ( ctx . isDomainMode ( ) ) { final ModelNode request = buildAddRequest ( ctx , f , name , runtimeName , unmanaged ) ; execute ( ctx , request , f , unmanaged ) ; return ; } } if ( disabled ) { if ( f == null ) { throw new CommandFormatException ( ( ( this . disabled . getFullName ( ) ) + "<seq2seq4repair_space>requires<seq2seq4repair_space>a<seq2seq4repair_space>filesystem<seq2seq4repair_space>path<seq2seq4repair_space>of<seq2seq4repair_space>the<seq2seq4repair_space>deployment<seq2seq4repair_space>to<seq2seq4repair_space>be<seq2seq4repair_space>added<seq2seq4repair_space>to<seq2seq4repair_space>the<seq2seq4repair_space>deployment<seq2seq4repair_space>repository." ) ) ; } if ( ( serverGroups != null ) || allServerGroups ) { throw new CommandFormatException ( ( ( ( ( ( ( this . serverGroups . getFullName ( ) ) + "<seq2seq4repair_space>and<seq2seq4repair_space>" ) + ( this . allServerGroups . getFullName ( ) ) ) + "<seq2seq4repair_space>can't<seq2seq4repair_space>be<seq2seq4repair_space>used<seq2seq4repair_space>in<seq2seq4repair_space>combination<seq2seq4repair_space>with<seq2seq4repair_space>" ) + ( this . disabled . getFullName ( ) ) ) + '.' ) ) ; } if ( Util . isDeploymentInRepository ( name , client ) ) { throw new CommandFormatException ( ( ( ( ( "'" + name ) + "'<seq2seq4repair_space>already<seq2seq4repair_space>exists<seq2seq4repair_space>in<seq2seq4repair_space>the<seq2seq4repair_space>deployment<seq2seq4repair_space>repository<seq2seq4repair_space>(use<seq2seq4repair_space>" ) + ( this . force . getFullName ( ) ) ) + "<seq2seq4repair_space>to<seq2seq4repair_space>replace<seq2seq4repair_space>the<seq2seq4repair_space>existing<seq2seq4repair_space>content<seq2seq4repair_space>in<seq2seq4repair_space>the<seq2seq4repair_space>repository)." ) ) ; } final ModelNode request = buildAddRequest ( ctx , f , name , runtimeName , unmanaged ) ; execute ( ctx , request , f , unmanaged ) ; return ; } final ModelNode deployRequest ; if ( ctx . isDomainMode ( ) ) { final List < String > sgList ; if ( allServerGroups ) { if ( serverGroups != null ) { throw new CommandFormatException ( ( ( ( this . serverGroups . getFullName ( ) ) + "<seq2seq4repair_space>can't<seq2seq4repair_space>appear<seq2seq4repair_space>in<seq2seq4repair_space>the<seq2seq4repair_space>same<seq2seq4repair_space>command<seq2seq4repair_space>with<seq2seq4repair_space>" ) + ( this . allServerGroups . getFullName ( ) ) ) ) ; } sgList = Util . getServerGroups ( client ) ; if ( sgList . isEmpty ( ) ) { throw new CommandFormatException ( "No<seq2seq4repair_space>server<seq2seq4repair_space>group<seq2seq4repair_space>is<seq2seq4repair_space>available." ) ; } } else if ( serverGroups == null ) { final StringBuilder buf = new StringBuilder ( ) ; buf . append ( "One<seq2seq4repair_space>of<seq2seq4repair_space>" ) ; if ( f != null ) { buf . append ( this . disabled . getFullName ( ) ) . append ( ",<seq2seq4repair_space>" ) ; }

Fix:
final ModelNode request = buildRequestWOValidation ( ctx ) ;