Buggy code:
public class OperationRequestCompleter implements Completor { private final CommandContext ctx ; public OperationRequestCompleter ( CommandContext ctx ) { } @ SuppressWarnings ( { "unchecked" , "rawtypes" } ) @ Override public int complete ( String buffer , int cursor , List candidates ) { if ( ( ! ( buffer . isEmpty ( ) ) ) && ( ( buffer . charAt ( 0 ) ) == '//' ) ) return - 1 ; DefaultOperationCallbackHandler handler = new DefaultOperationCallbackHandler ( new org . jboss . as . cli . operation . impl . DefaultOperationRequestAddress ( ctx . getPrefix ( ) ) ) ; try { ctx . getOperationRequestParser ( ) . parse ( buffer , handler ) ; } catch ( OperationFormatException e1 ) { return - 1 ; } if ( handler . isRequestComplete ( ) ) { return - 1 ; } if ( ( handler . hasProperties ( ) ) || ( handler . endsOnArgumentListStart ( ) ) ) { if ( handler . endsOnArgumentValueSeparator ( ) ) { return - 1 ; } OperationCandidatesProvider provider = ctx . getOperationCandidatesProvider ( ) ; List < String > propertyNames = provider . getPropertyNames ( handler . getOperationName ( ) , handler . getAddress ( ) ) ; if ( propertyNames . isEmpty ( ) ) { return - 1 ; } if ( handler . endsOnArgumentListStart ( ) ) { candidates . addAll ( propertyNames ) ; Collections . sort ( candidates ) ; return ( handler . getLastSeparatorIndex ( ) ) + 1 ; } Set < String > specifiedNames = handler . getPropertyNames ( ) ; String chunk = null ; for ( String specifiedName : specifiedNames ) { String value = handler . getPropertyValue ( specifiedName ) ; if ( value == null ) { chunk = specifiedName ; } else { propertyNames . remove ( specifiedName ) ; } } if ( chunk == null ) { if ( handler . endsOnArgumentSeparator ( ) ) { candidates . addAll ( propertyNames ) ; Collections . sort ( candidates ) ; } return ( handler . getLastSeparatorIndex ( ) ) + 1 ; } for ( String candidate : propertyNames ) { if ( candidate . startsWith ( chunk ) ) { candidates . add ( candidate ) ; } } Collections . sort ( candidates ) ; return ( handler . getLastSeparatorIndex ( ) ) + 1 ; } if ( ( handler . hasOperationName ( ) ) || ( handler . endsOnAddressOperationNameSeparator ( ) ) ) { OperationCandidatesProvider provider = ctx . getOperationCandidatesProvider ( ) ; <START_BUG> final List < String > names = provider . getOperationNames ( ctx . getPrefix ( ) ) ; <END_BUG> if ( names . isEmpty ( ) ) { return - 1 ; } final String chunk = handler . getOperationName ( ) ; if ( chunk == null ) { candidates . addAll ( names ) ; } else { for ( String name : names ) { if ( ( chunk == null ) || ( name . startsWith ( chunk ) ) ) { candidates . add ( name ) ; } } } Collections . sort ( candidates ) ; return ( handler . getLastSeparatorIndex ( ) ) + 1 ; } final OperationRequestAddress address = handler . getAddress ( ) ; final String chunk ; if ( ( ( ( address . isEmpty ( ) ) || ( handler . endsOnNodeSeparator ( ) ) ) || ( handler . endsOnNodeTypeNameSeparator ( ) ) ) || ( address . equals ( ctx . getPrefix ( ) ) ) ) { chunk = null ; } else if ( address . endsOnType ( ) ) { chunk = address . getNodeType ( ) ; address . toParentNode ( ) ; } else { chunk = address . toNodeType ( ) ; } OperationCandidatesProvider provider = ctx . getOperationCandidatesProvider ( ) ; final List < String > names ; if ( address . endsOnType ( ) ) { names = provider . getNodeNames ( address ) ; } else { names = provider . getNodeTypes ( address ) ; } if ( names . isEmpty ( ) ) { return - 1 ; } if ( chunk == null ) { candidates . addAll ( names ) ; } else { for ( String name : names ) { if ( ( chunk == null ) || ( name . startsWith ( chunk ) ) ) { candidates . add ( name ) ; } } } Collections . sort ( candidates ) ; return ( handler . getLastSeparatorIndex ( ) ) + 1 ; } }

Fix:
final List < String > names = provider . getOperationNames ( handler . getAddress ( ) ) ;