René's URL Explorer Experiment


Title: MetricsCdiExtension.java:error: Something has gone terribly wrong · Issue #805 · google/google-java-format · GitHub

Open Graph Title: MetricsCdiExtension.java:error: Something has gone terribly wrong · Issue #805 · google/google-java-format

X Title: MetricsCdiExtension.java:error: Something has gone terribly wrong · Issue #805 · google/google-java-format

Description: java \ -jar core/target/google-java-format-HEAD-SNAPSHOT-all-deps.jar \ -i \helidon/microprofile/metrics/src/main/java/io/helidon/microprofile/metrics/MetricsCdiExtension.java n/microprofile/metrics/src/main/java/io/helidon/microprofile/...

Open Graph Description: java \ -jar core/target/google-java-format-HEAD-SNAPSHOT-all-deps.jar \ -i \helidon/microprofile/metrics/src/main/java/io/helidon/microprofile/metrics/MetricsCdiExtension.java n/microprofile/metric...

X Description: java \ -jar core/target/google-java-format-HEAD-SNAPSHOT-all-deps.jar \ -i \helidon/microprofile/metrics/src/main/java/io/helidon/microprofile/metrics/MetricsCdiExtension.java n/microprofile/metric...

Opengraph URL: https://github.com/google/google-java-format/issues/805

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"MetricsCdiExtension.java:error: Something has gone terribly wrong","articleBody":"```sh\r\njava \\\r\n  -jar core/target/google-java-format-HEAD-SNAPSHOT-all-deps.jar \\\r\n  -i \\helidon/microprofile/metrics/src/main/java/io/helidon/microprofile/metrics/MetricsCdiExtension.java\r\n```\r\n\r\nn/microprofile/metrics/src/main/java/io/helidon/microprofile/metrics/MetricsCdiExtension.java\r\n/Users/fsousa/Projects/code/helidon/microprofile/metrics/src/main/java/io/helidon/microprofile/metrics/MetricsCdiExtension.java:error: Something has gone terribly wrong. Please file a bug: https://github.com/google/google-java-format/issues/new\r\n\r\n\r\n#### actual\r\n```java\r\n=== Actual: ===\r\npackage io.helidon.microprofile.metrics;\r\n\r\nimport static jakarta.interceptor.Interceptor.Priority.LIBRARY_BEFORE;\r\nimport io.helidon.common.Errors;\r\nimport io.helidon.common.context.Contexts;\r\nimport io.helidon.config.Config;\r\nimport io.helidon.config.ConfigSources;\r\nimport io.helidon.config.ConfigValue;\r\nimport io.helidon.config.mp.MpConfig;\r\nimport io.helidon.metrics.api.MetricsSettings;\r\nimport io.helidon.metrics.api.RegistryFactory;\r\nimport io.helidon.metrics.serviceapi.MetricsSupport;\r\nimport io.helidon.microprofile.metrics.MetricAnnotationInfo.RegistrationPrep;\r\nimport io.helidon.microprofile.metrics.MetricUtil.LookupResult;\r\nimport io.helidon.microprofile.metrics.spi.MetricAnnotationDiscoveryObserver;\r\nimport io.helidon.microprofile.metrics.spi.MetricRegistrationObserver;\r\nimport io.helidon.microprofile.server.ServerCdiExtension;\r\nimport io.helidon.servicecommon.restcdi.HelidonRestCdiExtension;\r\nimport io.helidon.webserver.Routing;\r\nimport jakarta.annotation.Priority;\r\nimport jakarta.enterprise.context.ApplicationScoped;\r\nimport jakarta.enterprise.context.Initialized;\r\nimport jakarta.enterprise.context.RequestScoped;\r\nimport jakarta.enterprise.event.Observes;\r\nimport jakarta.enterprise.inject.Stereotype;\r\nimport jakarta.enterprise.inject.spi.AfterDeploymentValidation;\r\nimport jakarta.enterprise.inject.spi.Annotated;\r\nimport jakarta.enterprise.inject.spi.AnnotatedCallable;\r\nimport jakarta.enterprise.inject.spi.AnnotatedMethod;\r\nimport jakarta.enterprise.inject.spi.AnnotatedType;\r\nimport jakarta.enterprise.inject.spi.Bean;\r\nimport jakarta.enterprise.inject.spi.BeanManager;\r\nimport jakarta.enterprise.inject.spi.BeforeBeanDiscovery;\r\nimport jakarta.enterprise.inject.spi.DeploymentException;\r\nimport jakarta.enterprise.inject.spi.ProcessAnnotatedType;\r\nimport jakarta.enterprise.inject.spi.ProcessManagedBean;\r\nimport jakarta.enterprise.inject.spi.WithAnnotations;\r\nimport jakarta.enterprise.inject.spi.configurator.AnnotatedConstructorConfigurator;\r\nimport jakarta.enterprise.inject.spi.configurator.AnnotatedMethodConfigurator;\r\nimport jakarta.enterprise.inject.spi.configurator.AnnotatedTypeConfigurator;\r\nimport jakarta.enterprise.util.AnnotationLiteral;\r\nimport jakarta.inject.Singleton;\r\nimport jakarta.interceptor.Interceptor;\r\nimport jakarta.ws.rs.DELETE;\r\nimport jakarta.ws.rs.GET;\r\nimport jakarta.ws.rs.HEAD;\r\nimport jakarta.ws.rs.OPTIONS;\r\nimport jakarta.ws.rs.PATCH;\r\nimport jakarta.ws.rs.POST;\r\nimport jakarta.ws.rs.PUT;\r\nimport java.lang.annotation.Annotation;\r\nimport java.lang.reflect.AnnotatedElement;\r\nimport java.lang.reflect.Executable;\r\nimport java.lang.reflect.Member;\r\nimport java.lang.reflect.Method;\r\nimport java.lang.reflect.Modifier;\r\nimport java.lang.reflect.Parameter;\r\nimport java.lang.reflect.Type;\r\nimport java.util.ArrayList;\r\nimport java.util.Arrays;\r\nimport java.util.HashMap;\r\nimport java.util.HashSet;\r\nimport java.util.List;\r\nimport java.util.Map;\r\nimport java.util.Set;\r\nimport java.util.function.BiFunction;\r\nimport java.util.function.Function;\r\nimport java.util.logging.Level;\r\nimport java.util.logging.Logger;\r\nimport java.util.stream.Collectors;\r\nimport java.util.stream.Stream;\r\nimport org.eclipse.microprofile.config.ConfigProvider;\r\nimport org.eclipse.microprofile.metrics.Counter;\r\nimport org.eclipse.microprofile.metrics.Metadata;\r\nimport org.eclipse.microprofile.metrics.MetricID;\r\nimport org.eclipse.microprofile.metrics.MetricRegistry;\r\nimport org.eclipse.microprofile.metrics.MetricType;\r\nimport org.eclipse.microprofile.metrics.MetricUnits;\r\nimport org.eclipse.microprofile.metrics.SimpleTimer;\r\nimport org.eclipse.microprofile.metrics.Tag;\r\nimport org.eclipse.microprofile.metrics.annotation.ConcurrentGauge;\r\nimport org.eclipse.microprofile.metrics.annotation.Counted;\r\nimport org.eclipse.microprofile.metrics.annotation.Gauge;\r\nimport org.eclipse.microprofile.metrics.annotation.Metered;\r\nimport org.eclipse.microprofile.metrics.annotation.SimplyTimed;\r\nimport org.eclipse.microprofile.metrics.annotation.Timed;\r\n\r\n/**\r\n * MetricsCdiExtension class.\r\n *\r\n * \u003cp>Earlier versions of this class detected app-provided producer fields and methods and triggered\r\n * creation and registration of the corresponding metrics upon such detection. As explained in this\r\n * \u003ca href=\"https://github.com/eclipse/microprofile-metrics/issues/456\">MP metrics issue\u003c/a> and\r\n * this \u003ca href=\"https://github.com/eclipse/microprofile-metrics/pull/594\">MP metrics PR\u003c/a>, this\r\n * probably was never correct and does not work because {@code @Metric} no longer applies to\r\n * producers per the MP metrics 3.0 spec. The issue and PR discussion explain how developers who\r\n * provide their own producers should use CDI qualifiers on the producers (and, therefore, injection\r\n * points) to avoid ambiguity between their own producers and producers written by vendors\r\n * implementing MP metrics.\r\n *\r\n * \u003cp>For Helidon, this means we no longer need to track producer fields and methods, nor do we need\r\n * to augment injection points with our own {@code VendorProvided} qualifier to disambiguate,\r\n * because we now rely on developers who write their own producers to avoid the ambiguity using\r\n * qualifiers.\r\n */\r\npublic class MetricsCdiExtension extends HelidonRestCdiExtension\u003cMetricsSupport> {\r\n    private static final Logger LOGGER = Logger.getLogger(MetricsCdiExtension.class.getName());\r\n    static final Set\u003cClass\u003c? extends Annotation>> ALL_METRIC_ANNOTATIONS = Set.of(Counted.class, Metered.class, Timed.class, ConcurrentGauge.class, SimplyTimed.class, Gauge.class);\r\n    private static final Map\u003cClass\u003c? extends Annotation>, AnnotationLiteral\u003c?>> INTERCEPTED_METRIC_ANNOTATIONS = Map.of(Counted.class, InterceptorCounted.binding(), Metered.class, InterceptorMetered.binding(), Timed.class, InterceptorTimed.binding(), ConcurrentGauge.class, InterceptorConcurrentGauge.binding(), SimplyTimed.class, InterceptorSimplyTimed.binding());\r\n    private static final List\u003cClass\u003c? extends Annotation>> JAX_RS_ANNOTATIONS = Arrays.asList(GET.class, PUT.class, POST.class, HEAD.class, OPTIONS.class, DELETE.class, PATCH.class);\r\n    private static final Set\u003cClass\u003c? extends Annotation>> METRIC_ANNOTATIONS_ON_ANY_ELEMENT = new HashSet\u003c>(ALL_METRIC_ANNOTATIONS){\r\n        {\r\n            remove(Gauge.class);\r\n        }\r\n    };\r\n    static final String REST_ENDPOINTS_METRIC_ENABLED_PROPERTY_NAME = \"rest-request.enabled\";\r\n    private static final boolean REST_ENDPOINTS_METRIC_ENABLED_DEFAULT_VALUE = false;\r\n    static final String SYNTHETIC_SIMPLE_TIMER_METRIC_NAME = \"REST.request\";\r\n    static final String SYNTHETIC_SIMPLE_TIMER_METRIC_UNMAPPED_EXCEPTION_NAME = SYNTHETIC_SIMPLE_TIMER_METRIC_NAME + \".unmappedException.total\";\r\n    static final Metadata SYNTHETIC_SIMPLE_TIMER_METADATA = Metadata.builder().withName(SYNTHETIC_SIMPLE_TIMER_METRIC_NAME).withDisplayName(\"Total Requests and Response Time\").withDescription(\"The number of invocations and total response time of this RESTful resource method since the start of the server. The metric will not record the elapsed time nor count of a REST request if it resulted in an unmapped exception. Also tracks the highest recorded time duration within the previous completed full minute and lowest recorded time duration within the previous completed full minute.\").withType(MetricType.SIMPLE_TIMER).withUnit(MetricUnits.NANOSECONDS).build();\r\n    static final Metadata SYNTHETIC_SIMPLE_TIMER_UNMAPPED_EXCEPTION_METADATA = Metadata.builder().withName(SYNTHETIC_SIMPLE_TIMER_METRIC_UNMAPPED_EXCEPTION_NAME).withDisplayName(\"Total Unmapped Exceptions count\").withDescription(\"The total number of unmapped exceptions that occur from this RESTful resouce method since the start of the server.\").withType(MetricType.COUNTER).withUnit(MetricUnits.NONE).build();\r\n    private boolean restEndpointsMetricsEnabled = REST_ENDPOINTS_METRIC_ENABLED_DEFAULT_VALUE;\r\n    private final Map\u003cMetricID, AnnotatedMethod\u003c?>> annotatedGaugeSites = new HashMap\u003c>();\r\n    private final List\u003cRegistrationPrep> annotatedSites = new ArrayList\u003c>();\r\n    private Errors.Collector errors = Errors.collector();\r\n    private final Map\u003cClass\u003c?>, Set\u003cMethod>> methodsWithRestRequestMetrics = new HashMap\u003c>();\r\n    private final Set\u003cClass\u003c?>> restRequestMetricsClassesProcessed = new HashSet\u003c>();\r\n    private final Set\u003cMethod> restRequestMetricsToRegister = new HashSet\u003c>();\r\n    private final WorkItemsManager\u003cMetricWorkItem> workItemsManager = WorkItemsManager.create();\r\n    private final List\u003cMetricAnnotationDiscoveryObserver> metricAnnotationDiscoveryObservers = new ArrayList\u003c>();\r\n    private final List\u003cMetricRegistrationObserver> metricRegistrationObservers = new ArrayList\u003c>();\r\n    private final Map\u003cExecutable, List\u003cMetricAnnotationDiscovery>> metricAnnotationDiscoveriesByExecutable = new HashMap\u003c>();\r\n    @SuppressWarnings(\"unchecked\")\r\n    private final Map\u003cClass\u003c?>, StereotypeMetricsInfo> stereotypeMetricsInfo = new HashMap\u003c>();\r\n\r\n    @SuppressWarnings(\"unchecked\")\r\n    private static \u003cT>T getReference(BeanManager bm, Type type, Bean\u003c?> bean) {\r\n        return (T)bm.getReference(bean, type, bm.createCreationalContext(bean));\r\n    }\r\n\r\n    /**\r\n     * Creates a new extension instance.\r\n     */\r\n    public MetricsCdiExtension() {\r\n        super(LOGGER, MetricsSupport::create, \"metrics\");\r\n    }\r\n\r\n    /**\r\n     * Records an observer of metric annotation discoveries.\r\n     *\r\n     * @param metricAnnotationDiscoveryObserver the observer to enroll\r\n     */\r\n    public void enroll(MetricAnnotationDiscoveryObserver metricAnnotationDiscoveryObserver) {\r\n        metricAnnotationDiscoveryObservers.add(metricAnnotationDiscoveryObserver);\r\n    }\r\n\r\n    /**\r\n     * Records an observer of metric registrations.\r\n     *\r\n     * @param metricRegistrationObserver the observer to enroll\r\n     */\r\n    public void enroll(MetricRegistrationObserver metricRegistrationObserver) {\r\n        metricRegistrationObservers.add(metricRegistrationObserver);\r\n    }\r\n\r\n    private static \u003cE extends Member & AnnotatedElement>void recordAnnotatedSite(List\u003cRegistrationPrep> sites, E element, Class\u003c?> annotatedClass, LookupResult\u003c? extends Annotation> lookupResult, Executable executable) {\r\n        Annotation annotation = lookupResult.getAnnotation();\r\n        RegistrationPrep registrationPrep = RegistrationPrep.create(annotation, element, annotatedClass, lookupResult.getType(), executable);\r\n        sites.add(registrationPrep);\r\n    }\r\n\r\n    private void registerMetricsForAnnotatedSites() {\r\n        MetricRegistry registry = getMetricRegistry();\r\n        for (RegistrationPrep registrationPrep : annotatedSites) {\r\n            metricAnnotationDiscoveriesByExecutable.get(registrationPrep.executable()).forEach((discovery)->{\r\n                if (discovery.isActive()) {\r\n                    org.eclipse.microprofile.metrics.Metric metric = registrationPrep.register(registry);\r\n                    MetricID metricID = new MetricID(registrationPrep.metricName(), registrationPrep.tags());\r\n                    metricRegistrationObservers.forEach((o)->o.onRegistration(discovery, registrationPrep.metadata(), metricID, metric));\r\n                    workItemsManager.put(registrationPrep.executable(), registrationPrep.annotationType(), BasicMetricWorkItem.create(new MetricID(registrationPrep.metricName(), registrationPrep.tags()), metric));\r\n                }\r\n            });\r\n        }\r\n        annotatedSites.clear();\r\n    }\r\n\r\n    @Override\r\n    protected void processManagedBean(ProcessManagedBean\u003c?> pmb) {\r\n        AnnotatedType\u003c?> type = pmb.getAnnotatedBeanClass();\r\n        Class\u003c?> clazz = type.getJavaClass();\r\n        if (type.isAnnotationPresent(Interceptor.class)) {\r\n            LOGGER.log(Level.FINE, \"Ignoring objects defined on type \" + clazz.getName() + \" because a CDI portable extension added @Interceptor to it dynamically\");\r\n            return;\r\n        }\r\n        Stream.concat(type.getMethods().stream(), type.getConstructors().stream()).filter((annotatedCallable)->!Modifier.isPrivate(annotatedCallable.getJavaMember().getModifiers())).filter((annotatedCallable)->type.equals(annotatedCallable.getDeclaringType())).forEach((annotatedCallable)->METRIC_ANNOTATIONS_ON_ANY_ELEMENT.forEach((annotation)->MetricUtil.lookupAnnotations(type, annotatedCallable, annotation, stereotypeMetricsInfo).forEach((lookupResult)->{\r\n            Executable executable = (Executable)annotatedCallable.getJavaMember();\r\n            recordAnnotatedSite(annotatedSites, executable, clazz, lookupResult, executable);\r\n        })));\r\n    }\r\n\r\n    private static Tag[] tags(String[] tagStrings) {\r\n        final List\u003cTag> result = new ArrayList\u003c>();\r\n        for (int i = 0; i \u003c tagStrings.length; i++) {\r\n            final int eq = tagStrings[i].indexOf(\"=\");\r\n            if (eq > 0) {\r\n                final String tagName = tagStrings[i].substring(0, eq);\r\n                final String tagValue = tagStrings[i].substring(eq + 1);\r\n                result.add(new Tag(tagName, tagValue));\r\n            }\r\n        }\r\n        return result.toArray(new Tag[0]);\r\n    }\r\n\r\n    Iterable\u003cMetricWorkItem> workItems(Executable executable, Class\u003c? extends Annotation> annotationType) {\r\n        return workItemsManager.workItems(executable, annotationType);\r\n    }\r\n\r\n    \u003cS extends MetricWorkItem>Iterable\u003cS> workItems(Executable executable, Class\u003c? extends Annotation> annotationType, Class\u003cS> sClass) {\r\n        return TypeFilteredIterable.create(workItems(executable, annotationType), sClass);\r\n    }\r\n\r\n    /**\r\n     * Returns the real class of this object, skipping proxies.\r\n     *\r\n     * @param object The object.\r\n     * @return Its class.\r\n     */\r\n    static Class\u003c?> getRealClass(Object object) {\r\n        Class\u003c?> result = object.getClass();\r\n        while (result.isSynthetic()) {\r\n            result = result.getSuperclass();\r\n        }\r\n        return result;\r\n    }\r\n\r\n    static MetricRegistry getMetricRegistry() {\r\n        return RegistryProducer.getDefaultRegistry();\r\n    }\r\n\r\n    static MetricRegistry getRegistryForSyntheticRestRequestMetrics() {\r\n        return RegistryProducer.getBaseRegistry();\r\n    }\r\n\r\n    /**\r\n     * Initializes the extension prior to bean discovery.\r\n     *\r\n     * @param discovery bean discovery event\r\n     */\r\n    void before(@Observes\r\n    BeforeBeanDiscovery discovery) {\r\n        LOGGER.log(Level.FINE, ()->\"Before bean discovery \" + discovery);\r\n        discovery.addAnnotatedType(RegistryProducer.class, RegistryProducer.class.getName());\r\n        discovery.addAnnotatedType(MetricProducer.class, MetricProducer.class.getName());\r\n        discovery.addAnnotatedType(InterceptorCounted.class, InterceptorCounted.class.getName());\r\n        discovery.addAnnotatedType(InterceptorMetered.class, InterceptorMetered.class.getName());\r\n        discovery.addAnnotatedType(InterceptorTimed.class, InterceptorTimed.class.getName());\r\n        discovery.addAnnotatedType(InterceptorConcurrentGauge.class, InterceptorConcurrentGauge.class.getName());\r\n        discovery.addAnnotatedType(InterceptorSimplyTimed.class, InterceptorSimplyTimed.class.getName());\r\n        discovery.addAnnotatedType(InterceptorSyntheticRestRequest.class, InterceptorSyntheticRestRequest.class.getName());\r\n        discovery.addAnnotatedType(SyntheticRestRequest.class, SyntheticRestRequest.class.getName());\r\n        restEndpointsMetricsEnabled = restEndpointsMetricsEnabled();\r\n    }\r\n\r\n    @Override\r\n    public void clearAnnotationInfo(@Observes\r\n    AfterDeploymentValidation adv) {\r\n        super.clearAnnotationInfo(adv);\r\n        methodsWithRestRequestMetrics.clear();\r\n    }\r\n\r\n    /**\r\n     * Records Java classes with a metrics annotation somewhere.\r\n     *\r\n     * \u003cp>By recording the classes here, we let CDI optimize its invocations of this observer method.\r\n     * Later, when we observe managed beans (which CDI invokes for all managed beans) where we also\r\n     * have to examine each method and constructor, we can quickly eliminate from consideration any\r\n     * classes we have not recorded here.\r\n     *\r\n     * \u003cp>This observer runs after other {@code ProcessAnnotatedType} observers to give other\r\n     * extensions a chance to provide their own interceptors for selected constructors and methods by\r\n     * adding {@link MetricAnnotationDiscoveryObserver} to the configured type, constructor, or\r\n     * method.\r\n     *\r\n     * @param pat ProcessAnnotatedType event\r\n     */\r\n    private void recordMetricAnnotatedClass(@Observes\r\n    @Priority(Interceptor.Priority.APPLICATION + 500 + 10)\r\n    @WithAnnotations({Counted.class, Metered.class, Timed.class, ConcurrentGauge.class, SimplyTimed.class})\r\n    ProcessAnnotatedType\u003c?> pat) {\r\n        if (isConcreteNonInterceptor(pat)) {\r\n            recordAnnotatedType(pat);\r\n            recordStereotypes(pat);\r\n            bindInterceptors(pat);\r\n        }\r\n    }\r\n\r\n    private void bindInterceptors(ProcessAnnotatedType\u003c?> pat) {\r\n        AnnotatedTypeConfigurator\u003c?> annotatedTypeConfigurator = pat.configureAnnotatedType();\r\n        bindInterceptorsAndRecordDiscoveries(annotatedTypeConfigurator, pat.configureAnnotatedType().constructors(), AnnotatedConstructorConfigurator::getAnnotated, AnnotatedConstructorConfigurator::add);\r\n        bindInterceptorsAndRecordDiscoveries(annotatedTypeConfigurator, pat.configureAnnotatedType().methods(), AnnotatedMethodConfigurator::getAnnotated, (BiFunction\u003cAnnotatedMethodConfigurator\u003c?>, Annotation, AnnotatedMethodConfigurator\u003c?>>)AnnotatedMethodConfigurator::add);\r\n    }\r\n\r\n    private \u003cT, C, A extends AnnotatedCallable\u003c?>>void bindInterceptorsAndRecordDiscoveries(AnnotatedTypeConfigurator\u003cT> annotatedTypeConfigurator, Iterable\u003c? extends C> executableConfigurators, Function\u003cC, A> configuratorAnnotatedGetter, BiFunction\u003cC, Annotation, C> annotationAdder) {\r\n        executableConfigurators.forEach((executableConfigurator)->{\r\n            A annotatedCallable = configuratorAnnotatedGetter.apply(executableConfigurator);\r\n            Executable exec = (annotatedCallable.getJavaMember() instanceof Executable) ? (Executable)annotatedCallable.getJavaMember() : null;\r\n            metricsLookupResults(annotatedTypeConfigurator.getAnnotated(), annotatedCallable).forEach((lookupResult)->{\r\n                MetricAnnotationDiscoveryBase discoveryEvent = MetricAnnotationDiscoveryBase.create(annotatedTypeConfigurator, executableConfigurator, lookupResult.getAnnotation());\r\n                if (exec != null) {\r\n                    metricAnnotationDiscoveriesByExecutable.computeIfAbsent(exec, (o)->new ArrayList\u003c>()).add(discoveryEvent);\r\n                    metricAnnotationDiscoveryObservers.forEach((observer)->observer.onDiscovery(discoveryEvent));\r\n                }\r\n                if (discoveryEvent.shouldUseDefaultInterceptor()) {\r\n                    Class\u003c? extends Annotation> metricAnnotationClass = lookupResult.getAnnotation().annotationType();\r\n                    annotationAdder.apply(executableConfigurator, INTERCEPTED_METRIC_ANNOTATIONS.get(metricAnnotationClass));\r\n                }\r\n            });\r\n        });\r\n    }\r\n\r\n    private void recordStereotypes(ProcessAnnotatedType\u003c?> pat) {\r\n        AnnotatedType\u003c?> annotatedType = pat.getAnnotatedType();\r\n        Stream.concat(Stream.of(annotatedType), Stream.concat(pat.getAnnotatedType().getMethods().stream(), Stream.concat(pat.getAnnotatedType().getConstructors().stream(), pat.getAnnotatedType().getFields().stream()))).map(Annotated::getAnnotations).flatMap(Set::stream).distinct().filter(MetricsCdiExtension::isStereotype).forEach(this::recordIfMetricsRelatedStereotype);\r\n    }\r\n\r\n    private static boolean isStereotype(Annotation annotation) {\r\n        return annotation.annotationType().isAnnotationPresent(Stereotype.class);\r\n    }\r\n\r\n    private void recordIfMetricsRelatedStereotype(Annotation stereotypeAnnotation) {\r\n        Class\u003c? extends Annotation> candidateType = stereotypeAnnotation.annotationType();\r\n        Set\u003cAnnotation> metricsRelatedAnnotations = Arrays.stream(candidateType.getAnnotations()).filter((a)->ALL_METRIC_ANNOTATIONS.contains(a.annotationType())).collect(Collectors.toSet());\r\n        if (!metricsRelatedAnnotations.isEmpty()) {\r\n            stereotypeMetricsInfo.put(candidateType, StereotypeMetricsInfo.create(metricsRelatedAnnotations));\r\n        }\r\n    }\r\n\r\n    /**\r\n     * Collects all {@code LookupResult} objects for metrics annotations on a given annotated\r\n     * executable.\r\n     *\r\n     * @param annotatedType the annotated type containing the constructor or method\r\n     * @param annotatedMember the constructor or method\r\n     * @return {@code LookupResult} instances that apply to the executable\r\n     */\r\n    private Iterable\u003cLookupResult\u003c?>> metricsLookupResults(AnnotatedType\u003c?> annotatedType, AnnotatedCallable\u003c?> annotatedMember) {\r\n        List\u003cLookupResult\u003c?>> result = new ArrayList\u003c>();\r\n        INTERCEPTED_METRIC_ANNOTATIONS.keySet().forEach((metricAnnotationClass)->{\r\n            result.addAll(MetricUtil.lookupAnnotations(annotatedType, annotatedMember, metricAnnotationClass, stereotypeMetricsInfo));\r\n        });\r\n        return result;\r\n    }\r\n\r\n    /**\r\n     * Checks to make sure the annotated type is not abstract and is not an interceptor.\r\n     *\r\n     * @param pat {@code ProcessAnnotatedType} event\r\n     * @return true if the annotated type should be kept for potential processing later; false\r\n     *     otherwise\r\n     */\r\n    private boolean checkCandidateMetricClass(ProcessAnnotatedType\u003c?> pat) {\r\n        AnnotatedType\u003c?> annotatedType = pat.getAnnotatedType();\r\n        Class\u003c?> clazz = annotatedType.getJavaClass();\r\n        if (annotatedType.isAnnotationPresent(Interceptor.class) || Modifier.isAbstract(clazz.getModifiers())) {\r\n            LOGGER.log(Level.FINER, ()->\"Ignoring \" + clazz.getName() + \" with annotations \" + annotatedType.getAnnotations() + \" for later processing: \" + (Modifier.isAbstract(clazz.getModifiers()) ? \"abstract \" : \"\") + (annotatedType.isAnnotationPresent(Interceptor.class) ? \"interceptor \" : \"\"));\r\n            return false;\r\n        }\r\n        LOGGER.log(Level.FINE, ()->\"Accepting annotated type \" + clazz.getName() + \" for later bean processing\");\r\n        return true;\r\n    }\r\n\r\n    /**\r\n     * Adds a {@code SyntheticRestRequest} annotation to each JAX-RS endpoint method.\r\n     *\r\n     * @param pat the {@code ProcessAnnotatedType} for the type containing the JAX-RS annotated\r\n     *     methods\r\n     */\r\n    private void recordSimplyTimedForRestResources(@Observes\r\n    @WithAnnotations({GET.class, PUT.class, POST.class, HEAD.class, OPTIONS.class, DELETE.class, PATCH.class})\r\n    ProcessAnnotatedType\u003c?> pat) {\r\n        if (!checkCandidateMetricClass(pat) || !restEndpointsMetricsEnabled) {\r\n            return;\r\n        }\r\n        LOGGER.log(Level.FINE, ()->\"Processing @SyntheticRestRequest annotation for \" + pat.getAnnotatedType().getJavaClass().getName());\r\n        AnnotatedTypeConfigurator\u003c?> configurator = pat.configureAnnotatedType();\r\n        Class\u003c?> clazz = configurator.getAnnotated().getJavaClass();\r\n        Set\u003cMethod> methodsToRecord = new HashSet\u003c>();\r\n        configurator.filterMethods((method)->!Modifier.isPrivate(method.getJavaMember().getModifiers())).forEach((annotatedMethodConfigurator)->JAX_RS_ANNOTATIONS.forEach((jaxRsAnnotation)->{\r\n            AnnotatedMethod\u003c?> annotatedMethod = annotatedMethodConfigurator.getAnnotated();\r\n            if (annotatedMethod.isAnnotationPresent(jaxRsAnnotation)) {\r\n                Method m = annotatedMethod.getJavaMember();\r\n                if (clazz.equals(m.getDeclaringClass())) {\r\n                    LOGGER.log(Level.FINE, ()->String.format(\"Adding @SyntheticRestRequest to %s\", m.toString()));\r\n                    annotatedMethodConfigurator.add(SyntheticRestRequest.Literal.getInstance());\r\n                    methodsToRecord.add(m);\r\n                }\r\n            }\r\n        }));\r\n        if (!methodsToRecord.isEmpty()) {\r\n            methodsWithRestRequestMetrics.put(clazz, methodsToRecord);\r\n        }\r\n    }\r\n\r\n    /**\r\n     * Creates or looks up the {@code SimpleTimer} instance for measuring REST requests on any JAX-RS\r\n     * method.\r\n     *\r\n     * @param method the {@code Method} for which the SimpleTimer instance is needed\r\n     * @return the located or created {@code SimpleTimer}\r\n     */\r\n    static SimpleTimer restEndpointSimpleTimer(Method method) {\r\n        LOGGER.log(Level.FINE, ()->String.format(\"Registering synthetic SimpleTimer for %s#%s\", method.getDeclaringClass().getName(), method.getName()));\r\n        return getRegistryForSyntheticRestRequestMetrics().simpleTimer(SYNTHETIC_SIMPLE_TIMER_METADATA, syntheticRestRequestMetricTags(method));\r\n    }\r\n\r\n    /**\r\n     * Creates or looks up the {@code Counter} instance for measuring REST requests on any JAX-RS\r\n     * method.\r\n     *\r\n     * @param method the {@code Method} for which the Counter instance is needed\r\n     * @return the located or created {@code Counter}\r\n     */\r\n    static Counter restEndpointCounter(Method method) {\r\n        LOGGER.log(Level.FINE, ()->String.format(\"Registering synthetic Counter for %s#%s\", method.getDeclaringClass().getName(), method.getName()));\r\n        return getRegistryForSyntheticRestRequestMetrics().counter(SYNTHETIC_SIMPLE_TIMER_UNMAPPED_EXCEPTION_METADATA, syntheticRestRequestMetricTags(method));\r\n    }\r\n\r\n    private void registerAndSaveRestRequestMetrics(Method method) {\r\n        workItemsManager.put(method, SyntheticRestRequest.class, SyntheticRestRequestWorkItem.create(restEndpointSimpleTimerMetricID(method), restEndpointSimpleTimer(method), restEndpointCounterMetricID(method), restEndpointCounter(method)));\r\n    }\r\n\r\n    /**\r\n     * Creates the {@link MetricID} for the synthetic {@link SimplyTimed} metric we add to each JAX-RS\r\n     * method.\r\n     *\r\n     * @param method Java method of interest\r\n     * @return {@code MetricID} for the simpletimer for this Java method\r\n     */\r\n    static MetricID restEndpointSimpleTimerMetricID(Method method) {\r\n        return new MetricID(SYNTHETIC_SIMPLE_TIMER_METRIC_NAME, syntheticRestRequestMetricTags(method));\r\n    }\r\n\r\n    /**\r\n     * Creates the {@link MetricID} for the synthetic {@link Counter} metric we add to each JAX-RS\r\n     * method.\r\n     *\r\n     * @param method Java method of interest\r\n     * @return {@code MetricID} for the counter for this Java method\r\n     */\r\n    static MetricID restEndpointCounterMetricID(Method method) {\r\n        return new MetricID(SYNTHETIC_SIMPLE_TIMER_METRIC_UNMAPPED_EXCEPTION_NAME, syntheticRestRequestMetricTags(method));\r\n    }\r\n\r\n    /**\r\n     * Returns the {@code Tag} array for a synthetic {@code SimplyTimed} annotation.\r\n     *\r\n     * @param method the Java method of interest\r\n     * @return the {@code Tag}s indicating the class and method\r\n     */\r\n    static Tag[] syntheticRestRequestMetricTags(Method method) {\r\n        return new Tag[]{new Tag(\"class\", method.getDeclaringClass().getName()), new Tag(\"method\", methodTagValueForSyntheticRestRequestMetric(method))};\r\n    }\r\n\r\n    private static String methodTagValueForSyntheticRestRequestMetric(Method method) {\r\n        StringBuilder methodTagValue = new StringBuilder(method.getName());\r\n        for (Parameter p : method.getParameters()) {\r\n            methodTagValue.append(\"_\").append(prettyParamType(p));\r\n        }\r\n        return methodTagValue.toString();\r\n    }\r\n\r\n    private static String prettyParamType(Parameter parameter) {\r\n        return parameter.getType().isArray() || parameter.isVarArgs() ? parameter.getType().getComponentType().getName() + \"[]\" : parameter.getType().getName();\r\n    }\r\n\r\n    private void collectRestRequestMetrics(@Observes\r\n    ProcessManagedBean\u003c?> pmb) {\r\n        AnnotatedType\u003c?> type = pmb.getAnnotatedBeanClass();\r\n        Class\u003c?> clazz = type.getJavaClass();\r\n        if (!methodsWithRestRequestMetrics.containsKey(clazz)) {\r\n            return;\r\n        }\r\n        LOGGER.log(Level.FINE, ()->\"Processing synthetic SimplyTimed annotations for \" + clazz.getName());\r\n        restRequestMetricsClassesProcessed.add(clazz);\r\n        restRequestMetricsToRegister.addAll(methodsWithRestRequestMetrics.get(clazz));\r\n    }\r\n\r\n    private void registerRestRequestMetrics() {\r\n        restRequestMetricsToRegister.forEach(this::registerAndSaveRestRequestMetrics);\r\n        if (LOGGER.isLoggable(Level.FINE)) {\r\n            Set\u003cClass\u003c?>> syntheticSimpleTimerAnnotatedClassesIgnored = new HashSet\u003c>(methodsWithRestRequestMetrics.keySet());\r\n            syntheticSimpleTimerAnnotatedClassesIgnored.removeAll(restRequestMetricsClassesProcessed);\r\n            if (!syntheticSimpleTimerAnnotatedClassesIgnored.isEmpty()) {\r\n                LOGGER.log(Level.FINE, ()->\"Classes with synthetic SimplyTimer annotations added that were not processed, probably because they were vetoed:\" + syntheticSimpleTimerAnnotatedClassesIgnored.toString());\r\n            }\r\n        }\r\n        restRequestMetricsClassesProcessed.clear();\r\n        restRequestMetricsToRegister.clear();\r\n    }\r\n\r\n    boolean restEndpointsMetricsEnabled() {\r\n        try {\r\n            return chooseRestEndpointsSetting(((Config)(ConfigProvider.getConfig())).get(\"metrics\"));\r\n        } catch (Throwable t) {\r\n            LOGGER.log(Level.WARNING, \"Error looking up config setting for enabling REST endpoints SimpleTimer metrics; reporting \\'false\\'\", t);\r\n            return false;\r\n        }\r\n    }\r\n\r\n    @Override\r\n    public Routing.Builder registerService(@Observes\r\n    @Priority(LIBRARY_BEFORE + 10)\r\n    @Initialized(ApplicationScoped.class)\r\n    Object adv, BeanManager bm, ServerCdiExtension server) {\r\n        Errors problems = errors.collect();\r\n        errors = null;\r\n        if (problems.hasFatal()) {\r\n            throw new DeploymentException(\"Metrics module found issues with deployment: \" + problems.toString());\r\n        }\r\n        Routing.Builder defaultRouting = super.registerService(adv, bm, server);\r\n        MetricsSupport metricsSupport = serviceSupport();\r\n        RegistryProducer.clearApplicationRegistry();\r\n        registerMetricsForAnnotatedSites();\r\n        registerAnnotatedGauges(bm);\r\n        registerRestRequestMetrics();\r\n        Set\u003cString> vendorMetricsAdded = new HashSet\u003c>();\r\n        vendorMetricsAdded.add(\"@default\");\r\n        Config config = MpConfig.toHelidonConfig(ConfigProvider.getConfig()).get(MetricsSettings.Builder.METRICS_CONFIG_KEY);\r\n        config.get(\"vendor-metrics-routings\").asList(String.class).orElseGet(List::of).forEach((routeName)->{\r\n            if (!vendorMetricsAdded.contains(routeName)) {\r\n                metricsSupport.configureVendorMetrics(routeName, server.serverNamedRoutingBuilder(routeName));\r\n                vendorMetricsAdded.add(routeName);\r\n            }\r\n        });\r\n        Contexts.globalContext().register(RegistryFactory.getInstance());\r\n        return defaultRouting;\r\n    }\r\n\r\n    @Override\r\n    protected Config seComponentConfig() {\r\n        Config mpConfig = MpConfig.toHelidonConfig(ConfigProvider.getConfig());\r\n        Map\u003cString, String> mpConfigSettings = new HashMap\u003c>();\r\n        Stream.of(\"tags\", \"appName\").forEach((key)->{\r\n            mpConfig.get(\"mp.metrics.\" + key).asString().ifPresent((value)->mpConfigSettings.put(key, value));\r\n        });\r\n        Config metricsConfig = mpConfig.get(\"metrics\").detach();\r\n        Config.Builder builder = Config.builder();\r\n        if (!mpConfigSettings.isEmpty()) {\r\n            builder.addSource(ConfigSources.create(mpConfigSettings));\r\n        }\r\n        if (metricsConfig.exists()) {\r\n            builder.addSource(ConfigSources.create(metricsConfig));\r\n        }\r\n        return builder.build();\r\n    }\r\n\r\n    private static boolean chooseRestEndpointsSetting(Config metricsConfig) {\r\n        ConfigValue\u003cBoolean> explicitRestEndpointsSetting = metricsConfig.get(REST_ENDPOINTS_METRIC_ENABLED_PROPERTY_NAME).asBoolean();\r\n        boolean result = explicitRestEndpointsSetting.orElse(REST_ENDPOINTS_METRIC_ENABLED_DEFAULT_VALUE);\r\n        if (explicitRestEndpointsSetting.isPresent()) {\r\n            LOGGER.log(Level.FINE, ()->String.format(\"Support for MP REST.request metric and annotation handling explicitly set to %b in configuration\", explicitRestEndpointsSetting.get()));\r\n        } else {\r\n            LOGGER.log(Level.FINE, ()->String.format(\"Support for MP REST.request metric and annotation handling defaulted to %b\", REST_ENDPOINTS_METRIC_ENABLED_DEFAULT_VALUE));\r\n        }\r\n        return result;\r\n    }\r\n\r\n    private void recordAnnotatedGaugeSite(@Observes\r\n    ProcessManagedBean\u003c?> pmb) {\r\n        AnnotatedType\u003c?> type = pmb.getAnnotatedBeanClass();\r\n        Class\u003c?> clazz = type.getJavaClass();\r\n        LOGGER.log(Level.FINE, ()->\"recordAnnotatedGaugeSite for class \" + clazz);\r\n        LOGGER.log(Level.FINE, ()->\"Processing annotations for \" + clazz.getName());\r\n        if (Modifier.isAbstract(clazz.getModifiers())) {\r\n            return;\r\n        }\r\n        for (AnnotatedMethod\u003c?> method : type.getMethods()) {\r\n            Method javaMethod = method.getJavaMember();\r\n            if (!javaMethod.getDeclaringClass().equals(clazz) || Modifier.isPrivate(javaMethod.getModifiers())) {\r\n                continue;\r\n            }\r\n            MetricUtil.metricsAnnotationsOnElement(method, Gauge.class, stereotypeMetricsInfo).forEach((gaugeAnnotation)->{\r\n                Class\u003c? extends Annotation> scopeAnnotation = pmb.getBean().getScope();\r\n                if (scopeAnnotation == RequestScoped.class) {\r\n                    errors.fatal(clazz, \"Cannot configure @Gauge on a request scoped bean\");\r\n                    return;\r\n                }\r\n                if (scopeAnnotation != ApplicationScoped.class && type.getAnnotation(Singleton.class) == null) {\r\n                    if (ConfigProvider.getConfig().getOptionalValue(\"metrics.warn-dependent\", Boolean.class).orElse(true)) {\r\n                        LOGGER.warning(String.format(\"                                     @Gauge is configured\\\"\\n                      + \\\" on a bean %s that is neither ApplicationScoped nor \\\"\\n                      + \\\"                                     Singleton. This is most\\\"\\n                      + \\\" likely a bug. You may set \\'metrics.warn-dependent\\' \\\"\\n                      + \\\"                                     configuration option to\\\"\\n                      + \\\" \\'false\\' to remove this warning.\", clazz.getName()));\r\n                    }\r\n                }\r\n                String explicitGaugeName = gaugeAnnotation.name();\r\n                String gaugeNameSuffix = (explicitGaugeName.length() > 0 ? explicitGaugeName : javaMethod.getName());\r\n                String gaugeName = (gaugeAnnotation.absolute() ? gaugeNameSuffix : String.format(\"%s.%s\", clazz.getName(), gaugeNameSuffix));\r\n                annotatedGaugeSites.put(new MetricID(gaugeName, tags(gaugeAnnotation.tags())), method);\r\n                LOGGER.log(Level.FINE, ()->String.format(\"Recorded annotated gauge with name %s\", gaugeName));\r\n            });\r\n        }\r\n    }\r\n\r\n    private void registerAnnotatedGauges(BeanManager bm) {\r\n        LOGGER.log(Level.FINE, ()->\"registerGauges\");\r\n        MetricRegistry registry = getMetricRegistry();\r\n        List\u003cException> gaugeProblems = new ArrayList\u003c>();\r\n        annotatedGaugeSites.entrySet().forEach((gaugeSite)->{\r\n            LOGGER.log(Level.FINE, ()->\"gaugeSite \" + gaugeSite.toString());\r\n            MetricID gaugeID = gaugeSite.getKey();\r\n            AnnotatedMethod\u003c?> site = gaugeSite.getValue();\r\n            DelegatingGauge\u003c? extends Number> dg;\r\n            try {\r\n                dg = buildDelegatingGauge(gaugeID.getName(), site, bm);\r\n                Gauge gaugeAnnotation = siteAnnotation(site, Gauge.class);\r\n                if (gaugeAnnotation == null) {\r\n                    gaugeProblems.add(new IllegalArgumentException(String.format(\"Unable to find expected @Gauge annotation at previously-identified site %s; ignoring site\", site.getJavaMember())));\r\n                } else {\r\n                    Metadata md = Metadata.builder().withName(gaugeID.getName()).withDisplayName(gaugeAnnotation.displayName()).withDescription(gaugeAnnotation.description()).withType(MetricType.GAUGE).withUnit(gaugeAnnotation.unit()).build();\r\n                    LOGGER.log(Level.FINE, ()->String.format(\"Registering gauge with metadata %s\", md.toString()));\r\n                    registry.register(md, dg, gaugeID.getTagsAsList().toArray(new Tag[0]));\r\n                }\r\n            } catch (Throwable t) {\r\n                gaugeProblems.add(new IllegalArgumentException(String.format(\"Error processing @Gauge annotation on %s#%s: %s\", site.getJavaMember().getDeclaringClass().getName(), site.getJavaMember().getName(), t.getMessage()), t));\r\n            }\r\n        });\r\n        if (!gaugeProblems.isEmpty()) {\r\n            throw new RuntimeException(\"Could not process one or more @Gauge annotations\" + gaugeProblems);\r\n        }\r\n        annotatedGaugeSites.clear();\r\n    }\r\n\r\n    private \u003cT extends Annotation>T siteAnnotation(Annotated site, Class\u003cT> annotationType) {\r\n        Annotation result = site.getAnnotation(annotationType);\r\n        if (result != null) {\r\n            return annotationType.cast(result);\r\n        }\r\n        for (Annotation a : site.getAnnotations()) {\r\n            if (isStereotype(a)) {\r\n                StereotypeMetricsInfo info = stereotypeMetricsInfo.get(a.annotationType());\r\n                if (info != null) {\r\n                    for (Annotation annotationOnStereotype : info.metricsAnnotations()) {\r\n                        if (annotationType.isInstance(annotationOnStereotype)) {\r\n                            return annotationType.cast(annotationOnStereotype);\r\n                        }\r\n                    }\r\n                }\r\n            }\r\n        }\r\n        return null;\r\n    }\r\n\r\n    private DelegatingGauge\u003c? extends Number> buildDelegatingGauge(String gaugeName, AnnotatedMethod\u003c?> site, BeanManager bm) {\r\n        Bean\u003c?> bean = bm.getBeans(site.getJavaMember().getDeclaringClass()).stream().findFirst().orElseThrow(()->new IllegalArgumentException(\"Cannot find bean for annotated gauge \" + gaugeName));\r\n        Class\u003c?> returnType = site.getJavaMember().getReturnType();\r\n        Class\u003c? extends Number> narrowedReturnType = typeToNumber(returnType);\r\n        return DelegatingGauge.newInstance(site.getJavaMember(), getReference(bm, bean.getBeanClass(), bean), narrowedReturnType);\r\n    }\r\n\r\n    @SuppressWarnings(\"unchecked\")\r\n    private static Class\u003c? extends Number> typeToNumber(Class\u003c?> clazz) {\r\n        Class\u003c? extends Number> narrowedReturnType;\r\n        if (byte.class.isAssignableFrom(clazz)) {\r\n            narrowedReturnType = Byte.class;\r\n        } else if (short.class.isAssignableFrom(clazz)) {\r\n            narrowedReturnType = Short.class;\r\n        } else if (int.class.isAssignableFrom(clazz)) {\r\n            narrowedReturnType = Integer.class;\r\n        } else if (long.class.isAssignableFrom(clazz)) {\r\n            narrowedReturnType = Long.class;\r\n        } else if (float.class.isAssignableFrom(clazz)) {\r\n            narrowedReturnType = Float.class;\r\n        } else if (double.class.isAssignableFrom(clazz)) {\r\n            narrowedReturnType = Double.class;\r\n        } else if (Number.class.isAssignableFrom(clazz)) {\r\n            narrowedReturnType = (Class\u003c? extends Number>)clazz;\r\n        } else {\r\n            throw new IllegalArgumentException(\"Annotated gauge type must extend or be assignment-compatible with Number but is \" + clazz.getName());\r\n        }\r\n        return narrowedReturnType;\r\n    }\r\n\r\n    class StereotypeMetricsInfo {\r\n        private final Set\u003cAnnotation> metricsAnnotations;\r\n\r\n        static StereotypeMetricsInfo create(Set\u003cAnnotation> metricsAnnotations) {\r\n            return new StereotypeMetricsInfo(metricsAnnotations);\r\n        }\r\n    }\r\n}\r\n```\r\n","author":{"url":"https://github.com/natros","@type":"Person","name":"natros"},"datePublished":"2022-07-26T19:38:29Z","url":"https://github.com/google/google-java-format/issues/805"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:19886eb9-c0e7-fad7-0bc7-2fdbaa50bdeb
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id962A:3D38E3:A5CCD:E5221:6AFBB7ED
html-safe-nonce23db8a5aefb3aab968a27a2b2e5bbb0fa9d7b0fa315b2ddd0bc0f22c877e1b78
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NjJBOjNEMzhFMzpBNUNDRDpFNTIyMTo2QUZCQjdFRCIsInZpc2l0b3JfaWQiOiI0MjgyMTY4MjEzNjQ4NDIyODkzIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac2f7ff696d38436f271533cd52ec7a07c57debd7052036342a4ec8412ace8396b
hovercard-subject-tagissue:1318674067
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/google/google-java-format/805/issue_layout
twitter:imagehttps://opengraph.githubassets.com/520fae9aa71918d24febdf1f9d2f2dd5537b84e36cef1b89752944b3dde4c893/google/google-java-format/issues/805
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/520fae9aa71918d24febdf1f9d2f2dd5537b84e36cef1b89752944b3dde4c893/google/google-java-format/issues/805
og:image:altjava \ -jar core/target/google-java-format-HEAD-SNAPSHOT-all-deps.jar \ -i \helidon/microprofile/metrics/src/main/java/io/helidon/microprofile/metrics/MetricsCdiExtension.java n/microprofile/metric...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamenatros
hostnamegithub.com
expected-hostnamegithub.com
None2b2ef9c1578c18d8ed27027940544c958743213cf4461659f14d3ccdf51e162c
turbo-cache-controlno-preview
go-importgithub.com/google/google-java-format git https://github.com/google/google-java-format.git
octolytics-dimension-user_id1342004
octolytics-dimension-user_logingoogle
octolytics-dimension-repository_id35448780
octolytics-dimension-repository_nwogoogle/google-java-format
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id35448780
octolytics-dimension-repository_network_root_nwogoogle/google-java-format
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releasee4cce0e99cf61481a318ff12c2e8580153a6c7c6
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/google/google-java-format/issues/805#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgoogle%2Fgoogle-java-format%2Fissues%2F805
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgoogle%2Fgoogle-java-format%2Fissues%2F805
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=google%2Fgoogle-java-format
Reloadhttps://github.com/google/google-java-format/issues/805
Reloadhttps://github.com/google/google-java-format/issues/805
Reloadhttps://github.com/google/google-java-format/issues/805
googlehttps://github.com/google
google-java-formathttps://github.com/google/google-java-format
Codehttps://github.com/google/google-java-format
Issues84 (84)https://github.com/google/google-java-format/issues
Pull requests35 (35)https://github.com/google/google-java-format/pulls
Actionshttps://github.com/google/google-java-format/actions
Projectshttps://github.com/google/google-java-format/projects
Wikihttps://github.com/google/google-java-format/wiki
Security and qualityhttps://github.com/google/google-java-format/security
Insightshttps://github.com/google/google-java-format/pulse
https://github.com/google/google-java-format
New issuehttps://github.com/login?return_to=https://github.com/google/google-java-format/issues/805
New issuehttps://github.com/login?return_to=https://github.com/google/google-java-format/issues/805
MetricsCdiExtension.java:error: Something has gone terribly wronghttps://github.com/google/google-java-format/issues/805#top
https://github.com/natros
natroshttps://github.com/natros
on Jul 26, 2022https://github.com/google/google-java-format/issues/805#issue-1318674067
https://github.com/google/google-java-format/issues/newhttps://github.com/google/google-java-format/issues/new
https://github.com/natros
natroshttps://github.com/natros
on Jul 26, 2022https://github.com/google/google-java-format/issues/805#issuecomment-1195901348
https://github.com/natros
natroshttps://github.com/natros
on Jul 26, 2022https://github.com/google/google-java-format/issues/805#issuecomment-1195901460
https://github.com/oracle/helidon/blob/master/microprofile/metrics/src/main/java/io/helidon/microprofile/metrics/MetricsCdiExtension.javahttps://github.com/oracle/helidon/blob/master/microprofile/metrics/src/main/java/io/helidon/microprofile/metrics/MetricsCdiExtension.java
https://github.com/cushon
cushonhttps://github.com/cushon
on Aug 4, 2022https://github.com/google/google-java-format/issues/805#issuecomment-1205817151
https://github.com/cushon
cushonhttps://github.com/cushon
on Oct 29, 2026https://github.com/google/google-java-format/issues/805#issuecomment-6495728139
8633826https://github.com/google/google-java-format/commit/86338266807cb8d78082179733b31a8fd0be972c
https://github.com/google/google-java-format/releases/tag/v1.27.0https://github.com/google/google-java-format/releases/tag/v1.27.0
cushonhttps://github.com/cushon
completedhttps://github.com/google/google-java-format/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Oct 29, 2026https://github.com/google/google-java-format/issues/805#event-34579467456
Sign up for freehttps://github.com/signup?return_to=https://github.com/google/google-java-format/issues/805
Sign in to commenthttps://github.com/login?return_to=https://github.com/google/google-java-format/issues/805
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.