Stefan Bodewig wrote:
Do you know whether a Java 1.4 VM will even try to load the class
file under any circumstances (other than some explicit reflection
invocations)?
You cannot use package-info.java with JDK 1.4 to begin with.
I know that. I was wondering whether there might be a situation where
JDK 1.4 would try to load the class file even though it shouldn't.
As far as I know JDK 1.4 would never try to load a package-info.class even if you called Package.getPackage, since this file was newly defined in JDK 5. I suppose if for
some reason you wrote
Class.forName("some.pkg.package-info");
in JDK 1.4 then you would get the UnsupportedClassVersionError you deserve... but this would be true of any class in the same codebase, since they would all be using the
JDK 5 bytecode format. (If you had a package-info.java, then you must have been compiling with at least -source 5, therefore at least -target 5 as well.) So I am still
puzzled by the question. I guess we can ignore it.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@ant.apache.org
For additional commands, e-mail: dev-h...@ant.apache.org