You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "Cheng-Yan Wang (Jira)" <ji...@apache.org> on 2024/10/10 02:33:00 UTC

[jira] (KAFKA-17722) Fix 'this' escape of BrokerTopicMetrics

    [ https://issues.apache.org/jira/browse/KAFKA-17722 ]


    Cheng-Yan Wang deleted comment on KAFKA-17722:
    ----------------------------------------

was (Author: JIRAUSER307321):
Hi [~chia7712], should I fork the repo and create a fix brach from the trunk branch to submit a PR? Plus could you please provide some suggestions on how can I test my changes? Thanks!

> Fix 'this' escape of BrokerTopicMetrics
> ---------------------------------------
>
>                 Key: KAFKA-17722
>                 URL: https://issues.apache.org/jira/browse/KAFKA-17722
>             Project: Kafka
>          Issue Type: Improvement
>            Reporter: Chia-Ping Tsai
>            Assignee: Cheng-Yan Wang
>            Priority: Minor
>
> {code:java}
> > Task :storage:compileJava FAILED
> /root/kafka/storage/src/main/java/org/apache/kafka/storage/log/metrics/BrokerTopicMetrics.java:62: warning: [this-escape] possible 'this' escape before subclass is fully initialized
>         this(Optional.empty(), remoteStorageEnabled);
>             ^
> /root/kafka/storage/src/main/java/org/apache/kafka/storage/log/metrics/BrokerTopicMetrics.java:106: warning: [this-escape] previous possible 'this' escape happens here via invocation
>             metricGaugeTypeMap.put(RemoteStorageMetrics.REMOTE_COPY_LAG_BYTES_METRIC.getName(), new GaugeWrapper(RemoteStorageMetrics.REMOTE_COPY_LAG_BYTES_METRIC.getName()));
>                                                                                                 ^
> /root/kafka/storage/src/main/java/org/apache/kafka/storage/log/metrics/BrokerTopicMetrics.java:66: warning: [this-escape] possible 'this' escape before subclass is fully initialized
>         this(Optional.of(name), remoteStorageEnabled);
>             ^
> /root/kafka/storage/src/main/java/org/apache/kafka/storage/log/metrics/BrokerTopicMetrics.java:106: warning: [this-escape] previous possible 'this' escape happens here via invocation
>             metricGaugeTypeMap.put(RemoteStorageMetrics.REMOTE_COPY_LAG_BYTES_METRIC.getName(), new GaugeWrapper(RemoteStorageMetrics.REMOTE_COPY_LAG_BYTES_METRIC.getName()));
> {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)