Buggy code:
public class RaOperationUtil { private static final String RAR_EXTENSION = ".rar" ; private static final ServiceName RAR_MODULE = ServiceName . of ( "rarinsidemodule" ) ; public static ModifiableResourceAdapter buildResourceAdaptersObject ( final OperationContext context , ModelNode operation , String archiveOrModule ) throws OperationFailedException { } public static ModifiableConnDef buildConnectionDefinitionObject ( final OperationContext context , final ModelNode recoveryEnvModel , final String poolName , final boolean isXa ) throws OperationFailedException , ValidateException { Map < String , String > configProperties = new HashMap < String , String > ( 0 ) ; String className = ModelNodeUtil . getResolvedStringIfSetOrGetDefault ( context , recoveryEnvModel , Constants . CLASS_NAME ) ; String jndiName = ModelNodeUtil . getResolvedStringIfSetOrGetDefault ( context , recoveryEnvModel , Constants . JNDINAME ) ; boolean enabled = ModelNodeUtil . getBooleanIfSetOrGetDefault ( context , recoveryEnvModel , Constants . ENABLED ) ; boolean useJavaContext = ModelNodeUtil . getBooleanIfSetOrGetDefault ( context , recoveryEnvModel , Constants . USE_JAVA_CONTEXT ) ; boolean useCcm = ModelNodeUtil . getBooleanIfSetOrGetDefault ( context , recoveryEnvModel , Constants . USE_CCM ) ; int maxPoolSize = ModelNodeUtil . getIntIfSetOrGetDefault ( context , recoveryEnvModel , MAX_POOL_SIZE ) ; int minPoolSize = ModelNodeUtil . getIntIfSetOrGetDefault ( context , recoveryEnvModel , MIN_POOL_SIZE ) ; boolean prefill = ModelNodeUtil . getBooleanIfSetOrGetDefault ( context , recoveryEnvModel , POOL_PREFILL ) ; boolean useStrictMin = ModelNodeUtil . getBooleanIfSetOrGetDefault ( context , recoveryEnvModel , POOL_USE_STRICT_MIN ) ; String flushStrategyString = POOL_FLUSH_STRATEGY . resolveModelAttribute ( context , recoveryEnvModel ) . asString ( ) ; final FlushStrategy flushStrategy = FlushStrategy . forName ( flushStrategyString ) ; Boolean isSameRM = ModelNodeUtil . getBooleanIfSetOrGetDefault ( context , recoveryEnvModel , Constants . SAME_RM_OVERRIDE ) ; boolean interlivng = ModelNodeUtil . getBooleanIfSetOrGetDefault ( context , recoveryEnvModel , Constants . INTERLEAVING ) ; boolean padXid = ModelNodeUtil . getBooleanIfSetOrGetDefault ( context , recoveryEnvModel , Constants . PAD_XID ) ; boolean wrapXaResource = ModelNodeUtil . getBooleanIfSetOrGetDefault ( context , recoveryEnvModel , Constants . WRAP_XA_RESOURCE ) ; boolean noTxSeparatePool = ModelNodeUtil . getBooleanIfSetOrGetDefault ( context , recoveryEnvModel , Constants . NOTXSEPARATEPOOL ) ; Integer allocationRetry = ModelNodeUtil . getIntIfSetOrGetDefault ( context , recoveryEnvModel , Constants . ALLOCATION_RETRY ) ; Long allocationRetryWaitMillis = ModelNodeUtil . getLongIfSetOrGetDefault ( context , recoveryEnvModel , Constants . ALLOCATION_RETRY_WAIT_MILLIS ) ; Long blockingTimeoutMillis = ModelNodeUtil . getLongIfSetOrGetDefault ( context , recoveryEnvModel , BLOCKING_TIMEOUT_WAIT_MILLIS ) ; Long idleTimeoutMinutes = ModelNodeUtil . getLongIfSetOrGetDefault ( context , recoveryEnvModel , IDLETIMEOUTMINUTES ) ; Integer xaResourceTimeout = ModelNodeUtil . getIntIfSetOrGetDefault ( context , recoveryEnvModel , Constants . XA_RESOURCE_TIMEOUT ) ; CommonTimeOut timeOut = new CommonTimeOutImpl ( blockingTimeoutMillis , idleTimeoutMinutes , allocationRetry , allocationRetryWaitMillis , xaResourceTimeout ) ; CommonPool pool ; if ( isXa ) { pool = new org . jboss . jca . common . metadata . common . CommonXaPoolImpl ( minPoolSize , maxPoolSize , prefill , useStrictMin , flushStrategy , isSameRM , interlivng , padXid , wrapXaResource , noTxSeparatePool ) ; } else { pool = new org . jboss . jca . common . metadata . common . CommonPoolImpl ( minPoolSize , maxPoolSize , prefill , useStrictMin , flushStrategy ) ; } String securityDomain = ModelNodeUtil . getResolvedStringIfSetOrGetDefault ( context , recoveryEnvModel , Constants . SECURITY_DOMAIN ) ; String securityDomainAndApplication = ModelNodeUtil . getResolvedStringIfSetOrGetDefault ( context , recoveryEnvModel , Constants . SECURITY_DOMAIN_AND_APPLICATION ) ; boolean application = ModelNodeUtil . getBooleanIfSetOrGetDefault ( context , recoveryEnvModel , Constants . APPLICATION ) ; CommonSecurity security = null ; <START_BUG> if ( ( securityDomain != null ) || ( securityDomainAndApplication != null ) ) { <END_BUG> security = new CommonSecurityImpl ( securityDomain , securityDomainAndApplication , application ) ; } Long backgroundValidationMillis = ModelNodeUtil . getLongIfSetOrGetDefault ( context , recoveryEnvModel , BACKGROUNDVALIDATIONMILLIS ) ; boolean backgroundValidation = ModelNodeUtil . getBooleanIfSetOrGetDefault ( context , recoveryEnvModel , BACKGROUNDVALIDATION ) ; boolean useFastFail = ModelNodeUtil . getBooleanIfSetOrGetDefault ( context , recoveryEnvModel , USE_FAST_FAIL ) ; CommonValidation validation = new CommonValidationImpl ( backgroundValidation , backgroundValidationMillis , useFastFail ) ; final String recoveryUsername = ModelNodeUtil . getResolvedStringIfSetOrGetDefault ( context , recoveryEnvModel , Constants . RECOVERY_USERNAME ) ; final String recoveryPassword = ModelNodeUtil . getResolvedStringIfSetOrGetDefault ( context , recoveryEnvModel , Constants . RECOVERY_PASSWORD ) ; final String recoverySecurityDomain = ModelNodeUtil . getResolvedStringIfSetOrGetDefault ( context , recoveryEnvModel , Constants . RECOVERY_SECURITY_DOMAIN ) ; boolean noRecovery = ModelNodeUtil . getBooleanIfSetOrGetDefault ( context , recoveryEnvModel , Constants . NO_RECOVERY ) ; Recovery recovery = null ; if ( ( ( recoveryUsername != null ) && ( recoveryPassword != null ) ) || ( recoverySecurityDomain != null ) ) { Credential credential = null ; credential = new CredentialImpl ( recoveryUsername , recoveryPassword , recoverySecurityDomain ) ; Extension recoverPlugin = ModelNodeUtil . extractExtension ( context , recoveryEnvModel , Constants . RECOVERLUGIN_CLASSNAME , Constants . RECOVERLUGIN_PROPERTIES ) ; recovery = new Recovery ( credential , recoverPlugin , noRecovery ) ; } ModifiableConnDef connectionDefinition = new ModifiableConnDef ( configProperties , className , jndiName , poolName , enabled , useJavaContext , useCcm , pool , timeOut , validation , security , recovery ) ; return connectionDefinition ; } public static ModifiableAdminObject buildAdminObjects ( final OperationContext context , ModelNode operation , final String poolName ) throws OperationFailedException , ValidateException { } public static ServiceName restartIfPresent ( OperationContext context , final String raName , ServiceVerificationHandler svh ) throws OperationFailedException { } public static boolean removeIfActive ( OperationContext context , String raName ) throws OperationFailedException { } public static void activate ( OperationContext context , String raName , final ServiceVerificationHandler serviceVerificationHandler ) throws OperationFailedException { } public static ServiceName installRaServices ( OperationContext context , ServiceVerificationHandler verificationHandler , String name , ModifiableResourceAdapter resourceAdapter , final List < ServiceController < ? > > newControllers ) { } public static void installRaServicesAndDeployFromModule ( OperationContext context , ServiceVerificationHandler verificationHandler , String name , ModifiableResourceAdapter resourceAdapter , String fullModuleName , final List < ServiceController < ? > > newControllers ) throws OperationFailedException { } }

Fix:
if ( ( ( securityDomain != null ) || ( securityDomainAndApplication != null ) ) || application ) {