Synopsis: | Fully qualify imports. |
Language: | Java |
Severity Level: | 5 |
Category: | ImportStatement |
Description: |
When you want to use class Bar from package foo,there are two possible ways to import it:
import foo.*; Pros: Potentially reduces the number of import statements.
import foo.Bar; Pros: Makes it obvious what classes are actually used. Makes code more readable for maintainers. Decision: Use the latter for importing all Android code. An explicit exception is made for java standard libraries (java.util.*, java.io.*, etc.) and unit test code (junit.framework.*) |
Literature References: |
Google Android Guidelines |