Skip to content

Commit

Permalink
Suggested refactor in GetCommittedOffsets#getResponse
Browse files Browse the repository at this point in the history
  • Loading branch information
epalace authored and Eric Palacios committed Mar 4, 2020
1 parent 7e8c649 commit 547f38a
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions core/src/main/scala/akka/kafka/Metadata.scala
Original file line number Diff line number Diff line change
Expand Up @@ -205,11 +205,7 @@ object Metadata {
* Java API
*/
def getResponse: Optional[java.util.Map[TopicPartition, OffsetAndMetadata]] =
response
.map { m =>
Optional.of(m.asJava)
}
.getOrElse(Optional.empty())
Optional.ofNullable(response.toOption.map(_.asJava).orNull)
}

/**
Expand Down

0 comments on commit 547f38a

Please sign in to comment.