Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-306

Standardize code style for "import package.*;"

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Trivial
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.0.0-incubating
    • Component/s: None
    • Labels:
      None

      Description

      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:

      import a.b.C1;
      import a.b.C2;
      import a.b.C3;
      

      becomes

      import a.b.*;
      

      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.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                julianhyde Julian Hyde
                Reporter:
                julianhyde Julian Hyde
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: