Uploaded image for project: 'Kafka'
  1. Kafka
  2. KAFKA-17638 Add support for Java 23
  3. KAFKA-17722

Fix "this-escape" compiler warnings (BrokerTopicMetrics) for JDK 23

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • 4.0.0
    • None
    • None

    Description

      > 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()));
      
      

      Attachments

        Issue Links

          Activity

            People

              chengyanoo Cheng-Yan Wang
              chia7712 Chia-Ping Tsai
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: