Repository: micronaut-projects/micronaut-core
File: management/src/main/java/io/micronaut/management/endpoint/processors/AbstractEndpointRouteBuilder.java (Java)

Code before:
import io.micronaut.core.type.Argument;
import io.micronaut.core.util.StringUtils;
import io.micronaut.http.uri.UriTemplate;
import io.micronaut.inject.BeanDefinition;
import io.micronaut.inject.ExecutableMethod;
import io.micronaut.management.endpoint.EndpointDefaultConfiguration;
import io.micronaut.management.endpoint.annotation.Endpoint;
import io.micronaut.management.endpoint.annotation.Selector;
import io.micronaut.web.router.DefaultRouteBuilder;

import java.lang.annotation.Annotation;
import java.util.Map;
import java.util.Optional;
import java.util.concurrent.ConcurrentHashMap;
import java.util.regex.Pattern;

/**
 * Abstract {@link io.micronaut.web.router.RouteBuilder} implementation for {@link Endpoint} method processors.
 *
 * @author Graeme Rocher
 * @since 1.0
 */
@Internal
abstract class AbstractEndpointRouteBuilder extends DefaultRouteBuilder implements ExecutableMethodProcessor<Endpoint>, LifeCycle<AbstractEndpointRouteBuilder> {

    private static final Pattern ENDPOINT_ID_PATTERN = Pattern.compile("([^#?]*)");

    private Map<Class<?>, Optional<String>> endpointIds = new ConcurrentHashMap<>();

    private final ApplicationContext beanContext;

    private final EndpointDefaultConfiguration endpointDefaultConfiguration;

    /**
     * @param applicationContext           The application context
     * @param uriNamingStrategy            The URI naming strategy
     * @param conversionService            The conversion service
     * @param endpointDefaultConfiguration Endpoints default Configuration
     */
    AbstractEndpointRouteBuilder(ApplicationContext applicationContext,
                                 UriNamingStrategy uriNamingStrategy,
                                 ConversionService conversionService,
                                 EndpointDefaultConfiguration endpointDefaultConfiguration) {
        super(applicationContext, uriNamingStrategy, conversionService);
        this.beanContext = applicationContext;
        this.endpointDefaultConfiguration = endpointDefaultConfiguration;
    }

    /**
     * @return The class
     */

Review comment (suggestion):
I think this is too wide. 
```suggestion
    private static final Pattern ENDPOINT_ID_PATTERN = Pattern.compile("[\\w-]+");
```

Code after:
import io.micronaut.core.type.Argument;
import io.micronaut.core.util.StringUtils;
import io.micronaut.http.uri.UriTemplate;
import io.micronaut.inject.BeanDefinition;
import io.micronaut.inject.ExecutableMethod;
import io.micronaut.management.endpoint.EndpointDefaultConfiguration;
import io.micronaut.management.endpoint.annotation.Endpoint;
import io.micronaut.management.endpoint.annotation.Selector;
import io.micronaut.web.router.DefaultRouteBuilder;

import java.lang.annotation.Annotation;
import java.util.Map;
import java.util.Optional;
import java.util.concurrent.ConcurrentHashMap;
import java.util.regex.Pattern;

/**
 * Abstract {@link io.micronaut.web.router.RouteBuilder} implementation for {@link Endpoint} method processors.
 *
 * @author Graeme Rocher
 * @since 1.0
 */
@Internal
abstract class AbstractEndpointRouteBuilder extends DefaultRouteBuilder implements ExecutableMethodProcessor<Endpoint>, LifeCycle<AbstractEndpointRouteBuilder> {

    private static final Pattern ENDPOINT_ID_PATTERN = Pattern.compile("[\\w-]+");

    private Map<Class<?>, Optional<String>> endpointIds = new ConcurrentHashMap<>();

    private final ApplicationContext beanContext;

    private final EndpointDefaultConfiguration endpointDefaultConfiguration;

    /**
     * @param applicationContext           The application context
     * @param uriNamingStrategy            The URI naming strategy
     * @param conversionService            The conversion service
     * @param endpointDefaultConfiguration Endpoints default Configuration
     */
    AbstractEndpointRouteBuilder(ApplicationContext applicationContext,
                                 UriNamingStrategy uriNamingStrategy,
                                 ConversionService conversionService,
                                 EndpointDefaultConfiguration endpointDefaultConfiguration) {
        super(applicationContext, uriNamingStrategy, conversionService);
        this.beanContext = applicationContext;
        this.endpointDefaultConfiguration = endpointDefaultConfiguration;
    }

    /**
     * @return The class
     */