You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sis.apache.org by de...@apache.org on 2015/07/09 15:31:01 UTC
svn commit: r1690101 [3/3] - in /sis/branches/JDK7: ./
core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/
core/sis-metadata/src/main/java/org/apache/sis/io/wkt/
core/sis-metadata/src/main/java/org/apache/sis/metadata/
core/sis-metadata/s...
Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gml/SC_VerticalCRS.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gml/SC_VerticalCRS.java?rev=1690101&r1=1690100&r2=1690101&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gml/SC_VerticalCRS.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gml/SC_VerticalCRS.java [UTF-8] Thu Jul 9 13:31:00 2015
@@ -116,7 +116,7 @@ public class SC_VerticalCRS extends Prop
*/
@XmlAnyElement(lax = true)
public Object getElement() {
- Context.warningOccured(Context.current(), Context.LOGGER, SC_VerticalCRS.class, "getElement",
+ Context.warningOccured(Context.current(), SC_VerticalCRS.class, "getElement",
Errors.class, Errors.Keys.MissingRequiredModule_1, "sis-referencing");
return null;
}
Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gml/TM_Primitive.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gml/TM_Primitive.java?rev=1690101&r1=1690100&r2=1690101&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gml/TM_Primitive.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gml/TM_Primitive.java [UTF-8] Thu Jul 9 13:31:00 2015
@@ -119,7 +119,7 @@ public final class TM_Primitive extends
* TemporalPrimitive as the source class, since it is the closest we can get
* to a public API.
*/
- Context.warningOccured(context, Context.LOGGER, TemporalPrimitive.class,
+ Context.warningOccured(context, TemporalPrimitive.class,
"setTimePeriod", Errors.class, Errors.Keys.IllegalRange_2, begin, end);
} else try {
metadata = TemporalUtilities.createPeriod(begin, end);
Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/system/DelayedExecutor.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/system/DelayedExecutor.java?rev=1690101&r1=1690100&r2=1690101&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/system/DelayedExecutor.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/system/DelayedExecutor.java [UTF-8] Thu Jul 9 13:31:00 2015
@@ -176,7 +176,7 @@ public final class DelayedExecutor exten
// Probably the 'killAll' method has been invoked.
// We need to test 'isKillRequested()' below.
} catch (Throwable exception) {
- Logging.unexpectedException(getClass(), "run", exception);
+ Logging.unexpectedException(Logging.getLogger(Loggers.SYSTEM), getClass(), "run", exception);
}
if (isKillRequested()) {
queue.clear();
Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/system/Modules.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/system/Modules.java?rev=1690101&r1=1690100&r2=1690101&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/system/Modules.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/system/Modules.java [UTF-8] Thu Jul 9 13:31:00 2015
@@ -19,8 +19,17 @@ package org.apache.sis.internal.system;
/**
* Constants related to SIS modules management.
- * This class contains the OSGi module symbolic names, as declared in the {@code Bundle-SymbolicName}
- * entry of the {@code META-INF/MANIFEST.MF} file in each JAR files.
+ * The constants in this class are used for two purposes:
+ *
+ * <ul>
+ * <li>OSGi module symbolic names, as declared in the {@code Bundle-SymbolicName} entry of the
+ * {@code META-INF/MANIFEST.MF} file in each JAR files.</li>
+ *
+ * <li>Logger names for "module-wide" messages, or when the message to log does not fit in a more
+ * accurate category. Note that other logger names are listed in the {@link Loggers} class.</li>
+ * </ul>
+ *
+ * Each constant should be the name of the main package of its corresponding module.
*
* @author Martin Desruisseaux (Geomatys)
* @since 0.3
@@ -31,7 +40,7 @@ public final class Modules {
/**
* The {@value} module name.
*/
- public static final String UTILITIES = "org.apache.sis.utility";
+ public static final String UTILITIES = "org.apache.sis.util";
/**
* The {@value} module name.
@@ -68,7 +77,7 @@ public final class Modules {
public static final int MINOR_VERSION = 6;
/**
- * Do not allows instantiation of this class.
+ * Do not allow instantiation of this class.
*/
private Modules() {
}
Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/system/ReferenceQueueConsumer.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/system/ReferenceQueueConsumer.java?rev=1690101&r1=1690100&r2=1690101&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/system/ReferenceQueueConsumer.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/system/ReferenceQueueConsumer.java [UTF-8] Thu Jul 9 13:31:00 2015
@@ -123,7 +123,7 @@ public final class ReferenceQueueConsume
// Probably the 'killAll' method has been invoked.
// We need to test 'isKillRequested()' below.
} catch (Throwable exception) {
- Logging.unexpectedException(getClass(), "run", exception);
+ Logging.unexpectedException(Logging.getLogger(Loggers.SYSTEM), getClass(), "run", exception);
}
if (isKillRequested()) {
break;
Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/system/Shutdown.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/system/Shutdown.java?rev=1690101&r1=1690100&r2=1690101&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/system/Shutdown.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/system/Shutdown.java [UTF-8] Thu Jul 9 13:31:00 2015
@@ -67,7 +67,7 @@ public final class Shutdown {
Threads.shutdown(System.nanoTime() + 4000);
} catch (InterruptedException e) {
if (caller != null) {
- Logging.unexpectedException(caller, "stop", e);
+ Logging.unexpectedException(Logging.getLogger(Loggers.SYSTEM), caller, "stop", e);
}
}
if (exception != null) {
Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/system/Supervisor.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/system/Supervisor.java?rev=1690101&r1=1690100&r2=1690101&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/system/Supervisor.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/system/Supervisor.java [UTF-8] Thu Jul 9 13:31:00 2015
@@ -93,10 +93,10 @@ public final class Supervisor extends St
} catch (InstanceAlreadyExistsException e) {
final LogRecord record = Messages.getResources(null)
.getLogRecord(Level.CONFIG, Messages.Keys.AlreadyRegistered_2, "MBean", NAME);
- record.setLoggerName("org.apache.sis");
+ record.setLoggerName(Loggers.SYSTEM);
Logging.log(Supervisor.class, "register", record);
} catch (SecurityException | JMException e) {
- Logging.unexpectedException(Logging.getLogger("org.apache.sis"), Supervisor.class, "register", e);
+ Logging.unexpectedException(Logging.getLogger(Loggers.SYSTEM), Supervisor.class, "register", e);
}
}
}
Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/system/Threads.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/system/Threads.java?rev=1690101&r1=1690100&r2=1690101&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/system/Threads.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/system/Threads.java [UTF-8] Thu Jul 9 13:31:00 2015
@@ -63,7 +63,7 @@ final class Threads extends Static {
*/
static final ThreadGroup DAEMONS = new ThreadGroup(SIS, "Daemons") {
@Override public void uncaughtException(final Thread thread, final Throwable exception) {
- Logging.severeException(Logging.getLogger("org.apache.sis"), thread.getClass(), "run", exception);
+ Logging.severeException(Logging.getLogger(Loggers.SYSTEM), thread.getClass(), "run", exception);
}
};
Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/util/CheckedArrayList.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/util/CheckedArrayList.java?rev=1690101&r1=1690100&r2=1690101&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/util/CheckedArrayList.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/util/CheckedArrayList.java [UTF-8] Thu Jul 9 13:31:00 2015
@@ -160,7 +160,7 @@ public final class CheckedArrayList<E> e
}
final Context context = Context.current();
if (context != null) {
- Context.warningOccured(context, Context.LOGGER, collection.getClass(), "add", Errors.class, key, arguments);
+ Context.warningOccured(context, collection.getClass(), "add", Errors.class, key, arguments);
return null;
} else {
return Errors.format(key, arguments);
Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/setup/About.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/setup/About.java?rev=1690101&r1=1690100&r2=1690101&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/setup/About.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/setup/About.java [UTF-8] Thu Jul 9 13:31:00 2015
@@ -46,6 +46,8 @@ import org.apache.sis.util.resources.Voc
import org.apache.sis.util.collection.TreeTable;
import org.apache.sis.util.collection.TreeTables;
import org.apache.sis.util.collection.DefaultTreeTable;
+import org.apache.sis.internal.system.Loggers;
+import org.apache.sis.internal.system.Modules;
import static java.lang.System.getProperty;
import static org.apache.sis.util.collection.TableColumn.NAME;
@@ -532,7 +534,7 @@ pathTree: for (int j=0; ; j++) {
}
}
if (error != null) {
- Logging.unexpectedException(About.class, "configuration", error);
+ Logging.unexpectedException(Logging.getLogger(Modules.UTILITIES), About.class, "configuration", error);
}
return true;
}
@@ -641,7 +643,7 @@ pathTree: for (int j=0; ; j++) {
try {
return country ? locale.getCountry() : locale.getISO3Language();
} catch (MissingResourceException e) {
- Logging.recoverableException(About.class, "configuration", e);
+ Logging.recoverableException(Logging.getLogger(Loggers.LOCALIZATION), About.class, "configuration", e);
return null;
}
}
Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/setup/OptionKey.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/setup/OptionKey.java?rev=1690101&r1=1690100&r2=1690101&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/setup/OptionKey.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/setup/OptionKey.java [UTF-8] Thu Jul 9 13:31:00 2015
@@ -23,6 +23,7 @@ import java.nio.charset.Charset;
import java.io.Serializable;
import org.apache.sis.util.ArgumentChecks;
import org.apache.sis.util.logging.Logging;
+import org.apache.sis.internal.system.Modules;
// Branch-dependent imports
import java.nio.file.OpenOption;
@@ -283,7 +284,7 @@ public class OptionKey<T> implements Ser
* we override the 'equals' and 'hashCode' methods. This option is likely to be ignored,
* but options are expected to be optional...
*/
- Logging.recoverableException(OptionKey.class, "readResolve", e);
+ Logging.recoverableException(Logging.getLogger(Modules.UTILITIES), OptionKey.class, "readResolve", e);
return this;
}
}
Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/Locales.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/Locales.java?rev=1690101&r1=1690100&r2=1690101&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/Locales.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/Locales.java [UTF-8] Thu Jul 9 13:31:00 2015
@@ -28,6 +28,7 @@ import java.util.IllformedLocaleExceptio
import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
import org.apache.sis.util.logging.Logging;
+import org.apache.sis.internal.system.Loggers;
import static org.apache.sis.util.CharSequences.trimWhitespaces;
import static org.apache.sis.util.collection.Containers.hashMapCapacity;
@@ -80,7 +81,7 @@ public final class Locales extends Stati
* Not a big deal if this operation fails (this is actually just an
* optimization for reducing memory usage). Log a warning and stop.
*/
- Logging.unexpectedException(Locales.class, "<clinit>", exception);
+ Logging.unexpectedException(Logging.getLogger(Loggers.LOCALIZATION), Locales.class, "<clinit>", exception);
}
}
Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/collection/WeakEntry.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/collection/WeakEntry.java?rev=1690101&r1=1690100&r2=1690101&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/collection/WeakEntry.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/collection/WeakEntry.java [UTF-8] Thu Jul 9 13:31:00 2015
@@ -26,6 +26,7 @@ import org.apache.sis.util.Disposable;
import org.apache.sis.util.logging.Logging;
import org.apache.sis.util.resources.Messages;
import org.apache.sis.internal.system.ReferenceQueueConsumer;
+import org.apache.sis.internal.system.Modules;
import org.apache.sis.math.MathFunctions;
@@ -64,7 +65,7 @@ abstract class WeakEntry<E> extends Weak
/**
* The logger where to logs collection events, if logging at the finest level is enabled.
*/
- private static final Logger LOGGER = Logging.getLogger(WeakEntry.class);
+ private static final Logger LOGGER = Logging.getLogger(Modules.UTILITIES);
/**
* The next entry, or {@code null} if there is none.
Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultInternationalString.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultInternationalString.java?rev=1690101&r1=1690100&r2=1690101&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultInternationalString.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultInternationalString.java [UTF-8] Thu Jul 9 13:31:00 2015
@@ -34,6 +34,7 @@ import org.apache.sis.util.ArgumentCheck
import org.apache.sis.util.logging.Logging;
import org.apache.sis.util.resources.Errors;
import org.apache.sis.util.resources.Messages;
+import org.apache.sis.internal.system.Modules;
import static org.apache.sis.util.collection.Containers.isNullOrEmpty;
@@ -186,8 +187,8 @@ public class DefaultInternationalString
final LogRecord record = Messages.getResources(null).getLogRecord(Level.WARNING, Messages.Keys.LocalesDiscarded);
record.setSourceClassName("org.apache.sis.util.iso.Types");
record.setSourceMethodName("toInternationalString");
- record.setLoggerName("org.apache.sis.util.iso");
- Logging.getLogger("org.apache.sis.util.iso").log(record);
+ record.setLoggerName(Modules.UTILITIES);
+ Logging.getLogger(Modules.UTILITIES).log(record);
}
}
Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/iso/Types.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/iso/Types.java?rev=1690101&r1=1690100&r2=1690101&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/iso/Types.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/iso/Types.java [UTF-8] Thu Jul 9 13:31:00 2015
@@ -40,6 +40,7 @@ import org.apache.sis.util.ArgumentCheck
import org.apache.sis.util.logging.Logging;
import org.apache.sis.util.resources.Errors;
import org.apache.sis.util.collection.BackingStoreException;
+import org.apache.sis.internal.system.Loggers;
/**
@@ -346,7 +347,7 @@ public final class Types extends Static
try {
return super.toString(locale);
} catch (MissingResourceException e) {
- Logging.recoverableException(ResourceInternationalString.class, "toString", e);
+ Logging.recoverableException(Logging.getLogger(Loggers.LOCALIZATION), ResourceInternationalString.class, "toString", e);
return fallback();
}
}
Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/logging/Logging.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/logging/Logging.java?rev=1690101&r1=1690100&r2=1690101&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/logging/Logging.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/logging/Logging.java [UTF-8] Thu Jul 9 13:31:00 2015
@@ -111,7 +111,7 @@ public final class Logging extends Stati
* SIS classes typically declare a logger constant like below:
*
* {@preformat java
- * public static final Logger LOGGER = Logging.getLogger(TheClass.class);
+ * public static final Logger LOGGER = Logging.getLogger("the.logger.name");
* }
*
* Factory changes will take effect only if this method is invoked before the initialization
@@ -161,7 +161,10 @@ public final class Logging extends Stati
*
* @param classe The class for which to obtain a logger.
* @return A logger for the specified class.
+ *
+ * @deprecated Use {@link #getLogger(String)}, because the class name is sometime too close to implementation details.
*/
+ @Deprecated // Make package-private (do not delete) after we removed from public API.
public static Logger getLogger(Class<?> classe) {
Class<?> outer;
while ((outer = classe.getEnclosingClass()) != null) {
@@ -183,7 +186,7 @@ public final class Logging extends Stati
* <li>Unconditionally {@linkplain LogRecord#setSourceMethodName(String) set the source method name}
* to the given value;</li>
* <li>Get the logger for the {@linkplain LogRecord#getLoggerName() logger name} if specified,
- * or using {@link #getLogger(Class)} otherwise;</li>
+ * or for the {@code classe} package name otherwise;</li>
* <li>{@linkplain LogRecord#setLoggerName(String) Set the logger name} of the given record,
* if not already set;</li>
* <li>{@linkplain Logger#log(LogRecord) Log} the modified record.</li>
@@ -208,30 +211,29 @@ public final class Logging extends Stati
}
/**
- * Invoked when an unexpected error occurs. This method logs a message at the
- * {@link Level#WARNING WARNING} level to the specified logger. The originating
- * class name and method name are inferred from the error stack trace, using the
- * first {@linkplain StackTraceElement stack trace element} for which the class
- * name is inside a package or sub-package of the logger name. For example if
- * the logger name is {@code "org.apache.sis.image"}, then this method will uses
- * the first stack trace element where the fully qualified class name starts with
- * {@code "org.apache.sis.image"} or {@code "org.apache.sis.image.io"}, but not
- * {@code "org.apache.sis.imageio"}.
+ * Invoked when an unexpected error occurs. This method logs a message at {@link Level#WARNING} to the
+ * specified logger. The originating class name and method name are inferred from the error stack trace,
+ * using the first {@linkplain StackTraceElement stack trace element} for which the class name is inside
+ * a package or sub-package of the logger name.
+ *
+ * <div class="note"><b>Example:</b>
+ * if the logger name is {@code "org.apache.sis.image"}, then this method will uses the first stack
+ * trace element where the fully qualified class name starts with {@code "org.apache.sis.image"} or
+ * {@code "org.apache.sis.image.io"}, but not {@code "org.apache.sis.imageio"}.</div>
*
* @param logger Where to log the error.
* @param error The error that occurred.
* @return {@code true} if the error has been logged, or {@code false} if the logger
- * doesn't log anything at {@link Level#WARNING}.
+ * does not log anything at {@link Level#WARNING}.
*/
public static boolean unexpectedException(final Logger logger, final Throwable error) {
return unexpectedException(logger, null, null, error, Level.WARNING);
}
/**
- * Invoked when an unexpected error occurs. This method logs a message at the
- * {@link Level#WARNING WARNING} level to the specified logger. The originating
- * class name and method name can optionally be specified. If any of them is
- * {@code null}, then it will be inferred from the error stack trace as in
+ * Invoked when an unexpected error occurs. This method logs a message at {@link Level#WARNING}
+ * to the specified logger. The originating class name and method name can optionally be specified.
+ * If any of them is {@code null}, then it will be inferred from the error stack trace as in
* {@link #unexpectedException(Logger, Throwable)}.
*
* <p>Explicit value for class and method names are sometime preferred to automatic
@@ -252,7 +254,7 @@ public final class Logging extends Stati
* @param method The method where the error occurred, or {@code null}.
* @param error The error.
* @return {@code true} if the error has been logged, or {@code false} if the logger
- * doesn't log anything at {@link Level#WARNING}.
+ * does not log anything at {@link Level#WARNING}.
*
* @see #recoverableException(Logger, Class, String, Throwable)
* @see #severeException(Logger, Class, String, Throwable)
@@ -275,7 +277,11 @@ public final class Logging extends Stati
* doesn't log anything at {@link Level#WARNING}.
*
* @see #recoverableException(Class, String, Throwable)
+ *
+ * @deprecated A logger should be specified explicitely with
+ * {@link #unexpectedException(Logger, Class, String, Throwable)}.
*/
+ @Deprecated
public static boolean unexpectedException(Class<?> classe, String method, Throwable error) {
return unexpectedException((Logger) null, classe, method, error);
}
@@ -415,6 +421,7 @@ public final class Logging extends Stati
* {@code jre/lib/logging.properties} file is illegal, then {@link MonolineFormatter} will log
* this problem and use a default time pattern.</div>
*
+ * @param logger Where to log the error.
* @param classe The class where the error occurred.
* @param method The method name where the error occurred.
* @param error The error.
@@ -423,9 +430,9 @@ public final class Logging extends Stati
*
* @see #unexpectedException(Class, String, Throwable)
*/
- static boolean configurationException(final Class<?> classe, final String method, final Throwable error) {
+ static boolean configurationException(final Logger logger, final Class<?> classe, final String method, final Throwable error) {
final String classname = (classe != null) ? classe.getName() : null;
- return unexpectedException(null, classname, method, error, Level.CONFIG);
+ return unexpectedException(logger, classname, method, error, Level.CONFIG);
}
/**
@@ -440,22 +447,26 @@ public final class Logging extends Stati
* doesn't log anything at {@link Level#FINE}.
*
* @see #unexpectedException(Class, String, Throwable)
+ *
+ * @deprecated A logger should be specified explicitely with
+ * {@link #recoverableException(Logger, Class, String, Throwable)}.
*/
+ @Deprecated
public static boolean recoverableException(final Class<?> classe, final String method, final Throwable error) {
return recoverableException(null, classe, method, error);
}
/**
* Invoked when a recoverable error occurs. This method is similar to
- * {@link #unexpectedException(Logger,Class,String,Throwable) unexpectedException}
- * except that it doesn't log the stack trace and uses a lower logging level.
+ * {@link #unexpectedException(Logger,Class,String,Throwable) unexpectedException(…)}
+ * except that it does not log the stack trace and uses a lower logging level.
*
* @param logger Where to log the error.
* @param classe The class where the error occurred.
* @param method The method name where the error occurred.
* @param error The error.
* @return {@code true} if the error has been logged, or {@code false} if the logger
- * doesn't log anything at {@link Level#FINE}.
+ * does not log anything at {@link Level#FINE}.
*
* @see #unexpectedException(Logger, Class, String, Throwable)
* @see #severeException(Logger, Class, String, Throwable)
Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/logging/MonolineFormatter.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/logging/MonolineFormatter.java?rev=1690101&r1=1690100&r2=1690101&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/logging/MonolineFormatter.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/logging/MonolineFormatter.java [UTF-8] Thu Jul 9 13:31:00 2015
@@ -31,6 +31,7 @@ import java.util.SortedMap;
import java.util.Comparator;
import java.util.ResourceBundle;
import java.util.logging.*;
+import org.apache.sis.internal.system.Modules;
import org.apache.sis.internal.system.OS;
import org.apache.sis.internal.util.X364;
import org.apache.sis.io.IO;
@@ -294,12 +295,12 @@ public class MonolineFormatter extends F
try {
timeFormat(manager.getProperty(classname + ".time"));
} catch (IllegalArgumentException exception) {
- Logging.configurationException(MonolineFormatter.class, "<init>", exception);
+ Logging.configurationException(Logging.getLogger(Modules.UTILITIES), MonolineFormatter.class, "<init>", exception);
}
try {
sourceFormat(manager.getProperty(classname + ".source"));
} catch (IllegalArgumentException exception) {
- Logging.configurationException(MonolineFormatter.class, "<init>", exception);
+ Logging.configurationException(Logging.getLogger(Modules.UTILITIES), MonolineFormatter.class, "<init>", exception);
}
/*
* Applies the default set of colors only if the handler is writing to the console.
Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/IndexedResourceBundle.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/IndexedResourceBundle.java?rev=1690101&r1=1690100&r2=1690101&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/IndexedResourceBundle.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/IndexedResourceBundle.java [UTF-8] Thu Jul 9 13:31:00 2015
@@ -40,6 +40,7 @@ import org.apache.sis.util.Exceptions;
import org.apache.sis.util.CharSequences;
import org.apache.sis.util.iso.Types;
import org.apache.sis.util.logging.Logging;
+import org.apache.sis.internal.system.Loggers;
/**
@@ -287,6 +288,7 @@ public class IndexedResourceBundle exten
final String baseName = getClass().getCanonicalName();
final String methodName = (key != null) ? "getObject" : "getKeys";
final LogRecord record = new LogRecord(Level.FINER, "Loaded resources for {0} from bundle \"{1}\".");
+ record.setLoggerName(Loggers.LOCALIZATION);
/*
* Loads resources from the UTF file.
*/
@@ -357,7 +359,7 @@ public class IndexedResourceBundle exten
keyID = getKeyConstants().getKeyValue(key);
} catch (ReflectiveOperationException e) {
e.addSuppressed(exception);
- Logging.recoverableException(getClass(), "handleGetObject", e);
+ Logging.recoverableException(Logging.getLogger(Loggers.LOCALIZATION), getClass(), "handleGetObject", e);
return null; // This is okay as of 'handleGetObject' contract.
}
}
Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/Messages.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/Messages.java?rev=1690101&r1=1690100&r2=1690101&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/Messages.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/Messages.java [UTF-8] Thu Jul 9 13:31:00 2015
@@ -77,6 +77,16 @@ public final class Messages extends Inde
public static final short ConstantProjParameterValue_1 = 11;
/**
+ * Created an instance of ‘{0}’ named “{1}” with “{2}” identifier.
+ */
+ public static final short CreatedIdentifiedObject_3 = 17;
+
+ /**
+ * Created an instance of ‘{0}’ named “{1}”.
+ */
+ public static final short CreatedNamedObject_2 = 16;
+
+ /**
* Property “{0}” has been discarded in favor of “{1}”, because those two properties are
* mutually exclusive.
*/
Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/Messages.properties
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/Messages.properties?rev=1690101&r1=1690100&r2=1690101&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/Messages.properties [ISO-8859-1] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/Messages.properties [ISO-8859-1] Thu Jul 9 13:31:00 2015
@@ -18,6 +18,8 @@ AlreadyRegistered_2 = {0} \u
ChangedContainerCapacity_2 = Changed the container capacity from {0} to {1} elements.
ConformanceMeansDatumShift = This result indicates if a datum shift method has been applied.
ConstantProjParameterValue_1 = This parameter is shown for completeness, but should never have a value different than {0} for this projection.
+CreatedNamedObject_2 = Created an instance of \u2018{0}\u2019 named \u201c{1}\u201d.
+CreatedIdentifiedObject_3 = Created an instance of \u2018{0}\u2019 named \u201c{1}\u201d with \u201c{2}\u201d identifier.
DiscardedExclusiveProperty_2 = Property \u201c{0}\u201d has been discarded in favor of \u201c{1}\u201d, because those two properties are mutually exclusive.
IgnoredPropertiesAfterFirst_1 = Ignored properties after the first occurrence of \u2018{0}\u2019.
IgnoredPropertyAssociatedTo_1 = Ignored property associated to \u2018{0}\u2019.
Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/Messages_fr.properties
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/Messages_fr.properties?rev=1690101&r1=1690100&r2=1690101&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/Messages_fr.properties [ISO-8859-1] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/Messages_fr.properties [ISO-8859-1] Thu Jul 9 13:31:00 2015
@@ -25,6 +25,8 @@ AlreadyRegistered_2 = Le {0}
ChangedContainerCapacity_2 = Changement de la capacit\u00e9 du conteneur de {0} vers {1} \u00e9l\u00e9ments.
ConformanceMeansDatumShift = Ce r\u00e9sultat indique si un changement de r\u00e9f\u00e9rentiel a \u00e9t\u00e9 appliqu\u00e9.
ConstantProjParameterValue_1 = Ce param\u00e8tre est montr\u00e9 pour \u00eatre plus complet, mais sa valeur ne devrait jamais \u00eatre diff\u00e9rente de {0} pour cette projection.
+CreatedNamedObject_2 = Cr\u00e9ation d\u2019une instance de \u2018{0}\u2019 nomm\u00e9e \u00ab\u202f{1}\u202f\u00bb.
+CreatedIdentifiedObject_3 = Cr\u00e9ation d\u2019une instance de \u2018{0}\u2019 nomm\u00e9e \u00ab\u202f{1}\u202f\u00bb avec l\u2019identifiant \u00ab\u202f{2}\u202f\u00bb.
DiscardedExclusiveProperty_2 = La propri\u00e9t\u00e9 \u00ab\u202f{0}\u202f\u00bb a \u00e9t\u00e9 \u00e9cart\u00e9e en faveur de \u00ab\u202f{1}\u202f\u00bb, parce que ces deux propri\u00e9t\u00e9s sont mutuellement exclusives.
IgnoredPropertiesAfterFirst_1 = Des propri\u00e9t\u00e9s ont \u00e9t\u00e9 ignor\u00e9es apr\u00e8s la premi\u00e8re occurrence de \u2018{0}\u2019.
IgnoredPropertyAssociatedTo_1 = Une propri\u00e9t\u00e9 associ\u00e9e \u00e0 \u2018{0}\u2019 a \u00e9t\u00e9 ignor\u00e9e.
Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/xml/LegacyCodes.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/xml/LegacyCodes.java?rev=1690101&r1=1690100&r2=1690101&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/xml/LegacyCodes.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/xml/LegacyCodes.java [UTF-8] Thu Jul 9 13:31:00 2015
@@ -23,6 +23,7 @@ import java.util.Properties;
import java.io.InputStream;
import java.io.IOException;
import org.opengis.metadata.Metadata;
+import org.apache.sis.internal.system.Loggers;
import org.apache.sis.util.collection.Containers;
import org.apache.sis.util.logging.Logging;
@@ -53,7 +54,7 @@ final class LegacyCodes {
try (InputStream in = Metadata.class.getResourceAsStream("2003/charset-codes.properties")) {
codes.load(in);
} catch (IOException e) {
- Logging.unexpectedException(ValueConverter.class, "toCharset[Code]", e);
+ Logging.unexpectedException(Logging.getLogger(Loggers.XML), ValueConverter.class, "toCharset[Code]", e);
}
final int capacity = Containers.hashMapCapacity(codes.size());
IANA_TO_LEGACY = new HashMap<>(capacity);
Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/xml/MarshallerPool.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/xml/MarshallerPool.java?rev=1690101&r1=1690100&r2=1690101&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/xml/MarshallerPool.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/xml/MarshallerPool.java [UTF-8] Thu Jul 9 13:31:00 2015
@@ -26,6 +26,7 @@ import javax.xml.bind.JAXBException;
import javax.xml.bind.Marshaller;
import javax.xml.bind.Unmarshaller;
import org.apache.sis.util.logging.Logging;
+import org.apache.sis.internal.system.Loggers;
import org.apache.sis.internal.system.DelayedExecutor;
import org.apache.sis.internal.system.DelayedRunnable;
import org.apache.sis.internal.jaxb.AdapterReplacement;
@@ -243,7 +244,7 @@ public class MarshallerPool {
} catch (JAXBException exception) {
// Not expected to happen because we are supposed
// to reset the properties to their initial values.
- Logging.unexpectedException(MarshallerPool.class, "recycle", exception);
+ Logging.unexpectedException(Logging.getLogger(Loggers.XML), MarshallerPool.class, "recycle", exception);
return;
}
queue.push(marshaller);
Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/xml/XLink.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/xml/XLink.java?rev=1690101&r1=1690100&r2=1690101&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/xml/XLink.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/xml/XLink.java [UTF-8] Thu Jul 9 13:31:00 2015
@@ -27,6 +27,7 @@ import org.opengis.util.InternationalStr
import org.apache.sis.util.Classes;
import org.apache.sis.util.logging.Logging;
import org.apache.sis.util.resources.Errors;
+import org.apache.sis.internal.system.Loggers;
// Branch-dependent imports
import java.util.Objects;
@@ -870,7 +871,7 @@ public class XLink implements Serializab
} catch (NoSuchFieldException e) {
// Should never happen with Enums. But if it
// happen anyway, this is not a fatal error.
- Logging.unexpectedException(XLink.class, "toString", e);
+ Logging.unexpectedException(Logging.getLogger(Loggers.XML), XLink.class, "toString", e);
}
buffer.append(label).append("=\"").append(value).append('"');
}
Modified: sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/test/TestCase.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/test/TestCase.java?rev=1690101&r1=1690100&r2=1690101&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/test/TestCase.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/test/TestCase.java [UTF-8] Thu Jul 9 13:31:00 2015
@@ -24,6 +24,7 @@ import java.io.PrintWriter;
import java.io.StringWriter;
import java.io.OutputStreamWriter;
import java.io.UnsupportedEncodingException;
+import org.apache.sis.internal.system.Modules;
import org.apache.sis.util.logging.Logging;
import org.junit.runner.RunWith;
@@ -50,22 +51,12 @@ import static org.apache.sis.test.TestCo
*
* @author Martin Desruisseaux (Geomatys)
* @since 0.3
- * @version 0.4
+ * @version 0.6
* @module
*/
@RunWith(TestRunner.class)
public abstract strictfp class TestCase {
/**
- * Tolerance threshold for strict comparisons of floating point numbers.
- * This constant can be used like below, where {@code expected} and {@code actual} are {@code double} values:
- *
- * {@preformat java
- * assertEquals(expected, actual, STRICT);
- * }
- */
- protected static final double STRICT = 0;
-
- /**
* A flag for code that are pending future SIS development before to be enabled.
* This flag is always set to {@code false}. It shall be used as below:
*
@@ -83,6 +74,16 @@ public abstract strictfp class TestCase
public static final boolean PENDING_FUTURE_SIS_VERSION = false;
/**
+ * Tolerance threshold for strict comparisons of floating point numbers.
+ * This constant can be used like below, where {@code expected} and {@code actual} are {@code double} values:
+ *
+ * {@preformat java
+ * assertEquals(expected, actual, STRICT);
+ * }
+ */
+ protected static final double STRICT = 0;
+
+ /**
* The seed for the random number generator created by {@link TestUtilities#createRandomNumberGenerator(String)},
* or 0 if none. This information is used for printing the seed in case of test failure, in order to allow the
* developer to reproduce the failure.
@@ -91,7 +92,7 @@ public abstract strictfp class TestCase
/**
* The output writer where to print debugging information (never {@code null}).
- * Texts sent to this printer will be show only if the test fails, or if the
+ * Texts sent to this printer will be shown only if the test fails, or if the
* {@value org.apache.sis.test.TestConfiguration#VERBOSE_OUTPUT_KEY} system property
* is set to {@code true}. This writer will use the system default encoding, unless
* the {@value org.apache.sis.test.TestConfiguration#OUTPUT_ENCODING_KEY} system
@@ -121,6 +122,12 @@ public abstract strictfp class TestCase
}
/**
+ * The parent logger of all Apache SIS loggers.
+ * Needs to be retained by strong reference.
+ */
+ static final Logger LOGGER = Logger.getLogger("org.apache.sis");
+
+ /**
* Sets the encoding of the console logging handler, if an encoding has been specified.
* Note that we look specifically for {@link ConsoleHandler}; we do not generalize to
* {@link StreamHandler} because the log files may not be intended for being show in
@@ -132,7 +139,7 @@ public abstract strictfp class TestCase
static {
final String encoding = System.getProperty(OUTPUT_ENCODING_KEY);
if (encoding != null) try {
- for (Logger logger=Logger.getLogger("org.apache.sis"); logger!=null; logger=logger.getParent()) {
+ for (Logger logger=LOGGER; logger!=null; logger=logger.getParent()) {
for (final Handler handler : logger.getHandlers()) {
if (handler instanceof ConsoleHandler) {
((ConsoleHandler) handler).setEncoding(encoding);
@@ -143,8 +150,9 @@ public abstract strictfp class TestCase
}
}
} catch (UnsupportedEncodingException e) {
- Logging.recoverableException(TestCase.class, "<clinit>", e);
+ Logging.recoverableException(LOGGER, TestCase.class, "<clinit>", e);
}
+ LOGGER.addHandler(LogRecordCollector.INSTANCE);
}
/**
Modified: sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/test/TestRunner.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/test/TestRunner.java?rev=1690101&r1=1690100&r2=1690101&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/test/TestRunner.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/test/TestRunner.java [UTF-8] Thu Jul 9 13:31:00 2015
@@ -110,6 +110,7 @@ public final class TestRunner extends Bl
if (!TestCase.verbose) {
TestCase.clearBuffer();
}
+ LogRecordCollector.INSTANCE.setCurrentTest(description);
}
/**
@@ -123,6 +124,7 @@ public final class TestRunner extends Bl
TestCase.flushOutput();
}
TestCase.randomSeed = 0;
+ LogRecordCollector.INSTANCE.setCurrentTest(null);
}
/**
Modified: sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/test/TestSuite.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/test/TestSuite.java?rev=1690101&r1=1690100&r2=1690101&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/test/TestSuite.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/test/TestSuite.java [UTF-8] Thu Jul 9 13:31:00 2015
@@ -23,6 +23,7 @@ import java.util.List;
import java.util.ArrayList;
import java.util.Iterator;
import java.io.File;
+import java.io.IOException;
import java.net.URL;
import java.net.URISyntaxException;
import javax.management.JMException;
@@ -58,7 +59,7 @@ public abstract strictfp class TestSuite
/**
* Expected suffix in name of test classes.
*/
- private static final String CLASSNAME_SUFFIX = "Test";
+ static final String CLASSNAME_SUFFIX = "Test";
/**
* {@code true} for disabling the search for missing tests. This is necessary
@@ -68,6 +69,12 @@ public abstract strictfp class TestSuite
static boolean skipCheckForMissingTests;
/**
+ * {@code true} for disabling {@link #shutdown()}. This is necessary when the test suites
+ * are executed from an external project (same need than {@link #skipCheckForMissingTests}).
+ */
+ static boolean skipShutdown;
+
+ /**
* Creates a new test suite.
*/
protected TestSuite() {
@@ -244,7 +251,17 @@ public abstract strictfp class TestSuite
*/
@AfterClass
public static void shutdown() throws JMException {
- SystemListener.fireClasspathChanged();
- Shutdown.stop(TestSuite.class);
+ if (!skipShutdown) {
+ skipShutdown = true;
+ TestCase.LOGGER.removeHandler(LogRecordCollector.INSTANCE);
+ System.err.flush(); // Flushs log messages sent by ConsoleHandler.
+ try {
+ LogRecordCollector.INSTANCE.report(System.out);
+ } catch (IOException e) { // Should never happen.
+ throw new AssertionError(e);
+ }
+ SystemListener.fireClasspathChanged();
+ Shutdown.stop(TestSuite.class);
+ }
}
}
Modified: sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/test/suite/UtilityTestSuite.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/test/suite/UtilityTestSuite.java?rev=1690101&r1=1690100&r2=1690101&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/test/suite/UtilityTestSuite.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/test/suite/UtilityTestSuite.java [UTF-8] Thu Jul 9 13:31:00 2015
@@ -36,6 +36,7 @@ import org.junit.BeforeClass;
org.apache.sis.internal.test.XMLComparatorTest.class,
// Most basic functions of SIS library.
+ org.apache.sis.internal.system.LoggersTest.class,
org.apache.sis.internal.util.NumericsTest.class,
org.apache.sis.setup.OptionKeyTest.class,
org.apache.sis.util.ArraysExtTest.class,
Modified: sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/NetcdfStoreProvider.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/NetcdfStoreProvider.java?rev=1690101&r1=1690100&r2=1690101&view=diff
==============================================================================
--- sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/NetcdfStoreProvider.java [UTF-8] (original)
+++ sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/NetcdfStoreProvider.java [UTF-8] Thu Jul 9 13:31:00 2015
@@ -168,8 +168,7 @@ public class NetcdfStoreProvider extends
* in which case UCAR tries to open it as a file even if it is not a file. For example
* we get this exception for "jar:file:/file.jar!/entry.nc".
*/
- Logging.recoverableException(
- Logging.getLogger("org.apache.sis.storage"), netcdfFileClass, "canOpen", cause);
+ Logging.recoverableException(Logging.getLogger(Modules.NETCDF), netcdfFileClass, "canOpen", cause);
return ProbeResult.UNSUPPORTED_STORAGE;
}
throw new DataStoreException(e); // The cause may be IOException.
Modified: sis/branches/JDK7/storage/sis-netcdf/src/test/java/org/apache/sis/internal/netcdf/TestCase.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/storage/sis-netcdf/src/test/java/org/apache/sis/internal/netcdf/TestCase.java?rev=1690101&r1=1690100&r2=1690101&view=diff
==============================================================================
--- sis/branches/JDK7/storage/sis-netcdf/src/test/java/org/apache/sis/internal/netcdf/TestCase.java [UTF-8] (original)
+++ sis/branches/JDK7/storage/sis-netcdf/src/test/java/org/apache/sis/internal/netcdf/TestCase.java [UTF-8] Thu Jul 9 13:31:00 2015
@@ -24,6 +24,7 @@ import java.io.IOException;
import java.lang.reflect.UndeclaredThrowableException;
import org.apache.sis.util.logging.EmptyWarningListeners;
import org.apache.sis.internal.netcdf.ucar.DecoderWrapper;
+import org.apache.sis.internal.system.Modules;
import org.opengis.wrapper.netcdf.IOTestCase;
import ucar.nc2.dataset.NetcdfDataset;
import org.junit.AfterClass;
@@ -46,7 +47,7 @@ public abstract strictfp class TestCase
* A dummy list of listeners which can be given to the {@link Decoder} constructor.
*/
public static EmptyWarningListeners<Decoder> LISTENERS =
- new EmptyWarningListeners<>("org.apache.sis.storage.netcdf");
+ new EmptyWarningListeners<>(Modules.NETCDF);
/**
* The {@code searchPath} argument value to be given to the {@link Decoder#setSearchPath(String[])}
Modified: sis/branches/JDK7/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/IOUtilities.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/IOUtilities.java?rev=1690101&r1=1690100&r2=1690101&view=diff
==============================================================================
--- sis/branches/JDK7/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/IOUtilities.java [UTF-8] (original)
+++ sis/branches/JDK7/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/IOUtilities.java [UTF-8] Thu Jul 9 13:31:00 2015
@@ -38,6 +38,7 @@ import org.apache.sis.util.CharSequences
import org.apache.sis.util.Exceptions;
import org.apache.sis.util.Static;
import org.apache.sis.util.resources.Errors;
+import org.apache.sis.internal.system.Modules;
// Branch-dependent imports
import java.nio.file.Path;
@@ -528,7 +529,7 @@ public final class IOUtilities extends S
// We have been able to create a channel, maybe not with the given OpenOptions.
// But the exception was nevertheless unexpected, so log its stack trace in order
// to allow the developer to check if there is something wrong.
- Logging.unexpectedException(Logging.getLogger("org.apache.sis.storage"), IOUtilities.class, "open", e);
+ Logging.unexpectedException(Logging.getLogger(Modules.STORAGE), IOUtilities.class, "open", e);
return channel;
}
}
@@ -552,6 +553,6 @@ public final class IOUtilities extends S
* the exception at {@link java.util.logging.Level#FINE} without stack trace.
*/
private static void recoverableException(final Exception warning) {
- Logging.recoverableException(Logging.getLogger("org.apache.sis.storage"), IOUtilities.class, "open", warning);
+ Logging.recoverableException(Logging.getLogger(Modules.STORAGE), IOUtilities.class, "open", warning);
}
}