From 726fb3742853c59f13b9694201f265eaec904ce9 Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Sat, 2 Nov 2024 11:34:38 +0100 Subject: [PATCH] Refactor: Neue, klarere ``switch``-Syntax --- src/main/java/de/juplo/kafka/ExampleConsumer.java | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/main/java/de/juplo/kafka/ExampleConsumer.java b/src/main/java/de/juplo/kafka/ExampleConsumer.java index 3552689..4179331 100644 --- a/src/main/java/de/juplo/kafka/ExampleConsumer.java +++ b/src/main/java/de/juplo/kafka/ExampleConsumer.java @@ -360,12 +360,8 @@ public class ExampleConsumer implements Runnable, ConsumerRebalanceListener PartitionState partitionState = partitionStates[partition.partition()]; switch (partitionState) { - case RESTORING, ASSIGNED: - stateUnassigned(partition.partition()); - break; - default: - case UNASSIGNED: - log.warn("{} - partition {} in state {} was revoked!", id, partition, partitionState); + case RESTORING, ASSIGNED -> stateUnassigned(partition.partition()); + case UNASSIGNED -> log.warn("{} - partition {} in state {} was revoked!", id, partition, partitionState); } } }); -- 2.20.1