You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by David Valeri <dv...@apache.org> on 2012/02/07 15:02:12 UTC

Non-extensible third-party class requires copied code from ASL licensed source

I'm working on CAMEL-4987 [1] and I have a situation where a class
from Spring cannot be extended.  The class in question,
AbstractTestNGSpringContextTests [2], is a part of the Spring Test
library.  It uses an annotation that precludes extension in this use
case.  The Spring documentation indicates that extension of the class
may not always be desirable and provides guidance on implementing the
class on your own.

The class is extremely simple and does not represent a significant
maintenance issue going forward; however, in order to maintain the
functionality of the class, two methods need to be lifted as-is from
the original class.  The methods are "run" and
"springTestContextAfterTestMethod".  The methods contain about 10
lines of code that are core to the functionality of the class.  The
original class also contains a number of trivial one-line methods.
The Camel implementation would contain methods that produce similar
outcomes but are not strictly identical.

In my own code I would retain the copyright header, document
departures from the original in accordance with the ASL, and move on;
however, I realize that Apache needs to be careful about ownership of
the code.  What is the correct solution when doing this on code
intended for Apache?  I want to make sure that I can protect Apache
and also honor the license of the original code.

[1] - https://issues.apache.org/jira/browse/CAMEL-4987
[2] - http://grepcode.com/file_/repo1.maven.org/maven2/org.springframework/spring-test/3.0.7.RELEASE/org/springframework/test/context/testng/AbstractTestNGSpringContextTests.java/?v=source

-- 
David Valeri
-------------------
Twitter: DavidValeri
Blog: http://davidvaleri.wordpress.com/

Re: Non-extensible third-party class requires copied code from ASL licensed source

Posted by Christian Müller <ch...@gmail.com>.
Hello Valeri!

Don't worry, you didn't waste my time. I also learned a few thinks. Jeff
"kicked me" ;o) to work a bit hard to find a solution and asked for this
kind of questions.

And by the way, Roy's answer was (only for the next time when we don't find
a better solution...):



From: Roy T. Fielding <fi...@gbiv.com>
Date: Fri, Feb 24, 2012 at 11:14 PM
Subject: Re: Non-extensible third-party class requires copied code from ASL
licensed source
To: board@apache.org

You can just copy the code, keep the old license headers and any
copyright notices, be sure that any required notice from their end
is placed in NOTICE, and then change the interface names to be clear
that this is a different implementation.  Make sure that the origin
and original license is noted in the commit to our repository.

Generally speaking, copy and paste (in reasonable amounts) from
other Apache-licensed sources is okay as long as we respect the
original author's wishes and do not pretend to "take over" their
code.  In other words, just obey their license and change the names
to not conflict with the original developer's version.

....Roy



Best,
Christian

Re: Non-extensible third-party class requires copied code from ASL licensed source

Posted by David Valeri <dv...@gmail.com>.
Christian,

I was reviewing the Spring code again to answer your questions and I think I arrived at a solution that won't require copying.  I misunderstood the inheritance mechanism used by Spring with respect to their testing related annotations and I have found an acceptable compromise solution for dealing with the fact that the super class precludes custom initialization of some member variables.

With these two developments, I can avoid needing to duplicate any of the Spring code in the Camel sub-class.  Sorry I wasted your time, but your questions helped me to reevaluate the situation.  Thanks for your help!

David Valeri
-------------------
Twitter: DavidValeri
Blog: http://davidvaleri.wordpress.com/
FuseSource: http://fusesource.com

On Feb 26, 2012, at 5:32 PM, Christian Müller wrote:

> Hi David!
> 
> Here are some questions:
> - What's exactly the problem to subclass this class?
> - Is it really necessary to copy the code or is it possible to create a own
> class that is very similar?
> - In which package this class will be live (org.apache.camel.xxx or
> com.springframework.yyy)?
> 
> Best,
> Christian
> 
> On Tue, Feb 7, 2012 at 3:02 PM, David Valeri <dv...@apache.org> wrote:
> 
>> I'm working on CAMEL-4987 [1] and I have a situation where a class
>> from Spring cannot be extended.  The class in question,
>> AbstractTestNGSpringContextTests [2], is a part of the Spring Test
>> library.  It uses an annotation that precludes extension in this use
>> case.  The Spring documentation indicates that extension of the class
>> may not always be desirable and provides guidance on implementing the
>> class on your own.
>> 
>> The class is extremely simple and does not represent a significant
>> maintenance issue going forward; however, in order to maintain the
>> functionality of the class, two methods need to be lifted as-is from
>> the original class.  The methods are "run" and
>> "springTestContextAfterTestMethod".  The methods contain about 10
>> lines of code that are core to the functionality of the class.  The
>> original class also contains a number of trivial one-line methods.
>> The Camel implementation would contain methods that produce similar
>> outcomes but are not strictly identical.
>> 
>> In my own code I would retain the copyright header, document
>> departures from the original in accordance with the ASL, and move on;
>> however, I realize that Apache needs to be careful about ownership of
>> the code.  What is the correct solution when doing this on code
>> intended for Apache?  I want to make sure that I can protect Apache
>> and also honor the license of the original code.
>> 
>> [1] - https://issues.apache.org/jira/browse/CAMEL-4987
>> [2] -
>> http://grepcode.com/file_/repo1.maven.org/maven2/org.springframework/spring-test/3.0.7.RELEASE/org/springframework/test/context/testng/AbstractTestNGSpringContextTests.java/?v=source
>> 
>> --
>> David Valeri
>> -------------------
>> Twitter: DavidValeri
>> Blog: http://davidvaleri.wordpress.com/
>> 












Re: Non-extensible third-party class requires copied code from ASL licensed source

Posted by Christian Müller <ch...@gmail.com>.
Hi David!

Here are some questions:
- What's exactly the problem to subclass this class?
- Is it really necessary to copy the code or is it possible to create a own
class that is very similar?
- In which package this class will be live (org.apache.camel.xxx or
com.springframework.yyy)?

Best,
Christian

On Tue, Feb 7, 2012 at 3:02 PM, David Valeri <dv...@apache.org> wrote:

> I'm working on CAMEL-4987 [1] and I have a situation where a class
> from Spring cannot be extended.  The class in question,
> AbstractTestNGSpringContextTests [2], is a part of the Spring Test
> library.  It uses an annotation that precludes extension in this use
> case.  The Spring documentation indicates that extension of the class
> may not always be desirable and provides guidance on implementing the
> class on your own.
>
> The class is extremely simple and does not represent a significant
> maintenance issue going forward; however, in order to maintain the
> functionality of the class, two methods need to be lifted as-is from
> the original class.  The methods are "run" and
> "springTestContextAfterTestMethod".  The methods contain about 10
> lines of code that are core to the functionality of the class.  The
> original class also contains a number of trivial one-line methods.
> The Camel implementation would contain methods that produce similar
> outcomes but are not strictly identical.
>
> In my own code I would retain the copyright header, document
> departures from the original in accordance with the ASL, and move on;
> however, I realize that Apache needs to be careful about ownership of
> the code.  What is the correct solution when doing this on code
> intended for Apache?  I want to make sure that I can protect Apache
> and also honor the license of the original code.
>
> [1] - https://issues.apache.org/jira/browse/CAMEL-4987
> [2] -
> http://grepcode.com/file_/repo1.maven.org/maven2/org.springframework/spring-test/3.0.7.RELEASE/org/springframework/test/context/testng/AbstractTestNGSpringContextTests.java/?v=source
>
> --
> David Valeri
> -------------------
> Twitter: DavidValeri
> Blog: http://davidvaleri.wordpress.com/
>

Re: Non-extensible third-party class requires copied code from ASL licensed source

Posted by Christian Müller <ch...@gmail.com>.
Hello David!

Thanks for your work and taking care of the copyrights. At present, I don't
know what the right solution is, but I will figure it out. Give me some
time to clarify it (because Spring is also licensed with ASL 2.0, it should
be solvable).

Best,
Christian

On Tue, Feb 7, 2012 at 3:02 PM, David Valeri <dv...@apache.org> wrote:

> I'm working on CAMEL-4987 [1] and I have a situation where a class
> from Spring cannot be extended.  The class in question,
> AbstractTestNGSpringContextTests [2], is a part of the Spring Test
> library.  It uses an annotation that precludes extension in this use
> case.  The Spring documentation indicates that extension of the class
> may not always be desirable and provides guidance on implementing the
> class on your own.
>
> The class is extremely simple and does not represent a significant
> maintenance issue going forward; however, in order to maintain the
> functionality of the class, two methods need to be lifted as-is from
> the original class.  The methods are "run" and
> "springTestContextAfterTestMethod".  The methods contain about 10
> lines of code that are core to the functionality of the class.  The
> original class also contains a number of trivial one-line methods.
> The Camel implementation would contain methods that produce similar
> outcomes but are not strictly identical.
>
> In my own code I would retain the copyright header, document
> departures from the original in accordance with the ASL, and move on;
> however, I realize that Apache needs to be careful about ownership of
> the code.  What is the correct solution when doing this on code
> intended for Apache?  I want to make sure that I can protect Apache
> and also honor the license of the original code.
>
> [1] - https://issues.apache.org/jira/browse/CAMEL-4987
> [2] -
> http://grepcode.com/file_/repo1.maven.org/maven2/org.springframework/spring-test/3.0.7.RELEASE/org/springframework/test/context/testng/AbstractTestNGSpringContextTests.java/?v=source
>
> --
> David Valeri
> -------------------
> Twitter: DavidValeri
> Blog: http://davidvaleri.wordpress.com/
>