Buggy code:
class SecurityDomainAdd extends AbstractAddStepHandler { static final String OPERATION_NAME = ADD ; private static final String CACHE_CONTAINER_NAME = "security" ; static final ModelNode getRecreateOperation ( ModelNode address , ModelNode securityDomain ) { } static final SecurityDomainAdd INSTANCE = new SecurityDomainAdd ( ) ; private SecurityDomainAdd ( ) { } protected void populateModel ( ModelNode operation , ModelNode model ) throws OperationFailedException { } protected void performRuntime ( OperationContext context , ModelNode operation , final ModelNode model , final ServiceVerificationHandler verificationHandler , final List < ServiceController < ? > > newControllers ) { } void launchServices ( OperationContext context , String securityDomain , ModelNode model ) { } public void launchServices ( OperationContext context , String securityDomain , ModelNode model , ServiceVerificationHandler verificationHandler , List < ServiceController < ? > > newControllers ) { } private ApplicationPolicy createApplicationPolicy ( String securityDomain , final ModelNode model ) { } private boolean processMapping ( String securityDomain , ModelNode node , ApplicationPolicy applicationPolicy ) { node = peek ( node , Constants . MAPPING , Constants . CLASSIC ) ; if ( node == null ) return false ; List < ModelNode > modules = node . get ( Constants . MAPPING_MODULES ) . asList ( ) ; for ( ModelNode module : modules ) { MappingInfo mappingInfo = new MappingInfo ( securityDomain ) ; String codeName = extractCode ( module , MAPPING_MAP ) ; String mappingType ; if ( module . hasDefined ( Constants . TYPE ) ) mappingType = module . get ( Constants . TYPE ) . asString ( ) ; else mappingType = ROLE . toString ( ) ; Map < String , Object > options = extractOptions ( module ) ; MappingModuleEntry entry = new MappingModuleEntry ( codeName , options , mappingType ) ; mappingInfo . add ( entry ) ; applicationPolicy . setMappingInfo ( mappingType , mappingInfo ) ; String moduleName = module . get ( Constants . MODULE ) . asString ( ) ; <START_BUG> if ( ( moduleName != null ) && ( ( moduleName . length ( ) ) > 0 ) ) { <END_BUG> mappingInfo . setJBossModuleName ( moduleName ) ; } } return true ; } private boolean processIdentityTrust ( String securityDomain , ModelNode node , ApplicationPolicy applicationPolicy ) { } private boolean processAudit ( String securityDomain , ModelNode node , ApplicationPolicy applicationPolicy ) { } private boolean processACL ( String securityDomain , ModelNode node , ApplicationPolicy applicationPolicy ) { } private boolean processJASPIAuth ( String securityDomain , ModelNode node , ApplicationPolicy applicationPolicy ) { } private String extractCode ( ModelNode node , Map < String , String > substitutions ) { } private ModelNode peek ( ModelNode node , String ... args ) { } private boolean processClassicAuth ( String securityDomain , ModelNode node , ApplicationPolicy applicationPolicy ) { } private interface LoginModuleContainer { void addAppConfigurationEntry ( AppConfigurationEntry entry ) { } } private void processLoginModules ( ModelNode node , BaseAuthenticationInfo authInfo , SecurityDomainAdd . LoginModuleContainer container ) { } private Map < String , Object > extractOptions ( ModelNode module ) { } private JSSESecurityDomain createJSSESecurityDomain ( OperationContext context , String securityDomain , ModelNode node ) { } private interface KeyStoreConfig { void setKeyStorePassword ( String value ) throws Exception { } void setKeyStoreType ( String value ) { } void setKeyStoreURL ( String value ) throws IOException { } void setKeyStoreProvider ( String value ) { } void setKeyStoreProviderArgument ( String value ) { } } private void processKeyStore ( OperationContext context , ModelNode node , String name , SecurityDomainAdd . KeyStoreConfig config ) { } private interface KeyManagerConfig { void setKeyManagerFactoryAlgorithm ( String value ) { } void setKeyManagerFactoryProvider ( String value ) { } } private void processKeyManager ( ModelNode node , String name , SecurityDomainAdd . KeyManagerConfig config ) { } private AppConfigurationEntry . LoginModuleControlFlag getControlFlag ( String flag ) { } static String getAuthenticationCacheType ( ModelNode node ) { } }

Fix:
if ( ( module . hasDefined ( Constants . MODULE ) ) && ( ( moduleName . length ( ) ) > 0 ) ) {