Re: turning off AN error message



Dale King wrote:
A copyright annotation is even one of the examples in documentation for annotations. You can even have the annotation specify the default value so that the copyright text appears in only one place:

So how about something like this:

@Retention( RetentionPolicy.CLASS )
public @interface CopyrightCanadianMindProducts
{
    String text()
       dafault "copyright (c) 1998-2005 Roedy Green, "
             + "Canadian Mind Products, http://mindprod.com";;
}

So then to use it:

@CopyrightCanadianMindProducts
public class RoedysClass
{ ... }

When 2006 rolls around and you want to update the dates you only have to update the one piece of text.

Nice trick. I wonder, though: this will have the effect of embedding the full copyright notice in class files. But does it protect the source itself as well as the low-tech one-string-per-sourcefile technique does?


IANAL and all that.

--
Henry Townsend
.