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

Zhihong Ted Yu commented on HBASE-6431:
---------------------------------------

{code}
-  private List<Filter> filters = new ArrayList<Filter>();
+  private ArrayList<Filter> filters = new ArrayList<Filter>();
{code}
Can we preserve List<> type for filters field ? That is generic.
{code}
   public FilterList(final List<Filter> rowFilters) {
-    this.filters = rowFilters;
+    this.filters = new ArrayList<Filter>(rowFilters);
{code}
Please check whether rowFilters is already ArrayList<>.
{code}
-    this.filters = Arrays.asList(rowFilters);
+    this.filters = new ArrayList<Filter>(Arrays.asList(rowFilters));
{code}
Why is the above needed ?
See http://www.docjar.com/html/api/java/util/Arrays.java.html:
{code}
2827       public static <T> List<T> asList(T... a) {
 2828           return new ArrayList<>(a);
{code}
                
> Some FilterList Constructors break addFilter
> --------------------------------------------
>
>                 Key: HBASE-6431
>                 URL: https://issues.apache.org/jira/browse/HBASE-6431
>             Project: HBase
>          Issue Type: Bug
>          Components: filters
>    Affects Versions: 0.92.1, 0.94.0
>            Reporter: Alex Newman
>            Assignee: Alex Newman
>            Priority: Minor
>         Attachments: 
> 0001-HBASE-6431.-Some-FilterList-Constructors-break-addFi.patch
>
>
> Some of the constructors for FilterList set the internal list of filters to 
> list types which don't support the add operation. As a result 
> FilterList(final List<Filter> rowFilters)
> FilterList(final Filter... rowFilters)
> FilterList(final Operator operator, final List<Filter> rowFilters)
> FilterList(final Operator operator, final Filter... rowFilters)
> may init private List<Filter> filters = new ArrayList<Filter>(); incorrectly.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to