Viraj Jasani created HBASE-23093:
------------------------------------

             Summary: Avoid Optional Anti-Patterns
                 Key: HBASE-23093
                 URL: https://issues.apache.org/jira/browse/HBASE-23093
             Project: HBase
          Issue Type: Improvement
    Affects Versions: 3.0.0, 2.3.0, 1.6.0
            Reporter: Viraj Jasani
            Assignee: Viraj Jasani


Optional should be used as a return type only. It's a neat solution for 
handling data that might  not be present. We should avoid using Optional 
Anti-Patterns i.e. using it as a field or parameter type due to these reasons:

1. Using Optional parameters causing conditional logic inside the methods is 
not productive.

2. Packing an argument in an Optional is suboptimal for the compiler and does 
an unnecessary wrapping.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to