Coin Considerations

Reinier Zwitserloot reinier at zwitserloot.com
Sun Mar 15 02:12:26 PDT 2009


No, you can do this within project coin, I think:

If there's one top-level member, or there are many, but only one is  
public (there can't be more than one public), that's the one that gets  
the real annotation. Any spin-off classes (e.g. a $1 or whatnot, or a  
top-level package-private) get a @SourceRef annotation, which contains  
a class literal that does contain the full source (the public top- 
level member).

That covers virtually all source files.

For the remaining files, which would pretty much boil down to a bunch  
of package private classes bundled up into one source file (a  
situation eclipse couldn't even handle until eclipse 3.0, which should  
go a ways to indicate how rare that is), Pick one: just toss the full  
source on each and every file, -or-, pick a random one (probably: 'the  
first member in the compilationunit') and put @SourceRef on all the  
other ones. It's sufficiently rare that I doubt it matters.

For files that have no source members at all, there are no class files  
either (package-info.java, module-info.java do have significance but  
don't produce class files AFAIK, any other .java file with 0 members  
in it is by definition empty, other than comments, and wouldn't do  
anything at all), so no @Source or @SourceRef needed.

  --Reinier Zwitserloot



On Mar 15, 2009, at 03:43, Dalibor Topic wrote:

> Neal Gafter wrote:
>> On Sat, Mar 14, 2009 at 10:47 AM, Dalibor Topic <Dalibor.Topic at sun.com 
>> > wrote:
>>> Dumping the entire source code
>>> for a file rather then subsets has the advantage that correct  
>>> licensing,
>>> javadoc and attribution information could trivially travel along  
>>> with
>>> the generated binary class file.
>>
>> Dalibor-
>>
>> There is currently no way to place an annotation on a "source file".
>> You could only annotate the individual classes found within it.  In
>> that case, I would think it surprising to find that the annotation
>> contains source for all the classes, imports, and comments in the  
>> same
>> source file.
>
> Thanks, Neal - that's a very good point. Would Package be a more  
> useful
> target for it?
>
> cheers,
> dalibor topic
>
> -- 
> *******************************************************************
> Dalibor Topic                   Tel: (+49 40) 23 646 738
> Java F/OSS Ambassador           AIM: robiladonaim
> Sun Microsystems GmbH           Mobile: (+49 177) 2664 192
> Nagelsweg 55                    http://openjdk.java.net
> D-20097 Hamburg                 mailto:Dalibor.Topic at sun.com
> Sitz der Gesellschaft: Sonnenallee 1, D-85551 Kirchheim-Heimstetten
> Amtsgericht München: HRB 161028
> Geschäftsführer: Thomas Schröder, Wolfgang Engels, Dr. Roland Bömer
> Vorsitzender des Aufsichtsrates: Martin Häring
>
>
>




More information about the coin-dev mailing list