Buggy code:
public void completeStep ( ResultHandler resultHandler ) { } public void stepCompleted ( ) { } public ModelNode getFailureDescription ( ) { } public boolean hasFailureDescription ( ) { } public ModelNode getResponseHeaders ( ) { } @ Override public ProcessType getProcessType ( ) { } @ Override public RunningMode getRunningMode ( ) { } public boolean isBooting ( ) { } public boolean isRollbackOnly ( ) { } public void setRollbackOnly ( ) { } public boolean isRollbackOnRuntimeFailure ( ) { } public boolean isResourceServiceRestartAllowed ( ) { } public void reloadRequired ( ) { } public boolean isReloadRequired ( ) { } public void restartRequired ( ) { } public void revertReloadRequired ( ) { } public void revertRestartRequired ( ) { } public void runtimeUpdateSkipped ( ) { } public ImmutableManagementResourceRegistration getResourceRegistration ( ) { } public ManagementResourceRegistration getResourceRegistrationForUpdate ( ) { } @ Override public ImmutableManagementResourceRegistration getRootResourceRegistration ( ) { } public ServiceRegistry getServiceRegistry ( boolean modify ) throws UnsupportedOperationException { } public ServiceController < ? > removeService ( ServiceName name ) throws UnsupportedOperationException { } public void removeService ( ServiceController < ? > controller ) throws UnsupportedOperationException { } public ServiceTarget getServiceTarget ( ) throws UnsupportedOperationException { } public ModelNode readModel ( PathAddress address ) { } public ModelNode readModelForUpdate ( PathAddress address ) { } public void acquireControllerLock ( ) { } public Resource createResource ( PathAddress relativeAddress ) { } public void addResource ( PathAddress relativeAddress , Resource toAdd ) { } public Resource readResource ( PathAddress address ) { } @ Override public Resource readResource ( PathAddress relativeAddress , boolean recursive ) { } @ Override public Resource readResourceFromRoot ( PathAddress address ) { } @ Override public Resource readResourceFromRoot ( PathAddress address , boolean recursive ) { } public Resource readResourceForUpdate ( PathAddress address ) { } public Resource removeResource ( PathAddress address ) throws UnsupportedOperationException { } public Resource getRootResource ( ) { } public Resource getOriginalRootResource ( ) { } public boolean isModelAffected ( ) { } public boolean isResourceRegistryAffected ( ) { } public boolean isRuntimeAffected ( ) { } public OperationContext . Stage getCurrentStage ( ) { } public void report ( MessageSeverity severity , String message ) { } public boolean markResourceRestarted ( PathAddress resource , Object owner ) { } public boolean revertResourceRestarted ( PathAddress resource , Object owner ) { } public ModelNode resolveExpressions ( ModelNode node ) { } @ Override public < V > V getAttachment ( final AttachmentKey < V > key ) { } @ Override public < V > V attach ( final AttachmentKey < V > key , final V value ) { } @ Override public < V > V attachIfAbsent ( final AttachmentKey < V > key , final V value ) { } @ Override public < V > V detach ( final AttachmentKey < V > key ) { } @ Override public AuthorizationResult authorize ( ModelNode operation ) { } @ Override public AuthorizationResult authorize ( ModelNode operation , Set < Action . ActionEffect > effects ) { } @ Override public AuthorizationResult authorize ( ModelNode operation , String attribute , ModelNode currentValue ) { } @ Override public AuthorizationResult authorize ( ModelNode operation , String attribute , ModelNode currentValue , Set < Action . ActionEffect > effects ) { } @ Override public boolean isNormalServer ( ) { } @ Override public AuthorizationResult authorizeOperation ( ModelNode operation ) { } @ Override public ResourceAuthorization authorizeResource ( boolean attributes , boolean isDefaultResource ) { } @ Override public Caller getCaller ( ) { } @ Override public Environment getCallEnvironment ( ) { } } Resource createRootResource ( ) { final Resource rootResource = Factory . create ( ) ; <START_BUG> CoreManagementResourceDefinition . registerDomainResource ( rootResource ) ; <END_BUG> final Resource host = Factory . create ( ) ; final Resource serverOneConfig = Factory . create ( ) ; final ModelNode serverOneModel = new ModelNode ( ) ; serverOneModel . get ( GROUP ) . set ( "group-one" ) ; serverOneModel . get ( SOCKET_BINDING_GROUP ) . set ( "binding-one" ) ; serverOneConfig . writeModel ( serverOneModel ) ; host . registerChild ( PathElement . pathElement ( SERVER_CONFIG , "server-one" ) , serverOneConfig ) ; final Resource serverTwoConfig = Factory . create ( ) ; final ModelNode serverTwoModel = new ModelNode ( ) ; serverTwoModel . get ( GROUP ) . set ( "group-one" ) ; serverTwoConfig . writeModel ( serverTwoModel ) ; host . registerChild ( PathElement . pathElement ( SERVER_CONFIG , "server-two" ) , serverTwoConfig ) ; final Resource serverThreeConfig = Factory . create ( ) ; final ModelNode serverThreeModel = new ModelNode ( ) ; serverThreeModel . get ( GROUP ) . set ( "group-two" ) ; serverThreeConfig . writeModel ( serverThreeModel ) ; host . registerChild ( PathElement . pathElement ( SERVER_CONFIG , "server-three" ) , serverThreeConfig ) ; rootResource . registerChild ( PathElement . pathElement ( HOST , "localhost" ) , host ) ; final Resource serverGroup1 = Factory . create ( ) ; serverGroup1 . getModel ( ) . get ( PROFILE ) . set ( "profile-one" ) ; serverGroup1 . getModel ( ) . get ( SOCKET_BINDING_GROUP ) . set ( "binding-one" ) ; rootResource . registerChild ( PathElement . pathElement ( SERVER_GROUP , "group-one" ) , serverGroup1 ) ; final Resource serverGroup2 = Factory . create ( ) ; serverGroup2 . getModel ( ) . get ( PROFILE ) . set ( "profile-2" ) ; serverGroup2 . getModel ( ) . get ( SOCKET_BINDING_GROUP ) . set ( "binding-two" ) ; rootResource . registerChild ( PathElement . pathElement ( SERVER_GROUP , "group-two" ) , serverGroup2 ) ; final Resource profile1 = Factory . create ( ) ; profile1 . getModel ( ) . setEmptyObject ( ) ; rootResource . registerChild ( PathElement . pathElement ( PROFILE , "profile-one" ) , profile1 ) ; final Resource profile2 = Factory . create ( ) ;

Fix:
CoreManagementResourceDefinition . registerDomainResource ( rootResource , null ) ;