views:

63

answers:

4

I have an open source project, licensed under the Apache license 2.0. In the appendix of this document, Apache explains how to apply the license to your code. Among other things, it says to include the year in each source file.

When creating a new file, I put in the current year. But when should I update the year?

  • Never?
  • When I change the file (and the year has changed since the last update)?
  • On January 1st, 0:01?

Also, if I do update the year, do I leave the initial year intact (like 2009-2010), or do I replace it?

+4  A: 

This is less important that having the copyright statement itself.

Do a find and replace once a year if you are perfectionnist.

However you should always have the start date. It will determine WHEN you applied the copyright.

More on the subject:

http://www.contentious.com/2007/01/07/copyright-notice-is-the-year-really-necessary/

Pierre 303
+2  A: 

The usual practice is to update the list of years each time the file is modified (but never remove a year). So the following is not unusual:

Copyright 2000, 2003, 2005-2006 J. Programmer

I'm not a lawyer - and if you're concerned you should consult one! - but I believe the reason for this is that, when you create the file, it is treated as a work (and has copyright for a period starting from that year). If you later update the file, then that is treated as a derivative work, for a period starting from the later date (but the unmodified parts are still only protected from the original date).

psmears
A: 

You need to update the year in which the modification of the file has taken place.

For example you have Sample.java, the copyright will look like:

/*
 * Copyright (c) 2005, 2010 Blah, Inc. and its suppliers.
 * All rights reserved.
 */

This means, the file has been created/modified in the years 2005 and 2010. If you modify this file in the next 3 years consecutively, then the copyright will look like:

/*
 * Copyright (c) 2005, 2010-2013 Blah, Inc. and its suppliers.
 * All rights reserved.
 */
pavanlimo
+1  A: 

You should add the current year to the list of copyright years if and only if you make a copyrightable change to the file. Trivial patches like adding null pointer checks and the like are generally considered to not be copyrightable. Many projects have an explicit policy of requiring an assignment of copyright for patches over a certain length threshold (generally around 20 lines) because it is assumed that anything that long probably represents at least a slight amount of creative thought. You should also never remove any listed copyright years.

Chris