Fix code style in internalConsumerGroup

* Cast the result directly to int instead of using Integer.valueof method

Signed-off-by: nisanohana3 <nisana230@gmail.com>
This commit is contained in:
Nisan Ohana 2023-04-21 14:25:29 +03:00 committed by GitHub
parent 7365cfe394
commit 0e7f141abe
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -74,14 +74,12 @@ public class InternalConsumerGroup {
private static Integer calculateTopicNum(Map<TopicPartition, Long> offsets, Collection<InternalMember> members) {
long topicNum = Stream.concat(
return (int) Stream.concat(
offsets.keySet().stream().map(TopicPartition::topic),
members.stream()
.flatMap(m -> m.getAssignment().stream().map(TopicPartition::topic))
).distinct().count();
return Integer.valueOf((int) topicNum);
}
private static Collection<InternalMember> initInternalMembers(ConsumerGroupDescription description) {