From e2862a0a7574a78b1ffd4c62563990863ebf8028 Mon Sep 17 00:00:00 2001 From: Tran Ngoc Nhan Date: Fri, 28 Feb 2025 06:52:04 +0700 Subject: [PATCH] Minor code cleanup (#3771) * Remove unnecessary null check in Suffixer class Signed-off-by: Tran Ngoc Nhan --- .../org/springframework/kafka/annotation/DltHandler.java | 5 +---- .../java/org/springframework/kafka/support/Suffixer.java | 5 +++-- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/spring-kafka/src/main/java/org/springframework/kafka/annotation/DltHandler.java b/spring-kafka/src/main/java/org/springframework/kafka/annotation/DltHandler.java index f69c11ec..cc567ba8 100644 --- a/spring-kafka/src/main/java/org/springframework/kafka/annotation/DltHandler.java +++ b/spring-kafka/src/main/java/org/springframework/kafka/annotation/DltHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2018-2023 the original author or authors. + * Copyright 2018-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,9 +14,6 @@ * limitations under the License. */ -/** - * das - */ package org.springframework.kafka.annotation; diff --git a/spring-kafka/src/main/java/org/springframework/kafka/support/Suffixer.java b/spring-kafka/src/main/java/org/springframework/kafka/support/Suffixer.java index 85f5bce0..42787f55 100644 --- a/spring-kafka/src/main/java/org/springframework/kafka/support/Suffixer.java +++ b/spring-kafka/src/main/java/org/springframework/kafka/support/Suffixer.java @@ -1,5 +1,5 @@ /* - * Copyright 2018-2024 the original author or authors. + * Copyright 2018-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -26,6 +26,7 @@ import org.springframework.util.StringUtils; * Utility class that suffixes strings. * * @author Tomaz Fernandes + * @author Ngoc Nhan * @since 2.7 * */ @@ -42,7 +43,7 @@ public class Suffixer { if (!StringUtils.hasText(this.suffix)) { return source; } - return source != null && StringUtils.hasText(source) // Only suffix if there's text + return StringUtils.hasText(source) // Only suffix if there's text ? source.concat(this.suffix) : source; }