Skip to content

Commit e30f771

Browse files
authored
MINOR: Code cleanup in server module (#22026)
Fix no-op String.join and Javadoc Reviewers: Mickael Maison <mickael.maison@gmail.com>
1 parent acd37fc commit e30f771

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

server/src/main/java/org/apache/kafka/server/FetchSession.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ public class FetchSession {
9090

9191
static String partitionsToLogString(Collection<TopicIdPartition> partitions, boolean traceEnabled) {
9292
return traceEnabled
93-
? "(" + String.join(", ", partitions.toString()) + ")"
93+
? partitions.toString()
9494
: partitions.size() + " partition(s)";
9595
}
9696

server/src/main/java/org/apache/kafka/server/FetchSessionCacheShard.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ Meter evictionsMeter() {
118118
* Get a session by session ID.
119119
*
120120
* @param sessionId The session ID.
121-
* @return The session, or None if no such session was found.
121+
* @return The session, or an empty Optional if no such session was found.
122122
*/
123123
synchronized Optional<FetchSession> get(int sessionId) {
124124
return Optional.ofNullable(sessions.get(sessionId));
@@ -243,7 +243,7 @@ synchronized Optional<FetchSession> remove(int sessionId) {
243243
*
244244
* @param session The session.
245245
*
246-
* @return The removed session, or None if there was no such session.
246+
* @return The removed session, or an empty Optional if there was no such session.
247247
*/
248248
synchronized Optional<FetchSession> remove(FetchSession session) {
249249
EvictableKey evictableKey;

0 commit comments

Comments
 (0)