[
https://issues.apache.org/jira/browse/OPTIQ-306?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14039999#comment-14039999
]
Julian Hyde commented on OPTIQ-306:
-----------------------------------
I could live with that. We should apply this standard when we re-organize
packages. It should be sufficient to add a checkstyle AvoidStarImport directive
http://checkstyle.sourceforge.net/config_imports.html.
I also propose that we use the order in the google style guide:
1. All static imports in a single group
2. org.apache.optiq imports (if this source file is in the org.apache.optiq
package space)
3. Third-party imports, one group per top-level package, in ASCII sort order
for example: com, junit, org, sun
4. java imports
5. javax imports
> Standardize code style for "import package.*;"
> ----------------------------------------------
>
> Key: OPTIQ-306
> URL: https://issues.apache.org/jira/browse/OPTIQ-306
> Project: optiq
> Issue Type: Improvement
> Reporter: Julian Hyde
> Priority: Trivial
>
> Our house style does not specify whether/when imports are to be converted to
> stars. I propose that imports should be converted to stars if there are more
> than 3 from the same package. Thus:
> {code}
> import a.b.C1;
> import a.b.C2;
> import a.b.C3;
> {code}
> becomes
> {code}
> import a.b.*;
> {code}
> when {{a.b.C4}} is added. This is consistent with IntelliJ's default rule.
> It is OK to use stars if there are 3 or fewer uses. Thus removing the use of
> {{a.b.C2}} would not require imports to be changed.
> Checkstyle has a rule to ban star imports (excluding certain packages) but
> does not allow them to be limited to a particular number.
--
This message was sent by Atlassian JIRA
(v6.2#6252)