I have written a Java class Sequence
that presents a similar interface to Stream
, but with some changes. For convenience I copied the Javadoc comments from Stream
, adapting them as necessary for my own code. I have included a copyright notice (namely Oracle) for the copied comments, but I'm unsure about the licence implications. Stream
is released under GPL v2, which I understand requires that any derived work be similarly licensed. But does the GPL licence cover only the code proper, or does it also include comments? I would like to release my code under the MIT licence, but I'm unsure whether my inclusion of comments from Stream
obliges me to release it under GPL v2 instead.
2 Answers
But does the GPL licence cover only the code proper, or does it also include comments?
The GPL license is a copyright license and it applies to all parts of a project that are subject to copyright protection.
Copyright law provides copyright protection for things that are the result of a human creative process and that includes both source code, documentation and comments. There is an exception here in the form of the Merger doctrine, which states that if there is only one (or a very few limited) way to express an idea, then the expression is not copyright protected.
I would like to release my code under the MIT licence, but I'm unsure whether my inclusion of comments from
Stream
obliges me to release it under GPL v2 instead.
Unless those comments are the only way to write the needed information, copying those comments from Stream
means that you have included GPLv2 content in your project and you need to use the GPL license yourself as well.
Missing any other statement, I expect the Javadoc comments from Stream
to be under GPL as well.
One argument would be that of fair use. For example, if you included in your comment a relevant quote (e.g. from an standard). But I don't think it really fits this case.
Could you have different licenses for code and comments? I think you could, but the result is quite sketchy. Comments and code are clearly separated, so you could e.g. state that comments are available under CC-BY and code under GPL, I think there are some projects in that vein. The opposite is more peculiar. And, since code and comments will be on the same file (as opposed to having some GPL files with documentation and some different MIT files with code) it's more complicate to present to the final users.
I think you could release your whole project under GPL, with the provision that it can be used under a MIT license if they remove the comments from the code.
I would recommend to just write new comments from the ground up, though.
Stream
when writingSequence
, is it reasonable to conclude that you studiedStream
before and during the writing ofSequence
?