From 4d0362bf20e9585c996b03fc39d9d7b159326e21 Mon Sep 17 00:00:00 2001
From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com>
Date: Tue, 16 Jun 2026 10:25:22 +0000
Subject: [PATCH 1/3] chore(deps): update error-prone monorepo to v2.50.0
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index dba9d9feb..d7cbd8db2 100644
--- a/pom.xml
+++ b/pom.xml
@@ -500,7 +500,7 @@
com.google.errorprone
error_prone_core
- 2.49.0
+ 2.50.0
com.uber.nullaway
From 0880000dd764d0ea1c7c7abd60c564d07f172bd2 Mon Sep 17 00:00:00 2001
From: Gregor Zeitlinger
Date: Tue, 16 Jun 2026 10:46:50 +0000
Subject: [PATCH 2/3] fix: address Error Prone 2.50.0 warnings Signed-off-by:
Gregor Zeitlinger
---
.../core/exemplars/ExemplarSampler.java | 7 +++++-
.../metrics/core/metrics/CKMSQuantiles.java | 7 +++++-
.../metrics/model/snapshots/Labels.java | 24 ++++++++++++-------
.../metrics/model/snapshots/Quantiles.java | 2 +-
4 files changed, 28 insertions(+), 12 deletions(-)
diff --git a/prometheus-metrics-core/src/main/java/io/prometheus/metrics/core/exemplars/ExemplarSampler.java b/prometheus-metrics-core/src/main/java/io/prometheus/metrics/core/exemplars/ExemplarSampler.java
index 3a6320955..202ffe019 100644
--- a/prometheus-metrics-core/src/main/java/io/prometheus/metrics/core/exemplars/ExemplarSampler.java
+++ b/prometheus-metrics-core/src/main/java/io/prometheus/metrics/core/exemplars/ExemplarSampler.java
@@ -36,6 +36,11 @@
@StableApi
public class ExemplarSampler {
+ @SuppressWarnings("ReferenceEquality")
+ private static boolean sameObject(Object left, Object right) {
+ return left == right;
+ }
+
private final ExemplarSamplerConfig config;
private final Exemplar[] exemplars;
private final Exemplar[]
@@ -223,7 +228,7 @@ private long doObserveWithoutUpperBounds(double value) {
int oldestIndex = -1;
for (int i = 0; i < exemplars.length; i++) {
Exemplar exemplar = exemplars[i];
- if (exemplar != null && exemplar != smallest && exemplar != largest) {
+ if (exemplar != null && !sameObject(exemplar, smallest) && !sameObject(exemplar, largest)) {
if (oldestTimestamp == 0 || exemplar.getTimestampMillis() < oldestTimestamp) {
oldestTimestamp = exemplar.getTimestampMillis();
oldestIndex = i;
diff --git a/prometheus-metrics-core/src/main/java/io/prometheus/metrics/core/metrics/CKMSQuantiles.java b/prometheus-metrics-core/src/main/java/io/prometheus/metrics/core/metrics/CKMSQuantiles.java
index 74ce18e72..83c8cfdc3 100644
--- a/prometheus-metrics-core/src/main/java/io/prometheus/metrics/core/metrics/CKMSQuantiles.java
+++ b/prometheus-metrics-core/src/main/java/io/prometheus/metrics/core/metrics/CKMSQuantiles.java
@@ -34,6 +34,11 @@
*/
final class CKMSQuantiles {
+ @SuppressWarnings("ReferenceEquality")
+ private static boolean sameObject(Object left, Object right) {
+ return left == right;
+ }
+
final Quantile[] quantiles;
/** Total number of observations (not including those that are still in the buffer). */
@@ -203,7 +208,7 @@ void compress() {
right = left;
left = descendingIterator.next();
r = r - left.g;
- if (left == samples.getFirst()) {
+ if (sameObject(left, samples.getFirst())) {
// The min sample must never be merged.
break;
}
diff --git a/prometheus-metrics-model/src/main/java/io/prometheus/metrics/model/snapshots/Labels.java b/prometheus-metrics-model/src/main/java/io/prometheus/metrics/model/snapshots/Labels.java
index cd3a57a13..d5c0a3a95 100644
--- a/prometheus-metrics-model/src/main/java/io/prometheus/metrics/model/snapshots/Labels.java
+++ b/prometheus-metrics-model/src/main/java/io/prometheus/metrics/model/snapshots/Labels.java
@@ -124,7 +124,7 @@ static String[] makePrometheusNames(String[] names) {
for (int i = 0; i < names.length; i++) {
String name = names[i];
if (!PrometheusNaming.isValidLegacyLabelName(name)) {
- if (prometheusNames == names) {
+ if (sameObject(prometheusNames, names)) {
prometheusNames = Arrays.copyOf(names, names.length);
}
prometheusNames[i] = PrometheusNaming.prometheusName(name);
@@ -234,7 +234,8 @@ public Labels merge(Labels other) {
}
String[] names = new String[this.names.length + other.names.length];
String[] prometheusNames = names;
- if (this.names != this.prometheusNames || other.names != other.prometheusNames) {
+ if (!sameObject(this.names, this.prometheusNames)
+ || !sameObject(other.names, other.prometheusNames)) {
prometheusNames = new String[names.length];
}
String[] values = new String[names.length];
@@ -244,28 +245,28 @@ public Labels merge(Labels other) {
if (thisPos >= this.names.length) {
names[thisPos + otherPos] = other.names[otherPos];
values[thisPos + otherPos] = other.values[otherPos];
- if (prometheusNames != names) {
+ if (!sameObject(prometheusNames, names)) {
prometheusNames[thisPos + otherPos] = other.prometheusNames[otherPos];
}
otherPos++;
} else if (otherPos >= other.names.length) {
names[thisPos + otherPos] = this.names[thisPos];
values[thisPos + otherPos] = this.values[thisPos];
- if (prometheusNames != names) {
+ if (!sameObject(prometheusNames, names)) {
prometheusNames[thisPos + otherPos] = this.prometheusNames[thisPos];
}
thisPos++;
} else if (this.prometheusNames[thisPos].compareTo(other.prometheusNames[otherPos]) < 0) {
names[thisPos + otherPos] = this.names[thisPos];
values[thisPos + otherPos] = this.values[thisPos];
- if (prometheusNames != names) {
+ if (!sameObject(prometheusNames, names)) {
prometheusNames[thisPos + otherPos] = this.prometheusNames[thisPos];
}
thisPos++;
} else if (this.prometheusNames[thisPos].compareTo(other.prometheusNames[otherPos]) > 0) {
names[thisPos + otherPos] = other.names[otherPos];
values[thisPos + otherPos] = other.values[otherPos];
- if (prometheusNames != names) {
+ if (!sameObject(prometheusNames, names)) {
prometheusNames[thisPos + otherPos] = other.prometheusNames[otherPos];
}
otherPos++;
@@ -321,6 +322,11 @@ public int compareTo(Labels other) {
}
// Looks like Java doesn't have a compareTo() method for arrays.
+ @SuppressWarnings("ReferenceEquality")
+ private static boolean sameObject(Object left, Object right) {
+ return left == right;
+ }
+
private int compare(String[] array1, String[] array2) {
int result;
for (int i = 0; i < array1.length; i++) {
@@ -505,14 +511,14 @@ private static void insertionSort(
int j = i - 1;
while (j >= left && compare(prometheusNames[j], prometheusName) > 0) {
names[j + 1] = names[j];
- if (prometheusNames != names) {
+ if (!sameObject(prometheusNames, names)) {
prometheusNames[j + 1] = prometheusNames[j];
}
values[j + 1] = values[j];
j--;
}
names[j + 1] = name;
- if (prometheusNames != names) {
+ if (!sameObject(prometheusNames, names)) {
prometheusNames[j + 1] = prometheusName;
}
values[j + 1] = value;
@@ -594,7 +600,7 @@ private static void swap(
tmp = values[i];
values[i] = values[j];
values[j] = tmp;
- if (prometheusNames != names) {
+ if (!sameObject(prometheusNames, names)) {
tmp = prometheusNames[i];
prometheusNames[i] = prometheusNames[j];
prometheusNames[j] = tmp;
diff --git a/prometheus-metrics-model/src/main/java/io/prometheus/metrics/model/snapshots/Quantiles.java b/prometheus-metrics-model/src/main/java/io/prometheus/metrics/model/snapshots/Quantiles.java
index 37d2686d1..8d93c5b4d 100644
--- a/prometheus-metrics-model/src/main/java/io/prometheus/metrics/model/snapshots/Quantiles.java
+++ b/prometheus-metrics-model/src/main/java/io/prometheus/metrics/model/snapshots/Quantiles.java
@@ -17,7 +17,7 @@ public class Quantiles implements Iterable {
private Quantiles(List quantiles) {
quantiles = new ArrayList<>(quantiles);
- quantiles.sort(Comparator.comparing(Quantile::getQuantile));
+ quantiles.sort(Comparator.comparingDouble(Quantile::getQuantile));
this.quantiles = Collections.unmodifiableList(quantiles);
validate();
}
From af84f0a540b38035beebd70bfc8641e7dbfadac9 Mon Sep 17 00:00:00 2001
From: Gregor Zeitlinger
Date: Tue, 16 Jun 2026 10:54:18 +0000
Subject: [PATCH 3/3] docs: update API diff reports Signed-off-by: Gregor
Zeitlinger
---
docs/apidiffs/current_vs_latest/prometheus-metrics-core.txt | 4 +++-
docs/apidiffs/current_vs_latest/prometheus-metrics-model.txt | 4 +++-
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/docs/apidiffs/current_vs_latest/prometheus-metrics-core.txt b/docs/apidiffs/current_vs_latest/prometheus-metrics-core.txt
index 92dc3a8af..ffb4a1d52 100644
--- a/docs/apidiffs/current_vs_latest/prometheus-metrics-core.txt
+++ b/docs/apidiffs/current_vs_latest/prometheus-metrics-core.txt
@@ -1,2 +1,4 @@
Comparing source compatibility of prometheus-metrics-core-1.8.1-SNAPSHOT.jar against prometheus-metrics-core-1.8.0.jar
-No changes.
+*** MODIFIED CLASS: PUBLIC io.prometheus.metrics.core.exemplars.ExemplarSampler (not serializable)
+ === CLASS FILE FORMAT VERSION: 52.0 <- 52.0
+
diff --git a/docs/apidiffs/current_vs_latest/prometheus-metrics-model.txt b/docs/apidiffs/current_vs_latest/prometheus-metrics-model.txt
index 03953635f..d298829ca 100644
--- a/docs/apidiffs/current_vs_latest/prometheus-metrics-model.txt
+++ b/docs/apidiffs/current_vs_latest/prometheus-metrics-model.txt
@@ -1,2 +1,4 @@
Comparing source compatibility of prometheus-metrics-model-1.8.1-SNAPSHOT.jar against prometheus-metrics-model-1.8.0.jar
-No changes.
+*** MODIFIED CLASS: PUBLIC FINAL io.prometheus.metrics.model.snapshots.Labels (not serializable)
+ === CLASS FILE FORMAT VERSION: 52.0 <- 52.0
+