Skip to content

Commit 5919762

Browse files
MINOR: Remove exitMessage.set() call in TopicBasedRemoteLogMetadataManagerTest (#20563)
- **Reasons:** In this case, the `exit(int statusCode)` method invokes `exit(statusCode, null)`, which means the `message` argument is always `null` in this code path. As a result, assigning `exitMessage` has no effect and can be safely removed. - **Changes:** Remove a redundant field assignment. Reviewers: Chia-Ping Tsai <[email protected]>
1 parent c49ab6b commit 5919762

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

storage/src/test/java/org/apache/kafka/server/log/remote/metadata/storage/TopicBasedRemoteLogMetadataManagerTest.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@
4646
import java.util.concurrent.TimeUnit;
4747
import java.util.concurrent.atomic.AtomicBoolean;
4848
import java.util.concurrent.atomic.AtomicInteger;
49-
import java.util.concurrent.atomic.AtomicReference;
5049

5150
import static org.junit.jupiter.api.Assertions.assertEquals;
5251
import static org.junit.jupiter.api.Assertions.assertFalse;
@@ -344,13 +343,11 @@ public void testInitializationFailure() throws IOException, InterruptedException
344343
// Set up a custom exit procedure for testing
345344
final AtomicBoolean exitCalled = new AtomicBoolean(false);
346345
final AtomicInteger exitCode = new AtomicInteger(-1);
347-
final AtomicReference<String> exitMessage = new AtomicReference<>();
348346

349347
// Set custom exit procedure that won't actually exit the process
350348
Exit.setExitProcedure((statusCode, message) -> {
351349
exitCalled.set(true);
352350
exitCode.set(statusCode);
353-
exitMessage.set(message);
354351
});
355352

356353
try (TopicBasedRemoteLogMetadataManager rlmm = new TopicBasedRemoteLogMetadataManager()) {

0 commit comments

Comments
 (0)