package-info

Jonathan Gibbons Jonathan.Gibbons at Sun.COM
Tue Nov 3 14:35:58 PST 2009


Andrew John Hughes wrote:
> 2009/11/3 Jonathan Gibbons <Jonathan.Gibbons at sun.com>:
>   
>> Currently, javac does not generate package-info.class when package-info.java
>> contains no annotations.
>>
>> This can cause issues for build systems that assume that for every *.java
>> file, the compiler ought to generate a corresponding *.class file.
>>
>> It appears that Ant 1.8 has apparently taken it upon itself to "work around"
>> this issue, by generating package-info.class if javac does not. Does anyone
>> have any opinions as to whether this is a good or bad idea? Is this
>> something that should really be fixed in javac, perhaps as an optional
>> behavior?
>>
>> -- Jon
>>
>>
>>
>>     
>
> What would such a class contain? Presumably it would be just an empty
> shell, with just a single no-argument constructor?
>
> The package-info.java (and module-info.java) are a bit of a hack as
> pseudo-Java classes to begin with, so it doesn't surprise me all that
> much that another hack is needed to make them indistinguishable from
> normal classes.
>   
Yes, it would presumably be an empty shell class.

-- Jon
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/compiler-dev/attachments/20091103/fcd99d06/attachment.html 


More information about the compiler-dev mailing list