This is an automated email from the ASF dual-hosted git repository.

zhaocong pushed a commit to branch branch-4.0
in repository https://gitbox.apache.org/repos/asf/pulsar.git


The following commit(s) were added to refs/heads/branch-4.0 by this push:
     new 7180f8fa99c [fix][client] Refactor AttributeWrappedMeasurement to use 
a class instead of a record to compatible with lower version JDK
7180f8fa99c is described below

commit 7180f8fa99cede550a10739ea409edc6d3cd72b2
Author: coderzc <zhaoc...@apache.org>
AuthorDate: Thu Sep 11 14:23:26 2025 +0800

    [fix][client] Refactor AttributeWrappedMeasurement to use a class instead 
of a record to compatible with lower version JDK
---
 .../pulsar/client/impl/metrics/ObservableUpDownCounter.java   | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git 
a/pulsar-client/src/main/java/org/apache/pulsar/client/impl/metrics/ObservableUpDownCounter.java
 
b/pulsar-client/src/main/java/org/apache/pulsar/client/impl/metrics/ObservableUpDownCounter.java
index c7ca2907be2..8470b054aa6 100644
--- 
a/pulsar-client/src/main/java/org/apache/pulsar/client/impl/metrics/ObservableUpDownCounter.java
+++ 
b/pulsar-client/src/main/java/org/apache/pulsar/client/impl/metrics/ObservableUpDownCounter.java
@@ -63,8 +63,15 @@ public class ObservableUpDownCounter implements 
AutoCloseable {
         counter.close();
     }
 
-    private record AttributeWrappedMeasurement(ObservableLongMeasurement 
delegate,
-                                               Attributes attributes) 
implements ObservableLongMeasurement {
+    private class AttributeWrappedMeasurement implements 
ObservableLongMeasurement {
+
+        private final ObservableLongMeasurement delegate;
+        private final Attributes attributes;
+
+        public AttributeWrappedMeasurement(ObservableLongMeasurement delegate, 
Attributes attributes) {
+            this.delegate = delegate;
+            this.attributes = attributes;
+        }
 
         @Override
         public void record(long value) {

Reply via email to