Buggy code:
public static final SimpleAttributeDefinition MANAGEMENT_MICRO_VERSION = org . jboss . as . controller . SimpleAttributeDefinitionBuilder . create ( ModelDescriptionConstants . MANAGEMENT_MICRO_VERSION , ModelType . INT , false ) . setValidator ( new org . jboss . as . controller . operations . validation . IntRangeValidator ( 0 ) ) . build ( ) ; public static final SimpleAttributeDefinition PROFILE_NAME = org . jboss . as . controller . SimpleAttributeDefinitionBuilder . create ( ModelDescriptionConstants . PROFILE_NAME , ModelType . STRING , false ) . setValidator ( ServerRootResourceDefinition . NOT_NULL_STRING_LENGTH_ONE_VALIDATOR ) . build ( ) ; public static final SimpleAttributeDefinition NULL_PROFILE_NAME = org . jboss . as . controller . SimpleAttributeDefinitionBuilder . create ( ModelDescriptionConstants . PROFILE_NAME , ModelType . STRING , true ) . build ( ) ; public static final SimpleAttributeDefinition SERVER_STATE = org . jboss . as . controller . SimpleAttributeDefinitionBuilder . create ( ServerDescriptionConstants . PROCESS_STATE , ModelType . STRING ) . setStorageRuntime ( ) . setValidator ( ServerRootResourceDefinition . NOT_NULL_STRING_LENGTH_ONE_VALIDATOR ) . build ( ) ; public static final SimpleAttributeDefinition PROCESS_TYPE = org . jboss . as . controller . SimpleAttributeDefinitionBuilder . create ( ServerDescriptionConstants . PROCESS_TYPE , ModelType . STRING ) . setStorageRuntime ( ) . setValidator ( ServerRootResourceDefinition . NOT_NULL_STRING_LENGTH_ONE_VALIDATOR ) . build ( ) ; public static final SimpleAttributeDefinition LAUNCH_TYPE = org . jboss . as . controller . SimpleAttributeDefinitionBuilder . create ( ServerDescriptionConstants . LAUNCH_TYPE , ModelType . STRING ) . setValidator ( new org . jboss . as . controller . operations . validation . EnumValidator < LaunchType > ( LaunchType . class , false , false ) ) . setStorageRuntime ( ) . build ( ) ; private static final EnumSet < Flag > runtimeOnlyFlag = EnumSet . of ( RUNTIME_ONLY ) ; public static final AttributeDefinition RUNNING_MODE = org . jboss . as . controller . SimpleAttributeDefinitionBuilder . create ( ModelDescriptionConstants . RUNNING_MODE , ModelType . STRING ) . setValidator ( new org . jboss . as . controller . operations . validation . EnumValidator ( org . jboss . as . controller . RunningMode . class , false , false ) ) . setStorageRuntime ( ) . build ( ) ; private final boolean isDomain ; private final ContentRepository contentRepository ; private final ExtensibleConfigurationPersister extensibleConfigurationPersister ; private final ServerEnvironment serverEnvironment ; private final ControlledProcessState processState ; private final RunningModeControl runningModeControl ; private final AbstractVaultReader vaultReader ; private final ExtensionRegistry extensionRegistry ; private final boolean parallelBoot ; private final PathManagerService pathManager ; public ServerRootResourceDefinition ( final ContentRepository contentRepository , final ExtensibleConfigurationPersister extensibleConfigurationPersister , final ServerEnvironment serverEnvironment , final ControlledProcessState processState , final RunningModeControl runningModeControl , final AbstractVaultReader vaultReader , final ExtensionRegistry extensionRegistry , final boolean parallelBoot , final PathManagerService pathManager ) { } @ Override public void registerOperations ( ManagementResourceRegistration resourceRegistration ) { GlobalOperationHandlers . registerGlobalOperations ( resourceRegistration , STANDALONE_SERVER ) ; if ( ( serverEnvironment ) != null ) { resourceRegistration . registerOperationHandler ( DEFINITION , INSTANCE ) ; } else { resourceRegistration . registerOperationHandler ( DEFINITION , INSTANCE ) ; } resourceRegistration . registerOperationHandler ( CompositeOperationHandler . NAME , CompositeOperationHandler . INSTANCE , CompositeOperationHandler . INSTANCE , false , PRIVATE ) ; XmlMarshallingHandler xmh = new XmlMarshallingHandler ( extensibleConfigurationPersister ) ; resourceRegistration . registerOperationHandler ( XmlMarshallingHandler . DEFINITION , xmh ) ; resourceRegistration . registerOperationHandler ( NamespaceAddHandler . DEFINITION , NamespaceAddHandler . INSTANCE ) ; resourceRegistration . registerOperationHandler ( NamespaceRemoveHandler . DEFINITION , NamespaceRemoveHandler . INSTANCE ) ; resourceRegistration . registerOperationHandler ( SchemaLocationAddHandler . DEFINITION , SchemaLocationAddHandler . INSTANCE ) ; resourceRegistration . registerOperationHandler ( SchemaLocationRemoveHandler . DEFINITION , SchemaLocationRemoveHandler . INSTANCE ) ; resourceRegistration . registerOperationHandler ( OPERATION_NAME , ValidateAddressOperationHandler . INSTANCE , ValidateAddressOperationHandler . INSTANCE , false , EnumSet . of ( READ_ONLY ) ) ; DeploymentUploadBytesHandler . register ( resourceRegistration , contentRepository ) ; DeploymentUploadURLHandler . register ( resourceRegistration , contentRepository ) ; DeploymentUploadStreamAttachmentHandler . register ( resourceRegistration , contentRepository ) ; resourceRegistration . registerOperationHandler ( REPLACE_DEPLOYMENT_DEFINITION , DeploymentReplaceHandler . create ( contentRepository , vaultReader ) ) ; resourceRegistration . registerOperationHandler ( FULL_REPLACE_DEPLOYMENT_DEFINITION , DeploymentFullReplaceHandler . create ( contentRepository , vaultReader ) ) ; if ( ! ( isDomain ) ) { SnapshotDeleteHandler snapshotDelete = new SnapshotDeleteHandler ( extensibleConfigurationPersister ) ; resourceRegistration . registerOperationHandler ( SnapshotDeleteHandler . DEFINITION , snapshotDelete ) ; SnapshotListHandler snapshotList = new SnapshotListHandler ( extensibleConfigurationPersister ) ; resourceRegistration . registerOperationHandler ( SnapshotListHandler . DEFINITION , snapshotList ) ; SnapshotTakeHandler snapshotTake = new SnapshotTakeHandler ( extensibleConfigurationPersister ) ; resourceRegistration . registerOperationHandler ( SnapshotTakeHandler . DEFINITION , snapshotTake ) ; } resourceRegistration . registerOperationHandler ( ServerRestartRequiredHandler . DEFINITION , ServerRestartRequiredHandler . INSTANCE ) ; resourceRegistration . registerOperationHandler ( ResolveExpressionHandler . OPERATION_NAME , ResolveExpressionHandler . INSTANCE , ResolveExpressionHandler . INSTANCE , EnumSet . of ( READ_ONLY , OperationEntry . Flag . RUNTIME_ONLY ) ) ; resourceRegistration . registerOperationHandler ( SpecifiedInterfaceResolveHandler . DEFINITION , SpecifiedInterfaceResolveHandler . INSTANCE ) ; <START_BUG> resourceRegistration . registerOperationHandler ( WhoAmIOperation . OPERATION_NAME , WhoAmIOperation . INSTANCE , WhoAmIOperation . INSTANCE , true ) ; <END_BUG> resourceRegistration . registerOperationHandler ( RootResourceHack . NAME , RootResourceHack . INSTANCE , RootResourceHack . INSTANCE , false , OperationEntry . EntryType . PRIVATE , ServerRootResourceDefinition . runtimeOnlyFlag ) ; if ( ( serverEnvironment ) != null ) { if ( ( serverEnvironment . getLaunchType ( ) ) != ( LaunchType . DOMAIN ) ) { ServerProcessReloadHandler reloadHandler = new ServerProcessReloadHandler ( Services . JBOSS_AS , runningModeControl , processState , ServerDescriptions . getResourceDescriptionResolver ( "server" ) ) ; resourceRegistration . registerOperationHandler ( ProcessReloadHandler . OPERATION_NAME , reloadHandler , reloadHandler ) ; } if ( ( serverEnvironment . getLaunchType ( ) ) == ( LaunchType . STANDALONE ) ) { ServerShutdownHandler serverShutdownHandler = new ServerShutdownHandler ( processState ) ; resourceRegistration . registerOperationHandler ( ServerShutdownHandler . DEFINITION , serverShutdownHandler ) ; } resourceRegistration . registerSubModel ( ServerEnvironmentResourceDescription . of ( serverEnvironment ) ) ; } } @ Override public void registerAttributes ( ManagementResourceRegistration resourceRegistration ) { } }

Fix:
resourceRegistration . registerOperationHandler ( WhoAmIOperation . DEFINITION , WhoAmIOperation . INSTANCE , true ) ;