[
https://issues.apache.org/jira/browse/IMPALA-7867?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16758591#comment-16758591
]
ASF subversion and git services commented on IMPALA-7867:
---------------------------------------------------------
Commit 396f542eda32dd92e80edbeb216a4cdeb7fe0ace in impala's branch
refs/heads/master from paul-rogers
[ https://gitbox.apache.org/repos/asf?p=impala.git;h=396f542 ]
IMPALA-7867 (Part 5): Collection cleanup in analyzer
Continues the work to clean up the code to:
* Use collection interfaces for variable and function declarations,
* Replace Guava newArrayList(), etc. calls with the direct
use of Java collection classes.
* Clean up unused imports and add override annotations.
This commit cleans up remaining issues in the analyzer now that the
other modules use collection interfaces.
Tests: this is purely a refactoring with no functional change. Reran
existing tests.
Change-Id: I1d1c37beb926896f5e00faab0b06034aebb835c5
Reviewed-on: http://gerrit.cloudera.org:8080/12266
Reviewed-by: Impala Public Jenkins <[email protected]>
Tested-by: Impala Public Jenkins <[email protected]>
> 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: [email protected]
For additional commands, e-mail: [email protected]