This is not the real purpose, but I'm using them as a workaround to avoid recompilation of the package-info.java files.
The problem is that javac
(and the Ant task <javac>
) creates no class file for the package-info.java if there is only documentation (the reason for their existence) and the package bla;
statement, and that the ant task recompiles every file for which there is no (or an older) corresponding .class
file.
Adding a dummy annotation there (like SuppressWarnings
) had the effect that a package-info.class
is produced and thus the file is not recompiled until changed again.
(Ant 1.8.0 solved this by creating an empty package-info.class, even if there was no annotation, but I'm using an older ant
here.)