Skip to content

Commit baec231

Browse files
authored
MINOR: Fix warnings in build (#20801)
Currently on running `./gradlew clean jar` on trunk, the following two warnings pop up: ``` > Task :metadata:compileTestJava Note: ~/kafka/metadata/src/test/java/org/apache/kafka/controller/metrics/QuorumControllerMetricsTest.java uses unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. > Task :server:compileTestJava Note: ~/kafka/server/src/test/java/org/apache/kafka/server/AssignmentsManagerTest.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. ``` The PR attempts to fix the same Reviewers: Chia-Ping Tsai <[email protected]>
1 parent 6b7f54f commit baec231

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

metadata/src/test/java/org/apache/kafka/controller/metrics/QuorumControllerMetricsTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,7 @@ public void testTimeSinceLastHeartbeatReceivedMs() {
190190
}
191191
}
192192

193+
@SuppressWarnings("unchecked") // do not warn about Gauge typecast.
193194
@Test
194195
public void testAvgIdleRatio() {
195196
final double delta = 0.001;

server/src/test/java/org/apache/kafka/server/AssignmentsManagerTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ int queuedReplicaToDirAssignments() {
250250
return queuedReplicaToDirAssignments.value();
251251
}
252252

253-
@SuppressWarnings("unchecked") // do not warn about Gauge typecast.
253+
@SuppressWarnings({"unchecked", "deprecation"}) // do not warn about Gauge typecast or the deprecation.
254254
int deprecatedQueuedReplicaToDirAssignments() {
255255
Gauge<Integer> queuedReplicaToDirAssignments =
256256
(Gauge<Integer>) findMetric(AssignmentsManager.DEPRECATED_QUEUED_REPLICA_TO_DIR_ASSIGNMENTS_METRIC);

0 commit comments

Comments
 (0)