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

ASF subversion and git services commented on IMPALA-7867:
---------------------------------------------------------

Commit 32fc07b50c24496510eaf280573c75aac7d43f99 in impala's branch 
refs/heads/master from Paul Rogers
[ https://git-wip-us.apache.org/repos/asf?p=impala.git;h=32fc07b ]

IMPALA-7867 (Part 3): ArrayList cleanup in planner

Continues the work to tidy up uses of ArrayList, HashMap and HashSet,
this time in the planner package and its dependencies. Changed the code
to follow standard Java practice: use base interfaces for method and
variable declarations, specific subclasses when creating objects.

Replaced trivial uses of Guava newFoo() methods with direct object
creation such as new ArrayList<>() as recommended by Guava. Fixed
trivial warnings such as unused imports and missing @Override. Removed
constuctor type parameters when the compiler can infer them.

Testing: this is a pure source change, no functional changes. Ran the
pre-review tests to verify no regressions.

Change-Id: I9597428c69173b43fbc3cb26027ad257f2d8fccb
Reviewed-on: http://gerrit.cloudera.org:8080/12094
Reviewed-by: Impala Public Jenkins <impala-public-jenk...@cloudera.com>
Tested-by: Impala Public Jenkins <impala-public-jenk...@cloudera.com>


> Expose collection interfaces, not implementations
> -------------------------------------------------
>
>                 Key: IMPALA-7867
>                 URL: https://issues.apache.org/jira/browse/IMPALA-7867
>             Project: IMPALA
>          Issue Type: Improvement
>          Components: Frontend
>    Affects Versions: Impala 3.0
>            Reporter: Paul Rogers
>            Assignee: Paul Rogers
>            Priority: Minor
>
> When using Java collections, a common Java best practice is to expose the 
> collection interface, but hide the implementation choice. This pattern allows 
> us to start with a generic implementation (an {{ArrayList}}, say), but evolve 
> to a more specific implementation to achieve certain goals (a {{LinkedList}} 
> or {{ImmutableList}}, say.)
> For whatever reason, the Impala FE code exposes {{ArrayList}}, {{HashMap}} 
> and other implementation choices as variable types and in method signatures.
> This ticket tracks a gradual process of revising the declarations and 
> signatures to use the interfaces {{List}} instead of the implementation 
> {{ArrayList}}.
> Also, the FE code appears to predate Java 7, so that declarations of lists 
> tend to be in one of two forms (with or without Guava):
> {code:java}
> foo1 = new ArrayList<Bar>();
> foo2 = Lists.newArrayList();
> {code}
> Since Java 7, the preferred form is:
> {code:java}
> foo = new ArrayList<>();
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-all-unsubscr...@impala.apache.org
For additional commands, e-mail: issues-all-h...@impala.apache.org

Reply via email to