www-legal-discuss mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Geir Magnusson Jr." <g...@pobox.com>
Subject Re: License of example code (on website)? [Was: Including code snippet in commercial software]
Date Fri, 23 Jan 2009 18:28:29 GMT
I didn't think it was actually possible to place something in the  
public domain w/o the author dying :)

Why not just follow the license?

geir

On Jan 23, 2009, at 11:40 AM, Henri Yandell wrote:

> A good question. Usually the answer is 'Your company's lawyer is the
> true target for these questions'.
>
> or that:
>
> "IANAL, The answers are in the Apache license's section 4 on
> redistribution, which I summarize as:
>
> a) LICENSE included.
> b) Note when modifying files.
> c) Maintain source header.
> d) NOTICE file included if exists (which it should). "
>
> In this case its an example on the website that is also included in
> the download (I suspect there it's got AL 2.0 headers etc there but
> haven't looked).
>
> -----
>
> Looking to the list - what are the thoughts? I personally believe in
> examples being public domain (or at least, not requiring attribution
> clauses equivalent to what Aflyctus below is proposing), but I'm not
> sure if that clashes with our charter. I think our current answer
> would be to obey section 4 of the license.
>
> Hen
>
> On Fri, Jan 23, 2009 at 8:06 AM, Aflyctus N.E.B.  
> <aflyctus@gmail.com> wrote:
>> Hello,
>>
>> I would like to include some code from an OpenEJB example in my JUnit
>> tests that use OpenEJB as an embedded Java EE 5 container.
>>
>> The example is located at:
>> http://openejb.apache.org/3.0/testing-transactions-example.html
>>
>> The code of interest is the embedded SLSB TransactionBean:
>>
>>   public static interface Caller {
>>       public <V> V call(Callable<V> callable) throws Exception;
>>   }
>>
>>   /**
>>    * This little bit of magic allows our test code to execute in
>>    * the scope of a container controlled transaction.
>>    *
>>    * The src/test/resource/META-INF/ejb-jar.xml will cause this
>>    * EJB to be automatically discovered and deployed when
>>    * OpenEJB boots up.
>>    */
>>   @Stateless
>>   @TransactionAttribute(REQUIRES_NEW)
>>   public static class TransactionBean implements Caller {
>>
>>       public <V> V call(Callable<V> callable) throws Exception {
>>           return callable.call();
>>       }
>>
>>   }
>>
>> I would like to include the above code in a Java class that all of my
>> other Java unit test classes are derived from.
>> For example,
>>
>> MySuperClass.java contains:
>>
>> /*
>> * My company's copyright notice
>> */
>>
>> package mypackage;
>>
>> import java.util.concurrent.Callable;
>> /*
>> * some other imports not shown
>> */
>>
>> public class MySuperClass
>> {
>>   /*
>>    * The following code is from:
>>    * http://openejb.apache.org/3.0/testing-transactions-example.html
>>    */
>>   public static interface Caller
>>   {
>>       public <V> V call(Callable<V> callable) throws Exception;
>>   }
>>
>>
>>   /*
>>    * The following code is from:
>>    * http://openejb.apache.org/3.0/testing-transactions-example.html
>>    */
>>
>>   /**
>>    * This little bit of magic allows our test code to execute in
>>    * the scope of a container controlled transaction.
>>    *
>>    * The src/test/resource/META-INF/ejb-jar.xml will cause this
>>    * EJB to be automatically discovered and deployed when
>>    * OpenEJB boots up.
>>    */
>>   @Stateless
>>   @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
>>   public static class TransactionBean implements Caller
>>   {
>>       public <V> V call(Callable<V> callable) throws Exception
>>       {
>>           return callable.call();
>>       }
>>   }
>> }
>>
>> MyTest.java contains:
>>
>> /*
>> * My company's copyright notice
>> */
>>
>> package mypackage;
>>
>> import org.junit.After;
>> import org.junit.AfterClass;
>> import org.junit.Before;
>> import org.junit.BeforeClass;
>> import org.junit.Test;
>> import static org.junit.Assert.*;
>>
>> public class MyTest extends MySuperClass
>> {
>>   @Before
>>   public void setUp()
>>   {
>>       /*
>>        * code to setup OpenEJB container
>>        */
>>   }
>>
>>   private void doTestMyMethod throws Exception
>>  {
>>       /* my test code */
>>   }
>>
>>   public void testMyMethod() throws Exception {
>>       Caller transactionBean = (Caller)
>> context.lookup("TransactionBeanLocal");
>>
>>       transactionBean.call(new Callable(){
>>           public Object call() throws Exception {
>>               doWork();
>>               return null;
>>           }
>>       });
>>   }
>> }
>>
>>
>> Three questions:
>> 1. How do I correctly apply the Apache 2 license to  
>> MySuperClass.java?
>> The source file already has my company's copyright notice at the top
>> of the file and contains additional company-proprietary code.
>> 2. Do I need to include a reference to the Apache 2 license in  
>> MyTest.java?
>> 3. Do I need to include a LICENSE file my software distribution?
>>
>> Thanks for the help!
>>
>> aflyctus
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: legal-discuss-unsubscribe@apache.org
>> For additional commands, e-mail: legal-discuss-help@apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: legal-discuss-unsubscribe@apache.org
> For additional commands, e-mail: legal-discuss-help@apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: legal-discuss-unsubscribe@apache.org
For additional commands, e-mail: legal-discuss-help@apache.org


Mime
View raw message