Buggy code:
public class DomainModelUtil { public static void updateCoreModel ( final ModelNode rootModel ) { } public static ExtensionContext initializeMasterDomainRegistry ( final ManagementResourceRegistration root , final ExtensibleConfigurationPersister configurationPersister , final ContentRepository contentRepository , final FileRepository fileRepository , final DomainController domainController , final UnregisteredHostChannelRegistry registry ) { } public static ExtensionContext initializeSlaveDomainRegistry ( final ManagementResourceRegistration root , final ExtensibleConfigurationPersister configurationPersister , final FileRepository fileRepository ) { } private static ExtensionContext initializeDomainRegistry ( final ManagementResourceRegistration root , final ExtensibleConfigurationPersister configurationPersister , final ContentRepository contentRepo , final FileRepository fileRepository , final boolean isMaster , final DomainController domainController , final UnregisteredHostChannelRegistry registry ) { EnumSet < OperationEntry . Flag > readOnly = EnumSet . of ( READ_ONLY ) ; EnumSet < OperationEntry . Flag > deploymentUpload = EnumSet . of ( DEPLOYMENT_UPLOAD ) ; root . registerOperationHandler ( NAME , INSTANCE , INSTANCE , false , PRIVATE ) ; XmlMarshallingHandler xmh = new XmlMarshallingHandler ( configurationPersister ) ; root . registerOperationHandler ( OPERATION_NAME , xmh , xmh , false , PUBLIC , readOnly ) ; root . registerOperationHandler ( NamespaceAddHandler . OPERATION_NAME , NamespaceAddHandler . INSTANCE , NamespaceAddHandler . INSTANCE , false ) ; root . registerOperationHandler ( NamespaceRemoveHandler . OPERATION_NAME , NamespaceRemoveHandler . INSTANCE , NamespaceRemoveHandler . INSTANCE , false ) ; root . registerOperationHandler ( SchemaLocationAddHandler . OPERATION_NAME , SchemaLocationAddHandler . INSTANCE , SchemaLocationAddHandler . INSTANCE , false ) ; root . registerOperationHandler ( SchemaLocationRemoveHandler . OPERATION_NAME , SchemaLocationRemoveHandler . INSTANCE , SchemaLocationRemoveHandler . INSTANCE , false ) ; DeploymentUploadBytesHandler dubh = new DeploymentUploadBytesHandler ( contentRepo ) ; root . registerOperationHandler ( DeploymentUploadBytesHandler . OPERATION_NAME , dubh , dubh , false , PUBLIC , deploymentUpload ) ; DeploymentUploadURLHandler duuh = new DeploymentUploadURLHandler ( contentRepo ) ; root . registerOperationHandler ( DeploymentUploadURLHandler . OPERATION_NAME , duuh , duuh , false , PUBLIC , deploymentUpload ) ; DeploymentUploadStreamAttachmentHandler dush = new DeploymentUploadStreamAttachmentHandler ( contentRepo ) ; root . registerOperationHandler ( DeploymentUploadStreamAttachmentHandler . OPERATION_NAME , dush , dush , false , PUBLIC , deploymentUpload ) ; <START_BUG> DeploymentFullReplaceHandler dfrh = new DeploymentFullReplaceHandler ( contentRepo ) ; <END_BUG> root . registerOperationHandler ( DeploymentFullReplaceHandler . OPERATION_NAME , dfrh , dfrh ) ; SnapshotDeleteHandler snapshotDelete = new SnapshotDeleteHandler ( configurationPersister ) ; root . registerOperationHandler ( SnapshotDeleteHandler . OPERATION_NAME , snapshotDelete , snapshotDelete , false ) ; SnapshotListHandler snapshotList = new SnapshotListHandler ( configurationPersister ) ; root . registerOperationHandler ( SnapshotListHandler . OPERATION_NAME , snapshotList , snapshotList , false ) ; SnapshotTakeHandler snapshotTake = new SnapshotTakeHandler ( configurationPersister ) ; root . registerOperationHandler ( SnapshotTakeHandler . OPERATION_NAME , snapshotTake , snapshotTake , false ) ; root . registerReadOnlyAttribute ( PROCESS_TYPE , ( isMaster ? ProcessTypeHandler . MASTER : ProcessTypeHandler . SLAVE ) , RUNTIME ) ; ManagementResourceRegistration systemProperties = root . registerSubModel ( PathElement . pathElement ( SYSTEM_PROPERTY ) , SYSTEM_PROPERTY_PROVIDER ) ; systemProperties . registerOperationHandler ( SystemPropertyAddHandler . OPERATION_NAME , INSTANCE_WITH_BOOTTIME , INSTANCE_WITH_BOOTTIME , false ) ; systemProperties . registerOperationHandler ( SystemPropertyRemoveHandler . OPERATION_NAME , SystemPropertyRemoveHandler . INSTANCE , SystemPropertyRemoveHandler . INSTANCE , false ) ; systemProperties . registerReadWriteAttribute ( VALUE , null , SystemPropertyValueWriteAttributeHandler . INSTANCE , CONFIGURATION ) ; systemProperties . registerReadWriteAttribute ( BOOT_TIME , null , new org . jboss . as . controller . operations . global . WriteAttributeHandlers . ModelTypeValidatingHandler ( ModelType . BOOLEAN ) , CONFIGURATION ) ; final ManagementResourceRegistration interfaces = root . registerSubModel ( PathElement . pathElement ( INTERFACE ) , NAMED_INTERFACE_PROVIDER ) ; interfaces . registerOperationHandler ( ADD , NAMED_INSTANCE , NAMED_INSTANCE , false ) ; interfaces . registerOperationHandler ( REMOVE , NAMED_INSTANCE , NAMED_INSTANCE , false ) ; final ManagementResourceRegistration profile = root . registerSubModel ( PathElement . pathElement ( PROFILE ) , DomainDescriptionProviders . PROFILE ) ; profile . registerOperationHandler ( ADD , ProfileAddHandler . INSTANCE , ProfileAddHandler . INSTANCE , false ) ; profile . registerOperationHandler ( REMOVE , ProfileRemoveHandler . INSTANCE , ProfileRemoveHandler . INSTANCE , false ) ; profile . registerOperationHandler ( DESCRIBE , ProfileDescribeHandler . INSTANCE , ProfileDescribeHandler . INSTANCE , false , PRIVATE , readOnly ) ; final ManagementResourceRegistration paths = root . registerSubModel ( PathElement . pathElement ( PATH ) , PATH_DESCRIPTION ) ; paths . registerOperationHandler ( ADD , PathAddHandler . NAMED_INSTANCE , PathAddHandler . NAMED_INSTANCE , false ) ; paths . registerOperationHandler ( REMOVE , PathRemoveHandler . INSTANCE , PathRemoveHandler . INSTANCE , false ) ; final ManagementResourceRegistration socketBindingGroup = root . registerSubModel ( PathElement . pathElement ( SOCKET_BINDING_GROUP ) , DomainDescriptionProviders . SOCKET_BINDING_GROUP ) ; socketBindingGroup . registerOperationHandler ( ADD , SocketBindingGroupAddHandler . INSTANCE , SocketBindingGroupAddHandler . INSTANCE , false ) ; socketBindingGroup . registerOperationHandler ( REMOVE , SocketBindingGroupRemoveHandler . INSTANCE , SocketBindingGroupRemoveHandler . INSTANCE , false ) ; socketBindingGroup . registerReadWriteAttribute ( PORT_OFFSET , null , new IntRangeValidatingHandler ( 0 , 65535 , true , true ) , CONFIGURATION ) ; socketBindingGroup . registerReadWriteAttribute ( DEFAULT_INTERFACE , null , new StringLengthValidatingHandler ( 1 , false , true ) , CONFIGURATION ) ; socketBindingGroup . registerReadWriteAttribute ( INCLUDES , null , new org . jboss . as . controller . operations . global . WriteAttributeHandlers . ListValidatatingHandler ( new StringLengthValidator ( 1 , false ) , true , 0 , Integer . MAX_VALUE ) , CONFIGURATION ) ; socketBindingGroup . registerOperationHandler ( SocketBindingGroupIncludeAddHandler . OPERATION_NAME , SocketBindingGroupIncludeAddHandler . INSTANCE , SocketBindingGroupIncludeAddHandler . INSTANCE ) ; socketBindingGroup . registerOperationHandler ( SocketBindingGroupIncludeRemoveHandler . OPERATION_NAME , SocketBindingGroupIncludeRemoveHandler . INSTANCE , SocketBindingGroupIncludeRemoveHandler . INSTANCE ) ; final ManagementResourceRegistration socketBindings = socketBindingGroup . registerSubModel ( PathElement . pathElement ( SOCKET_BINDING ) , DomainDescriptionProviders . SOCKET_BINDING ) ; socketBindings . registerOperationHandler ( ADD , SocketBindingAddHandler . INSTANCE , SocketBindingAddHandler . INSTANCE , false ) ; socketBindings . registerOperationHandler ( REMOVE , SocketBindingRemoveHandler . INSTANCE , SocketBindingRemoveHandler . INSTANCE , false ) ; socketBindings . registerReadWriteAttribute ( INTERFACE , null , new StringLengthValidatingHandler ( 1 , true , true ) , CONFIGURATION ) ; socketBindings . registerReadWriteAttribute ( PORT , null , new IntRangeValidatingHandler ( 0 , 65535 , false , true ) , CONFIGURATION ) ;

Fix:
DeploymentFullReplaceHandler dfrh = ( isMaster ) ? new DeploymentFullReplaceHandler ( contentRepo ) : new DeploymentFullReplaceHandler ( fileRepository ) ;