The best common organization of imports between the two that I could come
up with is:

import statics
<blank line>
import java
<blank line>
import javax
<blank line>
import everything else
<blank line>
import com.gemfire.* (which will eventually change to org.apache.geode.*)

I updated both Eclipse and IntelliJ and experimented to confirm they both
now produce the above results. I then exported both formatters and
discovered that when Eclipse exports the Formatter xml file, it doesn't
contain the configuration for organizing imports. Under Java | Code Style |
Formatter you have to export a dedicated *.importorder file which contains
the configuration for organizing imports.

So we now have these three files under /etc:

eclipseFormatterProfile.xml
eclipseOrganizeImports.importorder
intellijIdeaCodeStyle.xml

If you want to use Eclipse, you need to import two files. Import
eclipseFormatterProfile.xml
under Preferences | Java | Code Style | Formatter by clicking Import and
then select "Apache Geode" as your Active profile. Next import
eclipseOrganizeImports.importorder under Preferences | Java | Code Style |
Organize Imports by clicking Import.

If you want to use IntelliJ, you only need to import the one file. Import
intellijIdeaCodeStyle.xml under Preferences | Java by clicking Manage and
then select "Apache Geode".
Please try this out to be sure you're using the latest configuration for
organizing imports. If you have any problems, let me know!

Thanks,
Kirk


On Thu, Jun 9, 2016 at 3:28 PM, Jens Deppe <jde...@pivotal.io> wrote:

> +1 What Bruce said.
>
> On Thu, Jun 9, 2016 at 12:24 PM, Bruce Schuchardt <bschucha...@pivotal.io>
> wrote:
>
> > +1
> > I have no preference but would like them to be the same
> >
> >
> > Le 6/9/2016 à 11:24 AM, Udo Kohlmeyer a écrit :
> >
> >> I really don't have a preference in regards to import formatting, as
> long
> >> as Eclipse and Intellij do the same thing.
> >>
> >> --Udo
> >>
> >>
> >> On 10/06/2016 3:54 am, Kirk Lund wrote:
> >>
> >>> Sorry this is such a mess. Please vote on how you want it to work and
> >>> then
> >>> after everyone finishes voting, I'll update both to be the same as each
> >>> other.
> >>>
> >>> -Kirk
> >>>
> >>>
> >>> On Thu, Jun 9, 2016 at 10:53 AM, Kirk Lund <kl...@pivotal.io> wrote:
> >>>
> >>> The Eclipse formatter has now been updated to match the IntelliJ
> >>>> formatter
> >>>> as closely as possible. Below is detailed descriptions of the changes:
> >>>>
> >>>> 1) rename Eclipse formatter Profile Name from GemFire to Geode
> >>>>
> >>>> 2) update Organize Imports to following order:
> >>>>
> >>>> all unmatched static imports
> >>>> <blank line>
> >>>> java imports
> >>>> <blank line>
> >>>> javax imports
> >>>> <blank line>
> >>>> all unmatched type imports
> >>>> <blank line>
> >>>> batterytest.* (hydra)
> >>>> <blank line>
> >>>> cacheRunner.* (hydra)
> >>>> <blank line>
> >>>> hydra.* (hydra)
> >>>> <blank line>
> >>>> parReg.* (hydra)
> >>>> <blank line>
> >>>> perffmwk.* (hydra)
> >>>> <blank line>
> >>>> com.gemstone.* (geode/gemfire code)
> >>>> <blank line>
> >>>> com.vmware.gemfire.* (geode/gemfire code)
> >>>> <blank line>
> >>>> io.pivotal.geode.* (geode/gemfire code)
> >>>>
> >>>> (each of the above groups are separated by one blank line -- this is
> >>>> same
> >>>> as before)
> >>>>
> >>>> The changes to the IntelliJ formatter:
> >>>>
> >>>> 1) rename IntelliJ formatter from gemfireCodeStyleScheme to
> >>>> geodeCodeStyleScheme
> >>>>
> >>>> 2) update Import Layout to following order:
> >>>>
> >>>> Import static all other imports
> >>>> <blank line>
> >>>> import java.*
> >>>> import javax.*
> >>>> <blank line>
> >>>> import all other imports
> >>>> <blank line>
> >>>> import batterytest.*
> >>>> import cacheRunner.*
> >>>> import hydra.*
> >>>> import parReg.*
> >>>> import perffmwk.*
> >>>> <blank line>
> >>>> import com.gemstone.*
> >>>> import com.vmware.gemfire.*
> >>>> import io.pivotal.geode.*
> >>>>
> >>>> I prefer the IntelliJ import layout, BUT I couldn't perfectly control
> >>>> where the <blank lines> are inserted in the Eclipse formatter.
> >>>> Apparently
> >>>> every block of related imports just automatically gets surrounded by a
> >>>> <blank line>.
> >>>>
> >>>> Should we import <blank line> between every block in IntelliJ to match
> >>>> Eclipse?
> >>>>
> >>>> -Kirk
> >>>>
> >>>>
> >>>>
> >>
> >
>

Reply via email to