Author: desruisseaux
Date: Thu Sep 20 19:56:50 2018
New Revision: 1841511

URL: http://svn.apache.org/viewvc?rev=1841511&view=rev
Log:
IP review on Log4JLogger.

Added:
    sis/ip-review/Log4JLogger.xhtml
    sis/ip-review/Log4JLoggerFactory.xhtml
    sis/ip-review/rev/25012/Log4JLogger.xhtml
    sis/ip-review/rev/27876/Log4JLogger.xhtml
    sis/ip-review/rev/27876/Log4JLoggerFactory.xhtml

Added: sis/ip-review/Log4JLogger.xhtml
URL: 
http://svn.apache.org/viewvc/sis/ip-review/Log4JLogger.xhtml?rev=1841511&view=auto
==============================================================================
--- sis/ip-review/Log4JLogger.xhtml (added)
+++ sis/ip-review/Log4JLogger.xhtml Thu Sep 20 19:56:50 2018
@@ -0,0 +1,49 @@
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml";>
+  <head>
+    <meta charset="UTF-8"/>
+    <title>Log4JLogger history</title>
+    <style type="text/css" media="all">
+      @import url("./reports.css");
+    </style>
+  </head>
+  <body>
+    <div>
+      <h1>Log4JLogger history</h1>
+  <p>Click on the commit message for inspecting the <code>diff</code> and how 
the code has been rewritten.</p>
+<p><b>Command line:</b></p>
+<blockquote><code>svn log -r31996:1 
http://svn.osgeo.org/geotools/trunk/modules/library/metadata/src/main/java/org/geotools/util/logging/Log4JLogger.java</code></blockquote>
+<table>
+  <tr>
+    <th>Rev.</th>
+    <th>Date</th>
+    <th>Author</th>
+    <th class="last">Message</th>
+  </tr>
+<tr><td 
class="rev">30937</td><td>2008-07-07</td><td>acuster</td><td>Graduation: 
affiliate Saul Farber with MassGIS</td></tr>
+<tr><td class="rev">30640</td><td>2008-06-12</td><td>acuster</td><td>Copyright 
headers: lib/metadata, this time with feeling (and the el in Toolkit)</td></tr>
+<tr><td class="rev">30637</td><td>2008-06-12</td><td>acuster</td><td>Copyright 
headers: lib/metadata, now normalized to LGPL v2.1 only</td></tr>
+<tr><td class="rev">30519</td><td>2008-06-05</td><td>acuster</td><td>Metadata 
header cleanup and copyright review.</td></tr>
+<tr><td class="rev">30258</td><td>2008-05-08</td><td>acuster</td><td>Reshuffle 
the top level repo: drop uDig, move up trunk, tags, and branches.</td></tr>
+<tr><td class="rev">30257</td><td>2008-05-08</td><td>acuster</td><td>Move 
trunk/gt/ directory contents up to trunk/ and drop gt</td></tr>
+<tr><td class="rev">28922</td><td>2008-01-24</td><td>acuster</td><td>Bump the 
(at)since version to 2.5 since WKTParser was cut from 2.4</td></tr>
+<tr><td class="rev">28540</td><td>2007-12-29</td><td>acuster</td><td>Hide 
buttons which are not yet used</td></tr>
+<tr><td class="rev">27890</td><td>2007-11-14</td><td>desruisseaux</td><td>When 
Commons-logging or Log4J is not in the classpath, tries to throw a checked 
ClassNotFoundException early instead of a unchecked NoClassDefFoundError late 
(when a message is first logged, which may be long after the 
setLoggerFactory(...) call).</td></tr>
+<tr><td class="rev">27876</td><td>2007-11-13</td><td 
class="unav">aaime</td><td><a href="rev/27876/Log4JLogger.xhtml">Removed 
LoggingFramework, made LoggerFactory subclasses public, fixed logging level 
mapping</a></td></tr>
+<tr><td 
class="rev">27850</td><td>2007-11-12</td><td>desruisseaux</td><td>Replaced 
switch statement by a simplier method call using toLog4JLevel (suggested by 
Andrea). I should increase the chances of consistent behavior.</td></tr>
+<tr><td 
class="rev">27847</td><td>2007-11-12</td><td>desruisseaux</td><td>Replaced some 
references to 'org.geotools.util' by references to 'org.geotools.util.logging'. 
Removed the old classes to make sure that there is no more accidental 
references. Note that the old classes will not be removed from the 2.4 
branch.</td></tr>
+<tr><td 
class="rev">27840</td><td>2007-11-11</td><td>desruisseaux</td><td>Added 
Log4JLogger and more tests.</td></tr>
+<tr><td 
class="rev">27838</td><td>2007-11-11</td><td>desruisseaux</td><td>Completed a 
CommonLogger; should work but not yet extensively tested. A Log4J logger need 
to be done.</td></tr>
+<tr><td 
class="rev">27794</td><td>2007-11-07</td><td>desruisseaux</td><td>Refactored 
CommonHandler as CommonLogger.</td></tr>
+<tr><td 
class="rev">27500</td><td>2007-10-15</td><td>desruisseaux</td><td>First round 
of Java 5 generic types applied to org.geotools.resources and org.geotools.util 
packages. As a side effect, removed the deprecated 
org.geotools.resources.TestData class (moved to org.geotools.test).</td></tr>
+<tr><td 
class="rev">25823</td><td>2007-06-13</td><td>desruisseaux</td><td>Cleanup and 
javadoc update.</td></tr>
+<tr><td 
class="rev">25193</td><td>2007-04-18</td><td>desruisseaux</td><td>Fixed some 
typos in metadata revealed by the new ISOTest. First draft of hints review 
(still in process).</td></tr>
+<tr><td class="rev">25012</td><td>2007-04-04</td><td 
class="unav">saul.farber</td><td><a href="rev/25012/Log4JLogger.xhtml">Fixes 
for http://jira.codehaus.org/browse/GEOT-1202 and 
http://jira.codehaus.org/browse/GEOT-1220</a></td></tr>
+<tr><td 
class="rev">22443</td><td>2006-10-27</td><td>desruisseaux</td><td>Splitted 
referencing, extracting metadata in their own module (GEOT-983). As a side 
effect, replaced some calls of CRSUtilities.foo(...) by CRS.foo(...).</td></tr>
+<tr><td 
class="rev">22327</td><td>2006-10-23</td><td>desruisseaux</td><td>GEOT-982: 
regroup 'module', 'plugin', 'ext' and 'unsupported' in a common 
directory.</td></tr>
+<tr><td 
class="rev">22315</td><td>2006-10-22</td><td>desruisseaux</td><td>Reorganisation
 of directory tree structure (GEOT-982) phase 1: moved 'src' to 
'src/main/java'.</td></tr>
+<tr><td 
class="rev">21735</td><td>2006-10-01</td><td>desruisseaux</td><td>Added a way 
to redirect java logging to Apache commons logging.</td></tr>
+</table>
+    </div>
+  </body>
+</html>

Added: sis/ip-review/Log4JLoggerFactory.xhtml
URL: 
http://svn.apache.org/viewvc/sis/ip-review/Log4JLoggerFactory.xhtml?rev=1841511&view=auto
==============================================================================
--- sis/ip-review/Log4JLoggerFactory.xhtml (added)
+++ sis/ip-review/Log4JLoggerFactory.xhtml Thu Sep 20 19:56:50 2018
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml";>
+  <head>
+    <meta charset="UTF-8"/>
+    <title>Log4JLoggerFactory history</title>
+    <style type="text/css" media="all">
+      @import url("./reports.css");
+    </style>
+  </head>
+  <body>
+    <div>
+      <h1>Log4JLoggerFactory history</h1>
+  <p>Click on the commit message for inspecting the <code>diff</code> and how 
the code has been rewritten.</p>
+<p><b>Command line:</b></p>
+<blockquote><code>svn log -r31996:1 
http://svn.osgeo.org/geotools/trunk/modules/library/metadata/src/main/java/org/geotools/util/logging/Log4JLoggerFactory.java</code></blockquote>
+<table>
+  <tr>
+    <th>Rev.</th>
+    <th>Date</th>
+    <th>Author</th>
+    <th class="last">Message</th>
+  </tr>
+<tr><td class="rev">30640</td><td>2008-06-12</td><td>acuster</td><td>Copyright 
headers: lib/metadata, this time with feeling (and the el in Toolkit)</td></tr>
+<tr><td class="rev">30637</td><td>2008-06-12</td><td>acuster</td><td>Copyright 
headers: lib/metadata, now normalized to LGPL v2.1 only</td></tr>
+<tr><td class="rev">30519</td><td>2008-06-05</td><td>acuster</td><td>Metadata 
header cleanup and copyright review.</td></tr>
+<tr><td class="rev">30258</td><td>2008-05-08</td><td>acuster</td><td>Reshuffle 
the top level repo: drop uDig, move up trunk, tags, and branches.</td></tr>
+<tr><td class="rev">30257</td><td>2008-05-08</td><td>acuster</td><td>Move 
trunk/gt/ directory contents up to trunk/ and drop gt</td></tr>
+<tr><td class="rev">28922</td><td>2008-01-24</td><td>acuster</td><td>Bump the 
(at)since version to 2.5 since WKTParser was cut from 2.4</td></tr>
+<tr><td class="rev">28540</td><td>2007-12-29</td><td>acuster</td><td>Hide 
buttons which are not yet used</td></tr>
+<tr><td class="rev">27890</td><td>2007-11-14</td><td>desruisseaux</td><td>When 
Commons-logging or Log4J is not in the classpath, tries to throw a checked 
ClassNotFoundException early instead of a unchecked NoClassDefFoundError late 
(when a message is first logged, which may be long after the 
setLoggerFactory(...) call).</td></tr>
+<tr><td class="rev">27876</td><td>2007-11-13</td><td 
class="unav">aaime</td><td><a href="rev/27876/Log4JLoggerFactory.xhtml">Removed 
LoggingFramework, made LoggerFactory subclasses public, fixed logging level 
mapping</a></td></tr>
+<tr><td class="rev">27874</td><td>2007-11-13</td><td 
class="unav">aaime</td><td><a href="rev/27876/Log4JLoggerFactory.xhtml">Removed 
LoggingFramework, made LoggerFactory subclasses public, fixed logging level 
mapping</a></td></tr>
+</table>
+    </div>
+  </body>
+</html>

Added: sis/ip-review/rev/25012/Log4JLogger.xhtml
URL: 
http://svn.apache.org/viewvc/sis/ip-review/rev/25012/Log4JLogger.xhtml?rev=1841511&view=auto
==============================================================================
--- sis/ip-review/rev/25012/Log4JLogger.xhtml (added)
+++ sis/ip-review/rev/25012/Log4JLogger.xhtml Thu Sep 20 19:56:50 2018
@@ -0,0 +1,206 @@
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml";>
+  <head>
+    <meta charset="UTF-8"/>
+    <title>Log4JLogger changes for revisions 25011:25012</title>
+    <style type="text/css" media="all">
+      @import url("../../reports.css");
+    </style>
+  </head>
+  <body>
+    <div>
+      <h1>Log4JLogger changes for revisions 25011:25012</h1>
+<p>
+  The checks for log levels has been replaced by a different code based on a 
<code>switch</code> statement.
+  The <code>publish</code> method edited by this commit has been removed.
+  The <code>formatMessage</code> method added by this commit has been removed.
+</p>
+<p><b>Command line:</b></p>
+<blockquote><code>svn diff --extensions "--unified --ignore-space-change 
--ignore-all-space --ignore-eol-style" -r25011:25012 
http://svn.osgeo.org/geotools/trunk/modules/library/metadata/src/main/java/org/geotools/util/logging/Log4JLogger.java</code></blockquote>
+<table class="changes">
+<tr><th>Revision 25011</th><th>Revision 25012</th></tr>
+<tr><td><pre>// J2SE dependencies
+import java.util.Map;
+import java.util.HashMap;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import java.util.logging.Handler;</pre></td>
+<td><pre>// J2SE dependencies
+import java.util.Map;
+import java.util.HashMap;
+<span class="add">import java.util.logging.Formatter;</span>
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import java.util.logging.Handler;</pre></td></tr>
+<tr><td><pre> * The Apache's log created up to date.
+ */
+private final Map/*&lt;String,Log&gt;*/ loggers = new HashMap();
+<span class="del"></span>
+/**
+ * Creates a new handler.
+ *
+ * @param name   The name of the root logger.</pre></td>
+<td><pre> * The Apache's log created up to date.
+ */
+private final Map/*&lt;String,Log&gt;*/ loggers = new HashMap();
+/**
+<span class="add"> * The logger the handler is forwarding for.</span>
+<span class="add"> */</span>
+<span class="add">private final Log logger;</span>
+<span class="add">/**</span>
+ * Creates a new handler.
+ *
+ * @param name   The name of the root logger.</pre></td></tr>
+<tr><td><pre>     * than the setting performed by the 'getLog' method for 
child loggers.
+     */
+    loggers.put(name, logger);
+}
+
+/**</pre></td>
+<td><pre>     * than the setting performed by the 'getLog' method for child 
loggers.
+     */
+    loggers.put(name, logger);
+<span class="add">    this.logger = logger;</span>
+}
+
+/**</pre></td></tr>
+<tr><td><pre>assert !(log instanceof Jdk14Logger);
+loggers.put(name, log);
+final Level level;
+<span class="del">if (log.isErrorEnabled()) {</span>
+<span class="del">    level = Level.SEVERE;</span>
+} else if (log.isWarnEnabled()) {
+    level = Level.WARNING;
+<span class="del">} else if (log.isInfoEnabled()) {</span>
+<span class="del">    level = Level.INFO;</span>
+<span class="del">} else if (log.isDebugEnabled()) {</span>
+<span class="del">    level = Level.FINE;</span>
+<span class="del">} else if (log.isTraceEnabled()) {</span>
+<span class="del">    level = Level.FINER;</span>
+} else {
+<span class="del">    level = Level.FINEST;</span>
+}
+final Logger logger = Logger.getLogger(name);
+removeAllHandlers(logger);</pre></td>
+<td><pre>assert !(log instanceof Jdk14Logger);
+loggers.put(name, log);
+final Level level;
+<span class="add">if (log.isTraceEnabled()) {</span>
+<span class="add">    level = Level.FINEST;</span>
+<span class="add">} else if (log.isDebugEnabled()) {</span>
+<span class="add">    level = Level.FINER;</span>
+<span class="add">} else if (log.isInfoEnabled()) {</span>
+<span class="add">   level = Level.CONFIG;</span>
+} else if (log.isWarnEnabled()) {
+    level = Level.WARNING;
+<span class="add">} else if (log.isErrorEnabled()) {</span>
+<span class="add">   level = Level.SEVERE;</span>
+<span class="add">} else if (log.isFatalEnabled()) {</span>
+<span class="add">   level = Level.SEVERE;</span>
+} else {
+<span class="add">   level = Level.OFF;</span>
+}
+final Logger logger = Logger.getLogger(name);
+removeAllHandlers(logger);</pre></td></tr>
+<tr><td><pre> * Send the specified record to Apache's commons-logging 
framework.
+ */
+public void publish(final LogRecord record) {
+<span class="del">    final Log       log       = 
getLog(record.getLoggerName());</span>
+    final int       level     = record.getLevel().intValue();
+<span class="del">    final String    message   = record.getMessage();</span>
+    final Throwable throwable = record.getThrown();
+<span class="del">    if (level &gt;= Level.SEVERE.intValue()) {</span>
+        if (throwable != null) {
+            log.error(message, throwable);
+        } else {</pre></td>
+<td><pre> * Send the specified record to Apache's commons-logging framework.
+ */
+public void publish(final LogRecord record) {
+<span class="add">    final Log       log       = record.getLoggerName() != 
null ?</span>
+<span class="add">        getLog(record.getLoggerName()) : logger;</span>
+    final int       level     = record.getLevel().intValue();
+<span class="add">    final String    message   = formatMessage( record 
);</span>
+    final Throwable throwable = record.getThrown();
+<span class="add"></span>
+<span class="add">    if (level == Level.OFF.intValue() ) {</span>
+<span class="add">        return;</span>
+<span class="add">    } else if (level &gt;= Level.SEVERE.intValue()) {</span>
+        if (throwable != null) {
+            log.error(message, throwable);
+        } else {</pre></td></tr>
+<tr><td><pre>    } else {
+        log.warn(message);
+    }
+<span class="del">} else if (level &gt;= Level.INFO.intValue()) {</span>
+    if (throwable != null) {
+        log.info(message, throwable);
+    } else {
+        log.info(message);
+    }
+<span class="del">} else if (level &gt;= Level.FINE.intValue()) {</span>
+    if (throwable != null) {
+        log.debug(message, throwable);
+    } else {</pre></td>
+<td><pre>    } else {
+        log.warn(message);
+    }
+<span class="add">} else if (level &gt;= Level.CONFIG.intValue() ) {</span>
+    if (throwable != null) {
+        log.info(message, throwable);
+    } else {
+        log.info(message);
+    }
+<span class="add">} else if (level &gt;= Level.FINER.intValue() ) {</span>
+    if (throwable != null) {
+        log.debug(message, throwable);
+    } else {</pre></td></tr>
+<tr><td><pre>}
+
+/**
+ * Flush this handler. The default implementation does nothing.
+ */
+public void flush() {</pre></td>
+<td><pre>}
+
+/**
+<span class="add"> * Copied from {@link Formatter#formatMessage(LogRecord)} to 
support i18n.</span>
+<span class="add"> */</span>
+<span class="add">public synchronized String formatMessage(LogRecord record) 
{</span>
+<span class="add">    String format = record.getMessage();</span>
+<span class="add">    java.util.ResourceBundle catalog = 
record.getResourceBundle();</span>
+<span class="add">   if (catalog != null) {</span>
+<span class="add">           try {</span>
+<span class="add">               format = 
catalog.getString(record.getMessage());</span>
+<span class="add">           } catch (java.util.MissingResourceException ex) 
{</span>
+<span class="add">         // Drop through.  Use record message as 
format</span>
+<span class="add">         format = record.getMessage();</span>
+<span class="add">     }</span>
+<span class="add"></span>
+<span class="add">   }</span>
+<span class="add">   // Do the formatting.</span>
+<span class="add">   try {</span>
+<span class="add">       Object parameters[] = record.getParameters();</span>
+<span class="add">       if (parameters == null || parameters.length == 0) 
{</span>
+<span class="add">     // No parameters.  Just return format string.</span>
+<span class="add">     return format;</span>
+<span class="add">       }</span>
+<span class="add">       // Is is a java.text style format?</span>
+<span class="add">       if (format.indexOf("{0") &gt;= 0) {</span>
+<span class="add">           return java.text.MessageFormat.format(format, 
parameters);</span>
+<span class="add">       }</span>
+<span class="add">       return format;</span>
+<span class="add"></span>
+<span class="add">   } catch (Exception ex) {</span>
+<span class="add">       // Formatting failed: use localized format 
string.</span>
+<span class="add">       return format;</span>
+<span class="add">   }</span>
+<span class="add">}</span>
+<span class="add"></span>
+<span class="add">/**</span>
+ * Flush this handler. The default implementation does nothing.
+ */
+public void flush() {</pre></td></tr>
+</table>
+    </div>
+  </body>
+</html>

Added: sis/ip-review/rev/27876/Log4JLogger.xhtml
URL: 
http://svn.apache.org/viewvc/sis/ip-review/rev/27876/Log4JLogger.xhtml?rev=1841511&view=auto
==============================================================================
--- sis/ip-review/rev/27876/Log4JLogger.xhtml (added)
+++ sis/ip-review/rev/27876/Log4JLogger.xhtml Thu Sep 20 19:56:50 2018
@@ -0,0 +1,164 @@
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml";>
+  <head>
+    <meta charset="UTF-8"/>
+    <title>Log4JLogger changes for revisions 27875:27876</title>
+    <style type="text/css" media="all">
+      @import url("../../reports.css");
+    </style>
+  </head>
+  <body>
+    <div>
+      <h1>Log4JLogger changes for revisions 27875:27876</h1>
+<p>
+  The first part of this commit changes the verbosity level by 1: 
<code>FINEST</code> messages become <code>FINER</code>
+  and <code>FINER</code> messages become <code>FINE</code>.
+  This change has been kept.
+  What we are keeping is the functionality (changes in verbosity level);
+  there is no way to keep this functionality without reproducing the same code 
changes as in this commit,
+  unless we change also all the code surrounding the modified lines.
+</p><p>
+  The second part of this commit is just moving the <code>Factory</code> to a 
public class.
+</p>
+
+<p><b>Command line:</b></p>
+<blockquote><code>svn diff --extensions "--unified --ignore-space-change 
--ignore-all-space --ignore-eol-style" -r27875:27876 
http://svn.osgeo.org/geotools/trunk/modules/library/metadata/src/main/java/org/geotools/util/logging/Log4JLogger.java</code></blockquote>
+<table class="changes">
+<tr><th>Revision 27875</th><th>Revision 27876</th></tr>
+<tr><td><pre>package org.geotools.util.logging;
+
+import java.util.logging.Level;
+<span class="del">import java.util.logging.Logger;</span>
+
+
+/**</pre></td>
+<td><pre>package org.geotools.util.logging;
+
+import java.util.logging.Level;
+
+
+/**</pre></td></tr>
+<tr><td><pre>/**
+ * The Log4J logger to use.
+ */
+<span class="del">private final org.apache.log4j.Logger logger;</span>
+
+/**
+ * Creates a new logger.</pre></td>
+<td><pre>/**
+ * The Log4J logger to use.
+ */
+<span class="add">final org.apache.log4j.Logger logger;</span>
+
+/**
+ * Creates a new logger.</pre></td></tr>
+<tr><td><pre>        case  8:                                         // INFO
+        case  7: return org.apache.log4j.Level.INFO;     // CONFIG
+        case  6:                                         // (not allocated)
+<span class="del">        case  5:                                         // 
FINE</span>
+<span class="del">        case  4: return org.apache.log4j.Level.DEBUG;    // 
FINER</span>
+<span class="del">        case  3: return org.apache.log4j.Level.TRACE;    // 
FINEST</span>
+        case  2:                                         // (not allocated)
+        case  1:                                         // (not allocated)
+<span class="del">        case  0: return org.apache.log4j.Level.OFF;      // 
OFF</span>
+    }
+}</pre></td>
+<td><pre>        case  8:                                         // INFO
+        case  7: return org.apache.log4j.Level.INFO;     // CONFIG
+        case  6:                                         // (not allocated)
+<span class="add">        case  5: return org.apache.log4j.Level.DEBUG;    // 
FINE</span>
+<span class="add">        case  4: return org.apache.log4j.Level.TRACE;    // 
FINER</span>
+<span class="add">        case  3:                                         // 
FINEST</span>
+        case  2:                                         // (not allocated)
+        case  1:                                         // (not allocated)
+<span class="add">        case  0: return org.apache.log4j.Level.ALL;      // 
ALL</span>
+    }
+}</pre></td></tr>
+<tr><td><pre>    if (n &gt;= org.apache.log4j.Level.ERROR_INT) return 
Level.SEVERE;
+    if (n &gt;= org.apache.log4j.Level.WARN_INT)  return Level.WARNING;
+    if (n &gt;= org.apache.log4j.Level.INFO_INT)  return Level.CONFIG;
+<span class="del">    if (n &gt;= org.apache.log4j.Level.DEBUG_INT) return 
Level.FINER;</span>
+<span class="del">    if (n &gt;= org.apache.log4j.Level.TRACE_INT) return 
Level.FINEST;</span>
+    if (n == org.apache.log4j.Level.ALL_INT)   return Level.ALL; // Really ==, 
not &gt;=.
+}
+return Level.OFF;</pre></td>
+<td><pre>    if (n &gt;= org.apache.log4j.Level.ERROR_INT) return Level.SEVERE;
+    if (n &gt;= org.apache.log4j.Level.WARN_INT)  return Level.WARNING;
+    if (n &gt;= org.apache.log4j.Level.INFO_INT)  return Level.CONFIG;
+<span class="add">    if (n &gt;= org.apache.log4j.Level.DEBUG_INT) return 
Level.FINE;</span>
+<span class="add">    if (n &gt;= org.apache.log4j.Level.TRACE_INT) return 
Level.FINER;</span>
+    if (n == org.apache.log4j.Level.ALL_INT)   return Level.ALL; // Really ==, 
not &gt;=.
+}
+return Level.OFF;</pre></td></tr>
+<tr><td><pre>    public void fine   (String message) {logger.debug(message);}
+    public void finer  (String message) {logger.debug(message);}
+    public void finest (String message) {logger.trace(message);}
+<span class="del"></span>
+<span class="del"></span>
+<span class="del"></span>
+<span class="del"></span>
+<span class="del">    /**</span>
+<span class="del">     * Factory for {@link Log4JLogger}.</span>
+<span class="del">     *</span>
+<span class="del">     * @since 2.4</span>
+<span class="del">     * @source $URL$</span>
+<span class="del">     * @version $Id$</span>
+<span class="del">     * @author Martin Desruisseaux</span>
+<span class="del">     */</span>
+<span class="del">    static final class Factory extends LoggerFactory {</span>
+<span class="del">        /**</span>
+<span class="del">         * The unique instance of this factory.</span>
+<span class="del">         */</span>
+<span class="del">        private static Factory factory;</span>
+<span class="del"></span>
+<span class="del">        /**</span>
+<span class="del">         * Do not allows more than instantiation of this 
class.</span>
+<span class="del">         */</span>
+<span class="del">        private Factory() {</span>
+        }
+<span class="del"></span>
+<span class="del">        /**</span>
+<span class="del">         * Returns the unique instance of this 
factory.</span>
+<span class="del">         */</span>
+<span class="del">        public static synchronized Factory getInstance() 
{</span>
+<span class="del">            if (factory == null) {</span>
+<span class="del">                factory = new Factory();</span>
+<span class="del">            }</span>
+<span class="del">            return factory;</span>
+<span class="del">        }</span>
+<span class="del"></span>
+<span class="del">        /**</span>
+<span class="del">         * Returns the implementation to use for the logger 
of the specified name,</span>
+<span class="del">         * or {@code null} if the logger would delegates to 
Java logging anyway.</span>
+<span class="del">         */</span>
+<span class="del">        protected Object getImplementation(final String 
name) {</span>
+<span class="del">            return 
org.apache.log4j.Logger.getLogger(name);</span>
+<span class="del">        }</span>
+<span class="del"></span>
+<span class="del">        /**</span>
+<span class="del">         * Wraps the specified {@linkplain 
#getImplementation implementation} in a Java logger.</span>
+<span class="del">         */</span>
+<span class="del">        protected Logger wrap(String name, Object 
implementation) throws ClassCastException {</span>
+<span class="del">            return new Log4JLogger(name, 
(org.apache.log4j.Logger) implementation);</span>
+<span class="del">        }</span>
+<span class="del"></span>
+<span class="del">        /**</span>
+<span class="del">         * Returns the {@linkplain #getImplementation 
implementation} wrapped by the specified logger,</span>
+<span class="del">         * or {@code null} if none.</span>
+<span class="del">         */</span>
+<span class="del">        protected Object unwrap(final Logger logger) {</span>
+<span class="del">            if (logger instanceof Log4JLogger) {</span>
+<span class="del">                return ((Log4JLogger) logger).logger;</span>
+<span class="del">            }</span>
+<span class="del">            return null;</span>
+<span class="del">        }</span>
+<span class="del">    }</span>
+<span class="del">}</span></pre></td>
+<td><pre>public void fine   (String message) {logger.debug(message);}
+public void finer  (String message) {logger.debug(message);}
+public void finest (String message) {logger.trace(message);}
+    }</pre></td></tr>
+</table>
+    </div>
+  </body>
+</html>

Added: sis/ip-review/rev/27876/Log4JLoggerFactory.xhtml
URL: 
http://svn.apache.org/viewvc/sis/ip-review/rev/27876/Log4JLoggerFactory.xhtml?rev=1841511&view=auto
==============================================================================
--- sis/ip-review/rev/27876/Log4JLoggerFactory.xhtml (added)
+++ sis/ip-review/rev/27876/Log4JLoggerFactory.xhtml Thu Sep 20 19:56:50 2018
@@ -0,0 +1,153 @@
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml";>
+  <head>
+    <meta charset="UTF-8"/>
+    <title>Log4JLoggerFactory changes for revisions 27873:27876</title>
+    <style type="text/css" media="all">
+      @import url("../../reports.css");
+    </style>
+  </head>
+  <body>
+    <div>
+      <h1>Log4JLoggerFactory changes for revisions 27873:27876</h1>
+      <p>This is a verbatim copy of code written in 
<code>Log4JLogger</code>.</p>
+<p><b>Command line:</b></p>
+<blockquote><code>svn diff --extensions "--unified --ignore-space-change 
--ignore-all-space --ignore-eol-style" -r27873:27876 
http://svn.osgeo.org/geotools/trunk/modules/library/metadata/src/main/java/org/geotools/util/logging/Log4JLoggerFactory.java</code></blockquote>
+<table class="changes">
+<tr><th>Revision 27873</th><th>Revision 27876</th></tr>
+<tr><td><pre>
+<span class="del">/**</span>
+<span class="del"> * Factory for {@link Log4JLogger}.</span>
+<span class="del"> *</span>
+<span class="del"> * @since 2.4</span>
+<span class="del"> * @source $URL$</span>
+<span class="del"> * @version $Id$</span>
+<span class="del"> * @author Martin Desruisseaux</span>
+<span class="del"> */</span>
+<span class="del">static final class Factory extends LoggerFactory {</span>
+<span class="del">    /**</span>
+<span class="del">     * The unique instance of this factory.</span>
+<span class="del">     */</span>
+<span class="del">    private static Factory factory;</span>
+<span class="del"></span>
+<span class="del">    /**</span>
+<span class="del">     * Do not allows more than instantiation of this 
class.</span>
+<span class="del">     */</span>
+<span class="del">    private Factory() {</span>
+<span class="del">    }</span>
+<span class="del"></span>
+<span class="del">    /**</span>
+<span class="del">     * Returns the unique instance of this factory.</span>
+<span class="del">     */</span>
+<span class="del">    public static synchronized Factory getInstance() {</span>
+<span class="del">        if (factory == null) {</span>
+<span class="del">            factory = new Factory();</span>
+<span class="del">        }</span>
+<span class="del">        return factory;</span>
+<span class="del">    }</span>
+<span class="del"></span>
+<span class="del">    /**</span>
+<span class="del">     * Returns the implementation to use for the logger of 
the specified name,</span>
+<span class="del">     * or {@code null} if the logger would delegates to Java 
logging anyway.</span>
+<span class="del">     */</span>
+<span class="del">    protected Object getImplementation(final String name) 
{</span>
+<span class="del">        return 
org.apache.log4j.Logger.getLogger(name);</span>
+<span class="del">    }</span>
+<span class="del"></span>
+<span class="del">    /**</span>
+<span class="del">     * Wraps the specified {@linkplain #getImplementation 
implementation} in a Java logger.</span>
+<span class="del">     */</span>
+<span class="del">    protected Logger wrap(String name, Object 
implementation) throws ClassCastException {</span>
+<span class="del">        return new Log4JLogger(name, 
(org.apache.log4j.Logger) implementation);</span>
+<span class="del">    }</span>
+<span class="del"></span>
+<span class="del">    /**</span>
+<span class="del">     * Returns the {@linkplain #getImplementation 
implementation} wrapped by the specified logger,</span>
+<span class="del">     * or {@code null} if none.</span>
+<span class="del">     */</span>
+<span class="del">    protected Object unwrap(final Logger logger) {</span>
+<span class="del">        if (logger instanceof Log4JLogger) {</span>
+<span class="del">            return ((Log4JLogger) logger).logger;</span>
+<span class="del">        }</span>
+<span class="del">        return null;</span>
+<span class="del">    }</span>
+<span class="del">}</span></pre></td>
+<td><pre><span class="add">/*</span>
+<span class="add"> *    GeoTools - OpenSource mapping toolkit</span>
+<span class="add"> *    http://geotools.org</span>
+<span class="add"> *    (C) 2007, Geotools Project Managment Committee 
(PMC)</span>
+<span class="add"> *</span>
+<span class="add"> *    This library is free software; you can redistribute it 
and/or</span>
+<span class="add"> *    modify it under the terms of the GNU Lesser General 
Public</span>
+<span class="add"> *    License as published by the Free Software Foundation; 
either</span>
+<span class="add"> *    version 2.1 of the License, or (at your option) any 
later version.</span>
+<span class="add"> *</span>
+<span class="add"> *    This library is distributed in the hope that it will 
be useful,</span>
+<span class="add"> *    but WITHOUT ANY WARRANTY; without even the implied 
warranty of</span>
+<span class="add"> *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
See the GNU</span>
+<span class="add"> *    Lesser General Public License for more details.</span>
+<span class="add"> */</span>
+<span class="add">package org.geotools.util.logging;</span>
+<span class="add"></span>
+<span class="add">import java.util.logging.Logger;</span>
+<span class="add"></span>
+<span class="add">/**</span>
+<span class="add"> * Factory for {@link Log4JLogger}.</span>
+<span class="add"> *</span>
+<span class="add"> * @since 2.4</span>
+<span class="add"> * @source $URL$</span>
+<span class="add"> * @version $Id$</span>
+<span class="add"> * @author Martin Desruisseaux</span>
+<span class="add"> */</span>
+<span class="add">public final class Log4JLoggerFactory extends LoggerFactory 
{</span>
+<span class="add">    /**</span>
+<span class="add">     * The unique instance of this factory.</span>
+<span class="add">     */</span>
+<span class="add">    private static Log4JLoggerFactory factory;</span>
+<span class="add"></span>
+<span class="add">    /**</span>
+<span class="add">     * Do not allows more than instantiation of this 
class.</span>
+<span class="add">     */</span>
+<span class="add">    private Log4JLoggerFactory() {</span>
+<span class="add">    }</span>
+<span class="add"></span>
+<span class="add">    /**</span>
+<span class="add">     * Returns the unique instance of this factory.</span>
+<span class="add">     */</span>
+<span class="add">    public static synchronized Log4JLoggerFactory 
getInstance() {</span>
+<span class="add">        if (factory == null) {</span>
+<span class="add">            factory = new Log4JLoggerFactory();</span>
+<span class="add">        }</span>
+<span class="add">        return factory;</span>
+<span class="add">    }</span>
+<span class="add"></span>
+<span class="add">    /**</span>
+<span class="add">     * Returns the implementation to use for the logger of 
the specified name,</span>
+<span class="add">     * or {@code null} if the logger would delegates to Java 
logging anyway.</span>
+<span class="add">     */</span>
+<span class="add">    protected Object getImplementation(final String name) 
{</span>
+<span class="add">        return 
org.apache.log4j.Logger.getLogger(name);</span>
+<span class="add">    }</span>
+<span class="add"></span>
+<span class="add">    /**</span>
+<span class="add">     * Wraps the specified {@linkplain #getImplementation 
implementation} in a Java logger.</span>
+<span class="add">     */</span>
+<span class="add">    protected Logger wrap(String name, Object 
implementation) throws ClassCastException {</span>
+<span class="add">        return new Log4JLogger(name, 
(org.apache.log4j.Logger) implementation);</span>
+<span class="add">    }</span>
+<span class="add"></span>
+<span class="add">    /**</span>
+<span class="add">     * Returns the {@linkplain #getImplementation 
implementation} wrapped by the specified logger,</span>
+<span class="add">     * or {@code null} if none.</span>
+<span class="add">     */</span>
+<span class="add">    protected Object unwrap(final Logger logger) {</span>
+<span class="add">        if (logger instanceof Log4JLogger) {</span>
+<span class="add">            return ((Log4JLogger) logger).logger;</span>
+<span class="add">        }</span>
+<span class="add">        return null;</span>
+<span class="add">    }</span>
+<span class="add">}</span></pre></td></tr>
+</table>
+    </div>
+  </body>
+</html>


Reply via email to