You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by "asdf2014 (via GitHub)" <gi...@apache.org> on 2024/06/13 08:19:17 UTC

[I] Unnecessary Option variable null check (druid)

asdf2014 opened a new issue, #16594:
URL: https://github.com/apache/druid/issues/16594

   ![image](https://github.com/apache/druid/assets/8108788/88d3a560-d945-4e71-8940-4b4712a17005)
   
   There is an unnecessary null check in this code. The line `Optional<Either<Throwable, FrameWithPartition>> lastElement = queue.peekLast();` creates an Optional object, the main purpose of which is to avoid null values. In Java 8 and later versions, the Optional class was introduced mainly to solve problems caused by null. The Optional class can help us avoid explicit null checks because an Optional object either contains a non-null value or is an empty Optional.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


Re: [I] Unnecessary Option variable null check (druid)

Posted by "cryptoe (via GitHub)" <gi...@apache.org>.
cryptoe closed issue #16594: Unnecessary Option variable null check
URL: https://github.com/apache/druid/issues/16594


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org