[ 
https://issues.apache.org/jira/browse/HBASE-19682?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16317690#comment-16317690
 ] 

Appy commented on HBASE-19682:
------------------------------

I see that when return type is List, there can be lot of gotchas and there's no 
point to assume anything, i buy all your points above.
I was just saying that if we can update to a better return type to avoid all 
those gotchas, that'll be nice. For eg, see getCarryingSystemTables in the 
example.patch.

When making the change myself, came across two things:
Actually, we can't change ByteRangeUtils since it's Public interface 
([ref|http://hbase.apache.org/book.html#hbase.client.api.surface]).
Also we can't simply change ProtobufUtil since those fns get used by public 
apis. Either we can leave that file for now, or update the return value 
semantics in the corresponding public APIs' javadocs. Upto you. I'd prefer 
first one.

> Use Collections.emptyList() For Empty List Values
> -------------------------------------------------
>
>                 Key: HBASE-19682
>                 URL: https://issues.apache.org/jira/browse/HBASE-19682
>             Project: HBase
>          Issue Type: Improvement
>          Components: hbase
>    Affects Versions: 3.0.0
>            Reporter: BELUGA BEHR
>            Assignee: BELUGA BEHR
>            Priority: Minor
>         Attachments: HBASE-19682.1.patch, HBASE-19682.2.patch, 
> HBASE-19682.3.1.patch, example.patch
>
>
> Use {{Collection.emptyList()}} for returning an empty list instead of 
> {{return new ArrayList<> ()}}.  The default constructor creates a buffer of 
> size 10 for _ArrayList_ therefore, returning this static value saves on some 
> memory and GC pressure and saves time not having to allocate a new internally 
> buffer for each instantiation.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to