Buggy code:
final class WSEndpointMetrics implements OperationStepHandler { static final WSEndpointMetrics INSTANCE = new WSEndpointMetrics ( ) ; static final String [ ] ATTRIBUTES ; static final String MIN_PROCESSING_TIME = "min-processing-time" ; static final String MAX_PROCESSING_TIME = "max-processing-time" ; static final String AVERAGE_PROCESSING_TIME = "average-processing-time" ; static final String TOTAL_PROCESSING_TIME = "total-processing-time" ; static final String REQUEST_COUNT = "request-count" ; static final String RESPONSE_COUNT = "response-count" ; static final String FAULT_COUNT = "fault-count" ; private WSEndpointMetrics ( ) { } public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { } private ModelNode getEndpointMetricsFragment ( final ModelNode operation , final ServiceController < ? > controller ) throws OperationFailedException { final PathAddress address = PathAddress . pathAddress ( operation . require ( OP_ADDR ) ) ; String endpointId = null ; try { endpointId = URLDecoder . decode ( address . getLastElement ( ) . getValue ( ) , "UTF-8" ) ; } catch ( final UnsupportedEncodingException e ) { throw new RuntimeException ( e ) ; } final String metricName = operation . require ( NAME ) . asString ( ) ; final String webContext = endpointId . substring ( 0 , endpointId . indexOf ( ":" ) ) ; final String endpointName = endpointId . substring ( ( ( endpointId . indexOf ( ":" ) ) + 1 ) ) ; ObjectName endpointObjectName = null ; try { endpointObjectName = new ObjectName ( ( ( ( "jboss.ws:context=" + webContext ) + ",endpoint=" ) + endpointName ) ) ; } catch ( final MalformedObjectNameException e ) { throw new OperationFailedException ( new ModelNode ( ) . set ( e . getMessage ( ) ) ) ; } final EndpointRegistry registry = ( ( EndpointRegistry ) ( controller . getValue ( ) ) ) ; final Endpoint endpoint = registry . getEndpoint ( endpointObjectName ) ; final ModelNode result = new ModelNode ( ) ; if ( ( endpoint != null ) && ( ( endpoint . getEndpointMetrics ( ) ) != null ) ) { final EndpointMetrics endpointMetrics = endpoint . getEndpointMetrics ( ) ; if ( WSEndpointMetrics . MIN_PROCESSING_TIME . equals ( metricName ) ) { result . set ( String . valueOf ( endpointMetrics . getMinProcessingTime ( ) ) ) ; } else if ( WSEndpointMetrics . MAX_PROCESSING_TIME . equals ( metricName ) ) { result . set ( String . valueOf ( endpointMetrics . getMaxProcessingTime ( ) ) ) ; } else if ( WSEndpointMetrics . AVERAGE_PROCESSING_TIME . equals ( metricName ) ) { <START_BUG> result . set ( String . valueOf ( endpointMetrics . getTotalProcessingTime ( ) ) ) ; <END_BUG> } else if ( WSEndpointMetrics . TOTAL_PROCESSING_TIME . equals ( metricName ) ) { result . set ( String . valueOf ( endpointMetrics . getTotalProcessingTime ( ) ) ) ; } else if ( WSEndpointMetrics . REQUEST_COUNT . equals ( metricName ) ) { result . set ( String . valueOf ( endpointMetrics . getRequestCount ( ) ) ) ; } else if ( WSEndpointMetrics . RESPONSE_COUNT . equals ( metricName ) ) { result . set ( String . valueOf ( endpointMetrics . getResponseCount ( ) ) ) ; } else if ( WSEndpointMetrics . FAULT_COUNT . equals ( metricName ) ) { result . set ( String . valueOf ( endpointMetrics . getFaultCount ( ) ) ) ; } } else { result . set ( WSEndpointMetrics . getFallbackMessage ( ) ) ; } return result ; } private static String getFallbackMessage ( ) { } }

Fix:
result . set ( String . valueOf ( endpointMetrics . getAverageProcessingTime ( ) ) ) ;