Buggy code:
public class EndIfHandler extends CommandHandlerWithHelp { public EndIfHandler ( ) { } @ Override public boolean isAvailable ( CommandContext ctx ) { } @ Override protected void doHandle ( CommandContext ctx ) throws CommandLineException { final IfElseBlock ifBlock = IfElseBlock . remove ( ctx ) ; final BatchManager batchManager = ctx . getBatchManager ( ) ; if ( ! ( batchManager . isBatchActive ( ) ) ) { if ( ifBlock . isInIf ( ) ) { throw new CommandLineException ( "if<seq2seq4repair_space>block<seq2seq4repair_space>did<seq2seq4repair_space>not<seq2seq4repair_space>activate<seq2seq4repair_space>batch<seq2seq4repair_space>mode." ) ; } else { throw new CommandLineException ( "else<seq2seq4repair_space>block<seq2seq4repair_space>did<seq2seq4repair_space>not<seq2seq4repair_space>activate<seq2seq4repair_space>batch<seq2seq4repair_space>mode." ) ; } } final Batch batch = batchManager . getActiveBatch ( ) ; batchManager . discardActiveBatch ( ) ; final ModelControllerClient client = ctx . getModelControllerClient ( ) ; if ( client == null ) { throw new CommandLineException ( "The<seq2seq4repair_space>connection<seq2seq4repair_space>to<seq2seq4repair_space>the<seq2seq4repair_space>controller<seq2seq4repair_space>has<seq2seq4repair_space>not<seq2seq4repair_space>been<seq2seq4repair_space>established." ) ; } final ModelNode conditionRequest = ifBlock . getConditionRequest ( ) ; if ( conditionRequest == null ) { throw new CommandLineException ( "The<seq2seq4repair_space>condition<seq2seq4repair_space>request<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>available." ) ; } final String [ ] path = ifBlock . getConditionPath ( ) ; if ( ( path == null ) || ( ( path . length ) == 0 ) ) { throw new CommandLineException ( "The<seq2seq4repair_space>condition<seq2seq4repair_space>path<seq2seq4repair_space>is<seq2seq4repair_space>empty." ) ; } final String value = ifBlock . getConditionValue ( ) ; if ( value == null ) { throw new CommandLineException ( "The<seq2seq4repair_space>condition<seq2seq4repair_space>value<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>specified." ) ; } ModelNode targetValue ; try { targetValue = client . execute ( conditionRequest ) ; } catch ( IOException e ) { throw new CommandLineException ( "condition<seq2seq4repair_space>request<seq2seq4repair_space>failed" , e ) ; } boolean pathExists = true ; for ( String name : path ) { if ( ! ( targetValue . hasDefined ( name ) ) ) { pathExists = false ; break ; } else { targetValue = targetValue . get ( name ) ; } } if ( pathExists && ( value . equals ( targetValue . asString ( ) ) ) ) { ModelNode ifRequest = ifBlock . getIfRequest ( ) ; if ( ifRequest == null ) { if ( ( batch . size ( ) ) == 0 ) { throw new CommandLineException ( "if<seq2seq4repair_space>request<seq2seq4repair_space>is<seq2seq4repair_space>missing." ) ; } ifRequest = batch . toRequest ( ) ; } try { final ModelNode response = client . execute ( ifRequest ) ; if ( ! ( Util . isSuccess ( response ) ) ) { new CommandLineException ( ( "if<seq2seq4repair_space>request<seq2seq4repair_space>failed:<seq2seq4repair_space>" + ( Util . getFailureDescription ( response ) ) ) ) ; } } catch ( IOException e ) { throw new CommandLineException ( "if<seq2seq4repair_space>request<seq2seq4repair_space>failed" , e ) ; } } else if ( ifBlock . isInElse ( ) ) { if ( ( batch . size ( ) ) == 0 ) { throw new CommandLineException ( "else<seq2seq4repair_space>block<seq2seq4repair_space>is<seq2seq4repair_space>empty." ) ; } try { final ModelNode response = client . execute ( batch . toRequest ( ) ) ; if ( ! ( Util . isSuccess ( response ) ) ) { <START_BUG> new CommandLineException ( ( "else<seq2seq4repair_space>request<seq2seq4repair_space>failed:<seq2seq4repair_space>" + ( Util . getFailureDescription ( response ) ) ) ) ; <END_BUG> } } catch ( IOException e ) { throw new CommandLineException ( "else<seq2seq4repair_space>request<seq2seq4repair_space>failed" , e ) ; } } } }

Fix:
throw new CommandLineException ( ( "else<seq2seq4repair_space>request<seq2seq4repair_space>failed:<seq2seq4repair_space>" + ( Util . getFailureDescription ( response ) ) ) ) ;