You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@impala.apache.org by "Tim Armstrong (Jira)" <ji...@apache.org> on 2019/10/07 03:47:00 UTC
[jira] [Resolved] (IMPALA-7867) Expose collection interfaces, not
implementations
[ https://issues.apache.org/jira/browse/IMPALA-7867?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Tim Armstrong resolved IMPALA-7867.
-----------------------------------
Resolution: Fixed
I think a lot of this was done. Leaving this open doesn't achieve much if noone is actively doing cleanup so I'm gonna close it.
> 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
> 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
(v8.3.4#803005)