I’ve come across obscure import syntax while looking at some source code from Sun’s JVM implementation.
import java.awt;
From a look at the source code, this import statement appears to be importing the entire java.awt package, but the standard is to use a package wildcard: import java.awt.*;. However, the syntax of the import statement in ComponentFactory is invalid and does not compile with JDK or Eclipse.
Why would Java developers use this uncompilable syntax used, rather than the correct .* syntax? (Maybe the developers use a different compiler which supports this syntax?)
Having looked at the latest JLS (http://docs.oracle.com/javase/specs/jls/se7/html/jls-7.html#jls-7.5.1), it says:
There is no reason that the language designers are using a different version of Java. They may have some secret tools for coding and testing, they might also test on some new features (but I don’t think this is a new feature, as new features shouldn’t be released like this without any description)
I believe it is the HTML formatting that automatically eliminates all the
.*parts of import declarations.