dev@glassfish.java.net

Re: pom change review request (long but simple)

From: Bill Shannon <bill.shannon_at_sun.com>
Date: Thu, 17 Sep 2009 16:12:52 -0700

Ken Cavanaugh wrote:
> Bill Shannon wrote:
>> The copyright situation is a mess. I've complained about this to
>> Abhijit several times, still no action.
>>
>> *Many* files have completely the wrong license, or worse yet no copyright
>> or license at all.
>>
>> No one seems to update the copyright year when they modify a file,
>> like they should.
>>
> And I think we all know that no one ever will, at least not consistently.
> But this sort of problem is very amenable to a tools solution.
>
> I already have a copyright header checking/updating tool that I use
> in CORBA. A variant of the same tool is also used in Metro, and is
> available as the license-tool project on java.net. The tool runs quickly:
> on my current machine (3 Core AMD/2.8 GHz/8 GB RAM) it processes
> around 1000 files/second.
>
> It should be fairly easy in most revision control systems to extract the
> year in which a file was last updated. For example, in mercurial using
> CORBA as an example (this is in
> src/share/classes/com/sun/corba/se/spi/transport):
>
> > hg log CorbaAcceptor.java | grep changeset:
>
> changeset: 324:34a977b07ae0
> changeset: 300:e2b177d79942
> changeset: 0:0fc818f2f9e5
>
> > hg log -r 324 | grep date
>
> date: Thu Aug 27 13:59:49 2009 -0700
>
> So we can extract the year of the last change, and while updating the
> file header,
> insert the correct year. Gluing this together in a shell script is easy
> enough, and I'd
> imagine something similar is possible in svn.
>
> Putting this all together, you could easily have a Hudson job that fixed
> everything up
> automatically that can be run whenever desired in the release cycle.
> The tool
> can also be run as a copyright header validator.

The date should be checked/updated on every commit. Even if the tool is
fast, I'm not sure I'd want it automatically introducing future conflicts
into my files.

Right now we need to update all the files to have the correct license and
at least this year's copyright date. Getting the right license on each
file can be complicated.

Once that's done having a tool to detect and report missing updates would
be helpful, although I fear people wouldn't pay any more attention to it
than they do to the FindBugs reminders they get.

Maybe this is something that Jane and/or Terena can work on, perhaps with
some help from some of us?