Skip to content

wildcard imports are not expanded #113

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

Closed
ash-owl opened this issue Jan 14, 2017 · 4 comments
Closed

wildcard imports are not expanded #113

ash-owl opened this issue Jan 14, 2017 · 4 comments

Comments

@ash-owl
Copy link

ash-owl commented Jan 14, 2017

Running java -jar google-java-format-1.2-all-deps.jar Test.java where Test.java contains

import java.util.*;

class Test {
  List a;
}

results in the following output:

import java.util.*;

class Test {
  List a;
}

but the expected output is:

import java.util.List;

class Test {
  List a;
}
@kevinb9n
Copy link
Contributor

This is out of scope for a source code formatter. Note it would require access to your entire compilation classpath to work correctly.

@ash-owl
Copy link
Author

ash-owl commented Jan 16, 2017

Fair enough, but are the unenforceable rules of https://google.github.io/styleguide/javaguide.html documented anywhere? For example checkstyle has this: http://checkstyle.sourceforge.net/google_style.html

@r4fterman
Copy link

Hi @kevinb9n,
your comment contradicts the project documentation.

This is out of scope for a source code formatter. Note it would require access to your entire compilation classpath to work correctly.

Documentation says that this plugin takes care of code formatting and import optimization:

When enabled, it will replace the normal Reformat Code and Optimize Imports actions.

So I would assume that imports are handled correctly according to the Google Code Style.

Regars, Roman

@DidierLoiseau
Copy link

When enabled, it will replace the normal Reformat Code and Optimize Imports actions.

Oh, so this is why it breaks IntelliJ’s default import optimization, which would take care of this properly!

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

No branches or pull requests

4 participants