Buggy code:
public class ServerControllerModelUtil { public static ModelNode createCoreModel ( ) { } public static void updateCoreModel ( final ModelNode root ) { } public static void initOperations ( final ManagementResourceRegistration root , final ContentRepository contentRepository , final ExtensibleConfigurationPersister extensibleConfigurationPersister , final ServerEnvironment serverEnvironment , final ControlledProcessState processState ) { root . registerReadWriteAttribute ( NAME , null , new StringLengthValidatingHandler ( 1 ) , CONFIGURATION ) ; root . registerOperationHandler ( READ_RESOURCE_OPERATION , READ_RESOURCE , READ_RESOURCE_PROVIDER , true ) ; root . registerOperationHandler ( READ_ATTRIBUTE_OPERATION , READ_ATTRIBUTE , READ_ATTRIBUTE_PROVIDER , true ) ; root . registerOperationHandler ( READ_RESOURCE_DESCRIPTION_OPERATION , READ_RESOURCE_DESCRIPTION , READ_RESOURCE_DESCRIPTION_PROVIDER , true ) ; root . registerOperationHandler ( READ_CHILDREN_NAMES_OPERATION , READ_CHILDREN_NAMES , READ_CHILDREN_NAMES_PROVIDER , true ) ; root . registerOperationHandler ( READ_CHILDREN_TYPES_OPERATION , READ_CHILDREN_TYPES , READ_CHILDREN_TYPES_PROVIDER , true ) ; root . registerOperationHandler ( READ_CHILDREN_RESOURCES_OPERATION , READ_CHILDREN_RESOURCES , READ_CHILDREN_RESOURCES_PROVIDER , true ) ; root . registerOperationHandler ( READ_OPERATION_NAMES_OPERATION , READ_OPERATION_NAMES , READ_OPERATION_NAMES_PROVIDER , true ) ; root . registerOperationHandler ( READ_OPERATION_DESCRIPTION_OPERATION , READ_OPERATION_DESCRIPTION , READ_OPERATION_PROVIDER , true ) ; root . registerOperationHandler ( WRITE_ATTRIBUTE_OPERATION , WRITE_ATTRIBUTE , WRITE_ATTRIBUTE_PROVIDER , true ) ; root . registerOperationHandler ( VALIDATE_ADDRESS_OPERATION_NAME , VALIDATE_ADDRESS , VALIDATE_ADDRESS_PROVIDER , true ) ; root . registerOperationHandler ( CompositeOperationHandler . NAME , INSTANCE , INSTANCE , false , PRIVATE ) ; XmlMarshallingHandler xmh = new XmlMarshallingHandler ( extensibleConfigurationPersister ) ; root . registerOperationHandler ( OPERATION_NAME , xmh , xmh , false ) ; 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 ( contentRepository ) ; root . registerOperationHandler ( DeploymentUploadBytesHandler . OPERATION_NAME , dubh , dubh , false ) ; DeploymentUploadURLHandler duuh = new DeploymentUploadURLHandler ( contentRepository ) ; root . registerOperationHandler ( DeploymentUploadURLHandler . OPERATION_NAME , duuh , duuh , false ) ; DeploymentUploadStreamAttachmentHandler dush = new DeploymentUploadStreamAttachmentHandler ( contentRepository ) ; root . registerOperationHandler ( DeploymentUploadStreamAttachmentHandler . OPERATION_NAME , dush , dush , false ) ; final DeploymentReplaceHandler drh = new DeploymentReplaceHandler ( contentRepository ) ; root . registerOperationHandler ( DeploymentReplaceHandler . OPERATION_NAME , drh , drh , false ) ; DeploymentFullReplaceHandler dfrh = new DeploymentFullReplaceHandler ( contentRepository ) ; root . registerOperationHandler ( DeploymentFullReplaceHandler . OPERATION_NAME , dfrh , dfrh , false ) ; SnapshotDeleteHandler snapshotDelete = new SnapshotDeleteHandler ( extensibleConfigurationPersister ) ; root . registerOperationHandler ( SnapshotDeleteHandler . OPERATION_NAME , snapshotDelete , snapshotDelete , false ) ; SnapshotListHandler snapshotList = new SnapshotListHandler ( extensibleConfigurationPersister ) ; root . registerOperationHandler ( SnapshotListHandler . OPERATION_NAME , snapshotList , snapshotList , false ) ; SnapshotTakeHandler snapshotTake = new SnapshotTakeHandler ( extensibleConfigurationPersister ) ; root . registerOperationHandler ( SnapshotTakeHandler . OPERATION_NAME , snapshotTake , snapshotTake , false ) ; root . registerReadOnlyAttribute ( SERVER_STATE , new org . jboss . as . server . operations . ServerStateAttributeHandler ( processState ) , RUNTIME ) ; root . registerReadOnlyAttribute ( PROCESS_TYPE , ProcessTypeHandler . INSTANCE , RUNTIME ) ; if ( serverEnvironment != null ) { if ( ( serverEnvironment . getLaunchType ( ) ) != ( LaunchType . DOMAIN ) ) root . registerOperationHandler ( ServerReloadHandler . OPERATION_NAME , ServerReloadHandler . INSTANCE , ServerReloadHandler . INSTANCE , false ) ; <START_BUG> if ( ( serverEnvironment . getLaunchType ( ) ) == ( LaunchType . STANADALONE ) ) <END_BUG> root . registerOperationHandler ( ServerShutdownHandler . OPERATION_NAME , ServerShutdownHandler . INSTANCE , ServerShutdownHandler . INSTANCE , false ) ; root . registerReadOnlyAttribute ( LAUNCH_TYPE , new org . jboss . as . server . operations . LaunchTypeHandler ( serverEnvironment . getLaunchType ( ) ) , RUNTIME ) ; } ManagementResourceRegistration sysProps = root . registerSubModel ( PathElement . pathElement ( SYSTEM_PROPERTY ) , SYSTEM_PROPERTIES_PROVIDER ) ; sysProps . registerOperationHandler ( SystemPropertyAddHandler . OPERATION_NAME , INSTANCE_WITHOUT_BOOTTIME , INSTANCE_WITHOUT_BOOTTIME , false ) ; sysProps . registerOperationHandler ( SystemPropertyRemoveHandler . OPERATION_NAME , SystemPropertyRemoveHandler . INSTANCE , SystemPropertyRemoveHandler . INSTANCE , false ) ; sysProps . registerReadWriteAttribute ( VALUE , null , SystemPropertyValueWriteAttributeHandler . INSTANCE , CONFIGURATION ) ; ManagementResourceRegistration management = root . registerSubModel ( PathElement . pathElement ( CORE_SERVICE , MANAGEMENT ) , MANAGEMENT_WITH_INTERFACES_PROVIDER ) ; ManagementResourceRegistration securityRealm = management . registerSubModel ( PathElement . pathElement ( SECURITY_REALM ) , MANAGEMENT_SECURITY_REALM_PROVIDER ) ; securityRealm . registerOperationHandler ( SecurityRealmAddHandler . OPERATION_NAME , SecurityRealmAddHandler . INSTANCE , SecurityRealmAddHandler . INSTANCE , false ) ; ManagementResourceRegistration connection = management . registerSubModel ( PathElement . pathElement ( OUTBOUND_CONNECTION ) , MANAGEMENT_OUTBOUND_CONNECTION_PROVIDER ) ; connection . registerOperationHandler ( ConnectionAddHandler . OPERATION_NAME , ConnectionAddHandler . INSTANCE , ConnectionAddHandler . INSTANCE , false ) ; ManagementResourceRegistration managementNative = management . registerSubModel ( PathElement . pathElement ( MANAGEMENT_INTERFACE , NATIVE_INTERFACE ) , NATIVE_MANAGEMENT_PROVIDER ) ; managementNative . registerOperationHandler ( NativeManagementAddHandler . OPERATION_NAME , NativeManagementAddHandler . INSTANCE , NativeManagementAddHandler . INSTANCE , false ) ; managementNative . registerReadWriteAttribute ( SECURITY_REALM , null , NativeManagementAttributeHandlers . INSTANCE , Storage . CONFIGURATION ) ; ManagementResourceRegistration managementHttp = management . registerSubModel ( PathElement . pathElement ( MANAGEMENT_INTERFACE , HTTP_INTERFACE ) , HTTP_MANAGEMENT_PROVIDER ) ; managementHttp . registerOperationHandler ( HttpManagementAddHandler . OPERATION_NAME , HttpManagementAddHandler . INSTANCE , HttpManagementAddHandler . INSTANCE , false ) ; managementHttp . registerReadWriteAttribute ( SECURITY_REALM , null , HttpManagementAttributeHandlers . INSTANCE , Storage . CONFIGURATION ) ; ManagementResourceRegistration serviceContainer = root . registerSubModel ( PathElement . pathElement ( CORE_SERVICE , SERVICE_CONTAINER ) , SERVICE_CONTAINER_PROVIDER ) ; serviceContainer . registerOperationHandler ( DumpServicesHandler . OPERATION_NAME , DumpServicesHandler . INSTANCE , DumpServicesHandler . INSTANCE , false ) ; ManagementResourceRegistration paths = root . registerSubModel ( PathElement . pathElement ( PATH ) , SPECIFIED_PATH_PROVIDER ) ; paths . registerOperationHandler ( SpecifiedPathAddHandler . OPERATION_NAME , SpecifiedPathAddHandler . INSTANCE , SpecifiedPathAddHandler . INSTANCE , false ) ;

Fix:
if ( ( serverEnvironment . getLaunchType ( ) ) == ( LaunchType . STANDALONE ) )