commit | 47b6b617f273c2a2afb1383c9bf9169a17fb5295 | [log] [tgz] |
---|---|---|
author | cushon <cushon@google.com> | Tue Mar 07 16:26:15 2017 -0800 |
committer | Liam Miller-Cushon <cushon@google.com> | Thu Mar 09 18:09:19 2017 -0800 |
tree | 601dc071c3c2d7f7f84480a689f35eea1b553ff6 | |
parent | 380bc49f5e970358308acc8dc9e0f60b8cd5bcdf [diff] |
Support non-canonical static type imports The JLS permits static type imports to refer to types using non-canonical names, e.g. `java.util.Map.Entry` can be resolved from either of these imports: import static java.util.HashMap.Entry; import static java.util.HashMap.*; Historically this feature has not been well-supported by javac [1][2][3][4], it is bad style [5][6], and a vanishingly small amount of real world code uses it. Nevertherless, it's in the spec. [1] https://bugs.openjdk.java.net/browse/JDK-8056066 [2] https://bugs.openjdk.java.net/browse/JDK-8148131 [3] https://bugs.openjdk.java.net/browse/JDK-8075274 [4] https://bugs.openjdk.java.net/browse/JDK-6863462 [5] https://google.github.io/styleguide/javaguide.html#s3.3.4-import-class-not-static [6] https://google.github.io/styleguide/javaguide.html#s3.3.1-wildcard-imports MOE_MIGRATED_REVID=149482043