Uploaded image for project: 'Accumulo'
  1. Accumulo
  2. ACCUMULO-4682

Standardize and enforce import order

    XMLWordPrintableJSON

Details

    • Task
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 1.7.4, 1.9.0
    • build
    • None

    Description

      I created a plugin to automatically format Java source files with import order rules.
      I ran and tested it on Accumulo and it worked well, aside from a few malformed files.

      http://code.revelc.net/impsort-maven-plugin/sort-mojo.html
      https://github.com/revelc/impsort-maven-plugin

      (NOTE: each group is sorted within its section)

      I tested using Eclipse default import order rules, which are:

      static *
      
      java.*
      
      javax.*
      
      org.*
      
      com.*
      
      * - everything else
      

      These are a bit unnecessary, I think. A saner and more useful ordering might be:

      static *
      
      org.apache.accumulo.*
      
      java.*
      
      javax.*
      
      * - everything else
      

      Alternatively, I do like the simplicity of:

      static *
      (with or without blank line?)
      * - everything else
      

      The plugin can handle any of these, so we just need to pick what we like.

      Attachments

        Activity

          People

            ctubbsii Christopher Tubbs
            ctubbsii Christopher Tubbs
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 0.5h
                0.5h