Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

intellij-java-google-style.xml puts static imports last #26

Open
GoogleCodeExporter opened this issue Mar 24, 2015 · 2 comments
Open

intellij-java-google-style.xml puts static imports last #26

GoogleCodeExporter opened this issue Mar 24, 2015 · 2 comments

Comments

@GoogleCodeExporter
Copy link

According to 

http://google-styleguide.googlecode.com/svn/trunk/javaguide.html#s3.3.3-import-o
rdering-and-spacing

"Import statements are divided into the following groups, in this order, with 
each group separated by a single blank line:
1. All static imports in a single group ..."

static imports should come first. But in intellij-java-google-style.xml they 
are listed as last:

https://code.google.com/p/google-styleguide/source/browse/trunk/intellij-java-go
ogle-style.xml#251

Steps to reproduce
1. Open the attached Test.java in IntelliJ
2. In IntelliJ IDEA, do Reformat Code (CTRL+ALT+L on Windows)
3. Check "Organize Import" and "Rearrange Entries"
4. Click OK

What is the expected output? 

package test;

import static java.lang.System.out;

import java.text.NumberFormat;

public class Test {

    public void test() {
      out.println(NumberFormat.getInstance().format(Math.PI));
    }
}


What do you see instead?

package test;

import java.text.NumberFormat;

import static java.lang.System.out;

public class Test {

    public void test() {
      out.println(NumberFormat.getInstance().format(Math.PI));
    }
}

What version of the product are you using? 

* r134 of intellij-java-google-style.xml
* IntelliJ IDEA 13.03
* JRE 1.7.0_40-b43 x86

On what operating system?
* Windows 7 Enterprise (V 6.1 SP1)

Please provide any additional information below.

I attached the corrected intellij-java-google-style.xml to places the static 
imports first as per the code style.

Original issue reported on code.google.com by [email protected] on 8 Jul 2014 at 5:39

Attachments:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant