logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Curt Arnold <carn...@apache.org>
Subject Source attribution in nteventlog.cpp (was ReL Log4j 1.2.13)
Date Sun, 19 Mar 2006 06:11:46 GMT

On Mar 18, 2006, at 6:34 PM, Mark Womack wrote:

> Forwarding to the log4j dev mailing list.
>
> -Mark
>
> ----- Original Message ----- From: "Janet Campbell"  
> <janet.campbell@eclipse.org>
> To: <pmc@logging.apache.org>
> Sent: Thursday, March 16, 2006 11:47 AM
> Subject: Log4j 1.2.13
>
>
>> Hi there,
>> In reviewing this version of Log4j for inclusion in Eclipse, I found
>> reference to material being ""// Borrowed unabashedly from the JNI
>> Programmer's Guide" in this file: /log4j/nt/nteventlog.cpp.  Could  
>> you
>> provide some background on this for me?
>> Thanks,
>> Janet Campbell
>> Manager, Intellectual Property
>> Eclipse Foundation Inc.
>> Phone:  (613) 224-9461, x.229 (GMT -5)
>> Fax:  (613) 224-5172
>> email:   <mailto:janet.campbell@eclipse.org>  
>> janet.campbell@eclipse.org
>> www.eclipse.org
>>
>

src/java/org/apache/log4j/nt/nteventlog.cpp contains two functions  
(60 code lines) that are very similar to example code in "The Java  
Native Interface: Programmer's Guide and Specification".  The book  
and sample code may be downloaded from http://java.sun.com/docs/books/ 
jni/.  The fragments have been in nteventlog.cpp from its initial  
commit on Dec 14, 2000 by Ceki and have only had trivial changes  
since the initial commit.  All page numbers are from the PDF version  
of the book.  Code from nteventlog.cpp is used to produce  
NTEventLogAppender.dll and does not contribute to the log4j.jar  
file.  Without the .dll, the org.apache.log4j.NTEventLogAppender can  
not be used but would not otherwise affect the behavior of log4j.  I  
do not know how log4j was going to be included in Eclipse, perhaps  
the DLL is not be distributed or could be omitted from the Eclipse  
distribution which would allow Eclipse to avoid any issues arising  
from the code.

JNU_ThrowByName is nearly identical to code (some variable names are  
changed) that appears in Section 6.1.2 on page 75.  JNU_ThrowByName  
is only called by the next function.   JNU_GetStringNativeChars  
appears to be identical to code that appears in Section 8.2.2. on  
page 100.  This function is called multiple times from other code  
that does not contain the reference to the JNI Programmer's Guide.   
The code for both these functions can be found in the downloadable  
examples in the chap8/NativeString directory.

The use of these code fragments appear to be accomplishing an  
unnecessary task, converting from the UTF-16 representation used by  
the Java virtual machine to the local single byte code page.  The  
need for this operation could be eliminated by calling the wide  
character forms of the Win32 API methods.  I would expect that I  
could rewrite nteventlog.cpp to use UTF-16 strings within a few hours  
which would eliminate the need of the example code.


The following LICENSE notice appears in the downloadable examples  
archive.

Copyright (c) 1999 Sun Microsystems, Inc. All Rights Reserved.

Sun grants you ("Licensee") a non-exclusive, royalty free, license to  
use,
modify and redistribute this software in source and binary code form,
provided that i) this copyright notice and license appear on all  
copies of
the software; and ii) Licensee does not utilize the software in a manner
which is disparaging to Sun.

This software is provided "AS IS," without a warranty of any kind. ALL
EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,  
INCLUDING ANY
IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN AND ITS LICENSORS SHALL  
NOT BE
LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING,  
MODIFYING
OR DISTRIBUTING THE SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN  
OR ITS
LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT,
INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES,  
HOWEVER
CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE  
USE OF
OR INABILITY TO USE SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.

This software is not designed or intended for use in on-line control of
aircraft, air traffic, aircraft navigation or aircraft  
communications; or in
the design, construction, operation or maintenance of any nuclear
facility. Licensee represents and warrants that it will not use or
redistribute the Software for such purposes.







---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


Mime
View raw message