sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1480595 [2/2] - in /sis/trunk: ./ ide-project/NetBeans/nbproject/ sis-metadata/src/main/java/org/apache/sis/internal/metadata/ sis-metadata/src/main/java/org/apache/sis/metadata/ sis-metadata/src/main/java/org/apache/sis/metadata/iso/ sis-...
Date Thu, 09 May 2013 11:38:53 GMT
Modified: sis/trunk/sis-utility/src/main/java/org/apache/sis/util/Classes.java
URL: http://svn.apache.org/viewvc/sis/trunk/sis-utility/src/main/java/org/apache/sis/util/Classes.java?rev=1480595&r1=1480594&r2=1480595&view=diff
==============================================================================
--- sis/trunk/sis-utility/src/main/java/org/apache/sis/util/Classes.java [UTF-8] (original)
+++ sis/trunk/sis-utility/src/main/java/org/apache/sis/util/Classes.java [UTF-8] Thu May 
9 11:38:52 2013
@@ -584,7 +584,7 @@ cmp:    for (final Class<?> c : c1) {
      *     <td>{@code "String"}</td>
      *   </tr>
      *   <tr>
-     *     <td>{@link double[]}</td>
+     *     <td>{@code double[]}</td>
      *     <td>{@code "[D"}</td>
      *     <td>{@code "double[]"}</td>
      *     <td>{@code "double[]"}</td>

Modified: sis/trunk/sis-utility/src/main/java/org/apache/sis/util/collection/Containers.java
URL: http://svn.apache.org/viewvc/sis/trunk/sis-utility/src/main/java/org/apache/sis/util/collection/Containers.java?rev=1480595&r1=1480594&r2=1480595&view=diff
==============================================================================
--- sis/trunk/sis-utility/src/main/java/org/apache/sis/util/collection/Containers.java [UTF-8]
(original)
+++ sis/trunk/sis-utility/src/main/java/org/apache/sis/util/collection/Containers.java [UTF-8]
Thu May  9 11:38:52 2013
@@ -91,7 +91,7 @@ public final class Containers extends St
      * @return The given array wrapped in an unmodifiable list, or {@code null} if the given
      *         array was null.
      *
-     * @see java.util.Arrays#asList(T[])
+     * @see java.util.Arrays#asList(Object[])
      */
     public static <E> List<? extends E> unmodifiableList(final E... array) {
         return UnmodifiableArrayList.wrap(array);

Modified: sis/trunk/sis-utility/src/main/java/org/apache/sis/util/logging/LoggerFactory.java
URL: http://svn.apache.org/viewvc/sis/trunk/sis-utility/src/main/java/org/apache/sis/util/logging/LoggerFactory.java?rev=1480595&r1=1480594&r2=1480595&view=diff
==============================================================================
--- sis/trunk/sis-utility/src/main/java/org/apache/sis/util/logging/LoggerFactory.java [UTF-8]
(original)
+++ sis/trunk/sis-utility/src/main/java/org/apache/sis/util/logging/LoggerFactory.java [UTF-8]
Thu May  9 11:38:52 2013
@@ -22,10 +22,21 @@ import org.apache.sis.util.collection.We
 
 
 /**
- * A factory for Java {@link Logger} wrapping an other logging framework. This factory is
used
- * only when wanting to log to an other framework than JDK logging. The {@link #getLogger(String)}
- * method returns some subclass of {@link Logger} (typically {@link LoggerAdapter}) that
forward
- * directly all log methods to an other framework.
+ * A factory for Java {@link Logger} wrapping an other logging framework.
+ * This factory is used only when an application wants to redirect SIS logs to an other framework
+ * than JDK logging. An instance of {@code LoggerFactory} can be registered to SIS in two
ways:
+ *
+ * <ul>
+ *   <li>By declaring the fully qualified classname of the {@code LoggerFactory} implementation
+ *       in the {@code META-INF/services/org.apache.sis.util.logging.LoggerFactory} file.
+ *       Note that the {@code sis-logging-commons.jar} and {@code sis-logging-log4j.jar}
+ *       files provide such declaration.</li>
+ *   <li>By explicit invocation of {@link Logging#setLoggerFactory(LoggerFactory)}
+ *       at application initialization time.</li>
+ * </ul>
+ *
+ * The {@link #getLogger(String)} method shall return some {@link Logger} subclass
+ * (typically {@link LoggerAdapter}) which forwards directly all log methods to the other
framework.
  *
  * @param <L> The type of loggers used for the implementation backend.
  *            This is the type used by external frameworks like Log4J.

Modified: sis/trunk/sis-utility/src/main/java/org/apache/sis/util/logging/Logging.java
URL: http://svn.apache.org/viewvc/sis/trunk/sis-utility/src/main/java/org/apache/sis/util/logging/Logging.java?rev=1480595&r1=1480594&r2=1480595&view=diff
==============================================================================
--- sis/trunk/sis-utility/src/main/java/org/apache/sis/util/logging/Logging.java [UTF-8] (original)
+++ sis/trunk/sis-utility/src/main/java/org/apache/sis/util/logging/Logging.java [UTF-8] Thu
May  9 11:38:52 2013
@@ -16,41 +16,34 @@
  */
 package org.apache.sis.util.logging;
 
-import java.util.Arrays;
-import java.util.Comparator;
 import java.util.ServiceLoader;
 import java.util.logging.Level;
 import java.util.logging.Logger;
-import java.util.logging.Handler;
 import java.util.logging.LogRecord;
 
 import org.apache.sis.util.Configuration;
 import org.apache.sis.util.Static;
-import org.apache.sis.util.ArraysExt;
 import org.apache.sis.util.Exceptions;
 import org.apache.sis.util.Classes;
 
 
 /**
  * A set of utilities method for configuring loggings in SIS. Library implementors shall
fetch
- * their logger using the {@link #getLogger(Class)} static method provided in this class
rather
- * than {@link Logger#getLogger(String)}, in order to give SIS a chance to redirect the logging
- * to an other framework like <A HREF="http://commons.apache.org/logging/">Commons-logging</A>
or
- * <A HREF="http://logging.apache.org/log4j">Log4J</A>.
+ * their loggers using the {@link #getLogger(Class)} static method defined in this {@code
Logging}
+ * class rather than the one defined in the standard {@link Logger} class, in order to give
SIS a
+ * chance to redirect the logs to an other framework like
+ * <a href="http://commons.apache.org/logging/">Commons-logging</a> or
+ * <a href="http://logging.apache.org/log4j">Log4J</a>.
  *
- * <p>This method provides also a {@link #log(Class, String, LogRecord)} convenience
static method,
- * which {@linkplain LogRecord#setLoggerName set the logger name} of the given record before
to log
- * it. An other worthy static method is {@link #unexpectedException(Class, String, Throwable)},
for
- * reporting an anomalous but nevertheless non-fatal exception.</p>
- *
- * {@section Configuration}
- * The log records can be redirected explicitly to an other logging framework using the
- * {@link #setLoggerFactory(LoggerFactory)} method.
- * Note however that this method call is performed automatically if the
- * {@code sis-logging-commons.jar} or the {@code sis-logging-log4j.jar} file is
- * found on the classpath, so it usually doesn't need to be invoked explicitely.
- * See the {@link #scanLoggerFactory()} method for more details on automatic logger
- * factory registration.
+ * <p>This class provides also some convenience static methods, including:</p>
+ * <ul>
+ *   <li>{@link #log(Class, String, LogRecord)} for {@linkplain LogRecord#setLoggerName(String)
setting
+ *       the logger name}, {@linkplain LogRecord#setSourceClassName(String) source class
name} and
+ *       {@linkplain LogRecord#setSourceMethodName(String) source method name} of the given
record
+ *       before to log it.</li>
+ *   <li>{@link #unexpectedException(Class, String, Throwable)} for reporting an anomalous
but
+ *       nevertheless non-fatal exception.</li>
+ * </ul>
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.3 (derived from geotk-2.4)
@@ -59,82 +52,113 @@ import org.apache.sis.util.Classes;
  */
 public final class Logging extends Static {
     /**
-     * Compares {@link Logging} or {@link String} objects for alphabetical order.
+     * The factory for obtaining {@link Logger} instances, or {@code null} if none.
+     * If {@code null} (the default), then the standard JDK logging framework will be used.
+     * {@code Logging} scans the classpath for logger factories on class initialization.
+     * The fully qualified factory classname shall be declared in the following file:
+     *
+     * {@preformat text
+     *     META-INF/services/org.apache.sis.util.logging.LoggerFactory
+     * }
+     *
+     * The factory found on the classpath is assigned to the {@link #factory} field. If more
than one factory
+     * is found, then the log messages will be sent to the logging frameworks managed by
all those factories.
+     *
+     * {@note A previous version was providing a <code>scanForPlugins()</code>
method allowing developers to
+     *        refresh the object state when new <code>LoggerFactory</code> instances
become available on the
+     *        classpath of a running JVM. However it usually doesn't work since loggers are
typically stored
+     *        in static final fields.}
+     *
+     * @see #setLoggerFactory(LoggerFactory)
      */
-    private static final Comparator<Object> COMPARATOR = new Comparator<Object>()
{
-        @Override public int compare(final Object o1, final Object o2) {
-            final String n1 = (o1 instanceof Logging) ? ((Logging) o1).name : o1.toString();
-            final String n2 = (o2 instanceof Logging) ? ((Logging) o2).name : o2.toString();
-            return n1.compareTo(n2);
+    private static volatile LoggerFactory<?> factory;
+    static {
+        LoggerFactory<?> factory = null;
+        for (final LoggerFactory<?> found : ServiceLoader.load(LoggerFactory.class))
{
+            if (factory == null) {
+                factory = found;
+            } else {
+                factory = new DualLoggerFactory(factory, found);
+            }
         }
-    };
-
-    /**
-     * An empty array of loggings. Also used for locks.
-     */
-    private static final Logging[] EMPTY = new Logging[0];
-
-    /**
-     * Logging configuration that apply to all packages.
-     */
-    public static final Logging ALL = new Logging();
-    static { // Must be run after ALL assignation and before SIS (or any other Logging) creation.
-        ALL.scanLoggerFactory();
+        Logging.factory = factory;
     }
 
     /**
-     * Logging configuration that apply only to "{@code org.apache.sis}" packages.
-     */
-    public static final Logging SIS = getLogging("org.apache.sis");
-
-    /**
-     * The name of the base package.
+     * Do not allow instantiation of this class.
      */
-    public final String name;
+    private Logging() {
+    }
 
     /**
-     * The children {@link Logging} objects.
+     * Sets a new factory to use for obtaining {@link Logger} instances.
+     * If the given {@code factory} argument is {@code null} (the default),
+     * then the standard Logging framework will be used.
      *
-     * {@note The array used there is not efficient for adding new items (<code>ArrayList</code>
-     *        would be more efficient), but we assume that very few new items will be added.
-     *        Furthermore a plain array is efficient for reading, and the later is way more
-     *        common than the former.}
-     */
-    private Logging[] children = EMPTY;
-
-    /**
-     * The factory for creating loggers, or {@code null} if none. If {@code null}
-     * (the default), then the standard JDK logging framework will be used.
+     * {@section Limitation}
+     * SIS classes typically declare a logger constant like below:
      *
-     * @see #setLoggerFactory(LoggerFactory)
+     * {@preformat java
+     *     public static final Logger LOGGER = Logging.getLogger(TheClass.class);
+     * }
+     *
+     * Factory changes will take effect only if this method is invoked before the initialization
+     * of such classes.
+     *
+     * @param factory The new logger factory, or {@code null} if none.
      */
-    private LoggerFactory<?> factory;
+    @Configuration
+    public static void setLoggerFactory(final LoggerFactory<?> factory) {
+        Logging.factory = factory;
+    }
 
     /**
-     * {@code true} if every {@link Logging} instances use the same {@link LoggerFactory}.
-     * This is an optimization for a very common case.
+     * Returns the factory used for obtaining {@link Logger} instances, or {@code null} if
none.
+     *
+     * @return The current logger factory, or {@code null} if none.
      */
-    private static boolean sameLoggerFactory = true;
+    public static LoggerFactory<?> getLoggerFactory() {
+        return factory;
+    }
 
     /**
-     * Creates an instance for the root logger. This constructor should not be used for anything
-     * else than {@link #ALL} construction; use the {@link #getLogging(String)} method instead.
+     * Returns a logger for the specified name. If a {@linkplain LoggerFactory logger factory}
has
+     * been set, then this method first {@linkplain LoggerFactory#getLogger asks to the factory}.
+     * This rule gives SIS a chance to redirect logging events to
+     * <a href="http://commons.apache.org/logging/">commons-logging</a> or some
equivalent framework.
+     * Only if no factory was found or if the factory choose to not redirect the loggings,
then this
+     * method delegate to <code>{@linkplain Logger#getLogger Logger.getLogger}(name)</code>.
+     *
+     * @param  name The logger name.
+     * @return A logger for the specified name.
      */
-    private Logging() {
-        name = "";
+    public static Logger getLogger(final String name) {
+        final LoggerFactory<?> factory = Logging.factory;
+        if (factory != null) {
+            final Logger logger = factory.getLogger(name);
+            if (logger != null) {
+                return logger;
+            }
+        }
+        return Logger.getLogger(name);
     }
 
     /**
-     * Creates an instance for the specified base logger. This constructor should
-     * not be public; use the {@link #getLogging(String)} method instead.
+     * Returns a logger for the specified class. This convenience method invokes
+     * {@link #getLogger(String)} with the package name as the logger name.
      *
-     * @param parent The parent {@code Logging} instance.
-     * @param name   The logger name for the new instance.
+     * @param  classe The class for which to obtain a logger.
+     * @return A logger for the specified class.
      */
-    private Logging(final Logging parent, final String name) {
-        this.name = name;
-        factory = parent.factory;
-        assert name.startsWith(parent.name) : name;
+    public static Logger getLogger(Class<?> classe) {
+        Class<?> outer;
+        while ((outer = classe.getEnclosingClass()) != null) {
+            classe = outer;
+        }
+        String name = classe.getName();
+        final int separator = name.lastIndexOf('.');
+        name = (separator >= 1) ? name.substring(0, separator) : "";
+        return getLogger(name);
     }
 
     /**
@@ -167,208 +191,6 @@ public final class Logging extends Stati
     }
 
     /**
-     * Returns a logger for the specified class. This convenience method invokes
-     * {@link #getLogger(String)} with the package name as the logger name.
-     *
-     * @param  classe The class for which to obtain a logger.
-     * @return A logger for the specified class.
-     */
-    public static Logger getLogger(Class<?> classe) {
-        Class<?> outer;
-        while ((outer = classe.getEnclosingClass()) != null) {
-            classe = outer;
-        }
-        String name = classe.getName();
-        final int separator = name.lastIndexOf('.');
-        name = (separator >= 1) ? name.substring(0, separator) : "";
-        return getLogger(name);
-    }
-
-    /**
-     * Returns a logger for the specified name. If a {@linkplain LoggerFactory logger factory}
has
-     * been set, then this method first {@linkplain LoggerFactory#getLogger ask to the factory}.
-     * It gives SIS a chance to redirect logging events to
-     * <A HREF="http://commons.apache.org/logging/">commons-logging</A>
-     * or some equivalent framework.
-     *
-     * <p>If no factory was found or if the factory choose to not redirect the loggings,
then this
-     * method returns the usual <code>{@linkplain Logger#getLogger Logger.getLogger}(name)</code>.</p>
-     *
-     * @param  name The logger name.
-     * @return A logger for the specified name.
-     */
-    public static Logger getLogger(final String name) {
-        synchronized (EMPTY) {
-            final Logging logging = sameLoggerFactory ? ALL : getLogging(name, false);
-            if (logging != null) { // Paranoiac check ('getLogging' should not returns null).
-                final LoggerFactory<?> factory = logging.factory;
-                assert getLogging(name, false).factory == factory : name;
-                if (factory != null) {
-                    final Logger logger = factory.getLogger(name);
-                    if (logger != null) {
-                        return logger;
-                    }
-                }
-            }
-        }
-        return Logger.getLogger(name);
-    }
-
-    /**
-     * Returns a {@code Logging} instance for the specified base logger.
-     * This instance can be used for controlling logging configuration in SIS.
-     *
-     * <p>{@code Logging} instances follow the same hierarchy than {@link Logger},
i.e.
-     * {@code "org.apache.sis"} is the parent of {@code "org.apache.sis.referencing"},
-     * {@code "org.apache.sis.metadata"}, <i>etc</i>.</p>
-     *
-     * @param name The base logger name.
-     * @return The logging instance for the given name.
-     */
-    public static Logging getLogging(final String name) {
-        synchronized (EMPTY) {
-            return getLogging(name, true);
-        }
-    }
-
-    /**
-     * Returns a logging instance for the specified base logger. If no instance is found
for
-     * the specified name and {@code create} is {@code true}, then a new instance will be
-     * created. Otherwise the nearest parent is returned.
-     *
-     * @param base The root logger name.
-     * @param create {@code true} if this method is allowed to create new {@code Logging}
instance.
-     * @return The logging instance for the given name.
-     */
-    private static Logging getLogging(final String base, final boolean create) {
-        assert Thread.holdsLock(EMPTY);
-        Logging logging = ALL;
-        if (!base.isEmpty()) {
-            int offset = 0;
-            do {
-                Logging[] children = logging.children;
-                offset = base.indexOf('.', offset);
-                final String name = (offset >= 0) ? base.substring(0, offset) : base;
-                int i = Arrays.binarySearch(children, name, COMPARATOR);
-                if (i < 0) {
-                    // No exact match found.
-                    if (!create) {
-                        // We are not allowed to create new Logging instance.
-                        // 'logging' is the nearest parent, so stop the loop now.
-                        break;
-                    }
-                    i = ~i;
-                    children = ArraysExt.insert(children, i, 1);
-                    children[i] = new Logging(logging, name);
-                    logging.children = children;
-                }
-                logging = children[i];
-            } while (++offset != 0);
-        }
-        return logging;
-    }
-
-    /**
-     * Returns the logger factory, or {@code null} if none. This method returns the logger
set
-     * by the last call to {@link #setLoggerFactory(LoggerFactory)} on this {@code Logging}
-     * instance or on one of its parent.
-     *
-     * @return The current logger factory.
-     */
-    public LoggerFactory<?> getLoggerFactory() {
-        synchronized (EMPTY) {
-            return factory;
-        }
-    }
-
-    /**
-     * Sets a new logger factory for this {@code Logging} instance and every children. The
-     * specified factory will be used by <code>{@linkplain #getLogger(String) getLogger}(name)</code>
-     * when {@code name} is this {@code Logging} name or one of its children.
-     *
-     * <p>If the factory is set to {@code null} (the default), then the standard Logging
framework
-     * will be used.</p>
-     *
-     * @param factory The new logger factory, or {@code null} if none.
-     */
-    @Configuration
-    public void setLoggerFactory(final LoggerFactory<?> factory) {
-        synchronized (EMPTY) {
-            this.factory = factory;
-            for (int i=0; i<children.length; i++) {
-                children[i].setLoggerFactory(factory);
-            }
-            sameLoggerFactory = sameLoggerFactory(ALL.children, ALL.factory); // NOSONAR:
really want static field.
-        }
-    }
-
-    /**
-     * Returns {@code true} if all children use the specified factory.
-     * Used in order to detect a possible optimization for this very common case.
-     */
-    private static boolean sameLoggerFactory(final Logging[] children, final LoggerFactory<?>
factory) {
-        assert Thread.holdsLock(EMPTY);
-        for (int i=0; i<children.length; i++) {
-            final Logging logging = children[i];
-            if (logging.factory != factory || !sameLoggerFactory(logging.children, factory))
{
-                return false;
-            }
-        }
-        return true;
-    }
-
-    /**
-     * Scans the classpath for logger factories. The fully qualified factory classname shall
be
-     * declared in the following file:
-     *
-     * {@preformat text
-     *     META-INF/services/org.apache.sis.util.logging.LoggerFactory
-     * }
-     *
-     * The factory found on the classpath is given to {@link #setLoggerFactory(LoggerFactory)}.
-     * If more than one factory is found, then the log messages will be sent to the logging
-     * frameworks managed by all those factories.
-     *
-     * <p>This method usually doesn't need to be invoked explicitly, since it is automatically
-     * invoked on {@code Logging} class initialization. However developers may invoke it
if
-     * new {@code LoggerFactory}s are added later on the classpath of a running JVM.</p>
-     */
-    @Configuration
-    public void scanLoggerFactory() {
-        LoggerFactory<?> factory = null;
-        for (final LoggerFactory<?> found : ServiceLoader.load(LoggerFactory.class))
{
-            if (factory == null) {
-                factory = found;
-            } else {
-                factory = new DualLoggerFactory(factory, found);
-            }
-        }
-        setLoggerFactory(factory);
-    }
-
-    /**
-     * Flushes all {@linkplain Handler handlers} used by the logger named {@link #name}.
-     * If that logger {@linkplain Logger#getUseParentHandlers() uses parent handlers},
-     * then those handlers will be flushed as well.
-     *
-     * <p>If the log records seem to be interleaved with the content of {@link System#out}
-     * or {@link System#err}, invoking this method before to write to the standard streams
-     * may help.</p>
-     *
-     * @see Handler#flush()
-     */
-    public void flush() {
-        for (Logger logger=getLogger(name); logger!=null; logger=logger.getParent()) {
-            for (final Handler handler : logger.getHandlers()) {
-                handler.flush();
-            }
-            if (!logger.getUseParentHandlers()) {
-                break;
-            }
-        }
-    }
-
-    /**
      * 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

Modified: sis/trunk/sis-utility/src/main/java/org/apache/sis/util/logging/package-info.java
URL: http://svn.apache.org/viewvc/sis/trunk/sis-utility/src/main/java/org/apache/sis/util/logging/package-info.java?rev=1480595&r1=1480594&r2=1480595&view=diff
==============================================================================
--- sis/trunk/sis-utility/src/main/java/org/apache/sis/util/logging/package-info.java [UTF-8]
(original)
+++ sis/trunk/sis-utility/src/main/java/org/apache/sis/util/logging/package-info.java [UTF-8]
Thu May  9 11:38:52 2013
@@ -33,19 +33,25 @@
  * The SIS project uses the standard {@link java.util.logging.Logger} API for its logging,
  * but this package allows redirection of logging messages to some other frameworks like
  * <a href="http://logging.apache.org/log4j/">Log4J</a>.
- *
- * <p>We recommend to stick to standard JDK logging when possible. However if inter-operability
+ * We recommend to stick to standard JDK logging when possible. However if inter-operability
  * with an other logging framework is required, then the only action needed is to include
- * <strong>one</strong> of the following JAR on the classpath:</p>
+ * <strong>one</strong> of the following JAR on the classpath:
+ *
+ * <ul>
+ *   <li>{@code sis-logging-commons.jar} for Apache logging</li>
+ *   <li>{@code sis-logging-log4j.jar} for Log4J logging</li>
+ *   <li>Any other JAR registering a {@link org.apache.sis.util.logging.LoggerFactory}
implementation.</li>
+ * </ul>
  *
+ * {@section Apache SIS logger constants}
+ * Some static final {@code Logger} constant defined in Apache SIS are:
  * <ul>
- *   <li>{@code geotk-logging-commons.jar} for Apache logging</li>
- *   <li>{@code geotk-logging-log4j.jar} for Log4J logging</li>
+ *   <li>{@link org.apache.sis.metadata.iso.ISOMetadata#LOGGER} for the {@code org.apache.sis.metadata.iso.*}
packages</li>
  * </ul>
  *
  * {@section Note for SIS developers}
  * All SIS code should fetch their logger through a call to our custom
- * {@link org.apache.sis.util.logging.Logging#getLogger(String)} method, <strong>not</strong>
+ * {@link org.apache.sis.util.logging.Logging#getLogger(String)} method instead than
  * the standard {@link java.util.logging.Logger#getLogger(String)} method. This is necessary
in
  * order to give SIS a chance to redirect log events to an other logging framework.
  *

Modified: sis/trunk/sis-utility/src/main/java/org/apache/sis/util/resources/Messages.java
URL: http://svn.apache.org/viewvc/sis/trunk/sis-utility/src/main/java/org/apache/sis/util/resources/Messages.java?rev=1480595&r1=1480594&r2=1480595&view=diff
==============================================================================
--- sis/trunk/sis-utility/src/main/java/org/apache/sis/util/resources/Messages.java [UTF-8]
(original)
+++ sis/trunk/sis-utility/src/main/java/org/apache/sis/util/resources/Messages.java [UTF-8]
Thu May  9 11:38:52 2013
@@ -60,11 +60,22 @@ public final class Messages extends Inde
         public static final int ChangedContainerCapacity_2 = 0;
 
         /**
+         * Property “{0}” has been discarded in favor of “{1}”, because those two
properties are
+         * mutually exclusive.
+         */
+        public static final int DiscardedExclusiveProperty_2 = 4;
+
+        /**
          * Text were discarded for some locales.
          */
         public static final int LocalesDiscarded = 2;
 
         /**
+         * Property “{0}” is hidden by “{1}”.
+         */
+        public static final int PropertyHiddenBy_2 = 3;
+
+        /**
          * Unavailable content.
          */
         public static final int UnavailableContent = 1;

Modified: sis/trunk/sis-utility/src/main/java/org/apache/sis/util/resources/Messages.properties
URL: http://svn.apache.org/viewvc/sis/trunk/sis-utility/src/main/java/org/apache/sis/util/resources/Messages.properties?rev=1480595&r1=1480594&r2=1480595&view=diff
==============================================================================
--- sis/trunk/sis-utility/src/main/java/org/apache/sis/util/resources/Messages.properties
[ISO-8859-1] (original)
+++ sis/trunk/sis-utility/src/main/java/org/apache/sis/util/resources/Messages.properties
[ISO-8859-1] Thu May  9 11:38:52 2013
@@ -15,5 +15,7 @@
 # limitations under the License.
 #
 ChangedContainerCapacity_2      = Changed the container capacity from {0} to {1} elements.
+DiscardedExclusiveProperty_2    = Property \u201c{0}\u201d has been discarded in favor of
\u201c{1}\u201d, because those two properties are mutually exclusive.
+PropertyHiddenBy_2              = Property \u201c{0}\u201d is hidden by \u201c{1}\u201d.
 LocalesDiscarded                = Text were discarded for some locales.
 UnavailableContent              = Unavailable content.

Modified: sis/trunk/sis-utility/src/main/java/org/apache/sis/util/resources/Messages_fr.properties
URL: http://svn.apache.org/viewvc/sis/trunk/sis-utility/src/main/java/org/apache/sis/util/resources/Messages_fr.properties?rev=1480595&r1=1480594&r2=1480595&view=diff
==============================================================================
--- sis/trunk/sis-utility/src/main/java/org/apache/sis/util/resources/Messages_fr.properties
[ISO-8859-1] (original)
+++ sis/trunk/sis-utility/src/main/java/org/apache/sis/util/resources/Messages_fr.properties
[ISO-8859-1] Thu May  9 11:38:52 2013
@@ -15,5 +15,7 @@
 # limitations under the License.
 #
 ChangedContainerCapacity_2      = Changement de la capacit\u00e9 du conteneur de {0} vers
{1} \u00e9l\u00e9ments.
+DiscardedExclusiveProperty_2    = La propri\u00e9t\u00e9 \u201c{0}\u201d a \u00e9t\u00e9
\u00e9cart\u00e9e en faveur de \u201c{1}\u201d, parce que ces deux propri\u00e9t\u00e9s sont
mutuellement exclusives.
+PropertyHiddenBy_2              = La propri\u00e9t\u00e9 \u201c{0}\u201d est masqu\u00e9e
par \u201c{1}\u201d.
 LocalesDiscarded                = Des textes ont \u00e9t\u00e9 ignor\u00e9s pour certaines
langues.
 UnavailableContent              = Contenu non-disponible.

Modified: sis/trunk/sis-utility/src/main/java/org/apache/sis/xml/Pooled.java
URL: http://svn.apache.org/viewvc/sis/trunk/sis-utility/src/main/java/org/apache/sis/xml/Pooled.java?rev=1480595&r1=1480594&r2=1480595&view=diff
==============================================================================
--- sis/trunk/sis-utility/src/main/java/org/apache/sis/xml/Pooled.java [UTF-8] (original)
+++ sis/trunk/sis-utility/src/main/java/org/apache/sis/xml/Pooled.java [UTF-8] Thu May  9
11:38:52 2013
@@ -32,7 +32,7 @@ import org.apache.sis.util.Version;
 import org.apache.sis.util.CharSequences;
 import org.apache.sis.util.resources.Errors;
 import org.apache.sis.internal.util.CollectionsExt;
-import org.apache.sis.internal.jaxb.MarshalContext;
+import org.apache.sis.internal.jaxb.Context;
 
 
 /**
@@ -151,11 +151,11 @@ abstract class Pooled {
     }
 
     /**
-     * Returns the initial value of {@link MarshalContext#bitMasks}. Shall be 0 if this object
is
-     * an unmarshaller, or {@link MarshalContext#MARSHALLING} if it is an {@link Unmarshaller}.
+     * Returns the initial value of {@link Context#bitMasks}. Shall be 0 if this object is
+     * an unmarshaller, or {@link Context#MARSHALLING} if it is an {@link Unmarshaller}.
      */
     private int initialBitMasks() {
-        return (this instanceof Marshaller) ? MarshalContext.MARSHALLING : 0;
+        return (this instanceof Marshaller) ? Context.MARSHALLING : 0;
     }
 
     /**
@@ -287,9 +287,9 @@ abstract class Pooled {
                     if (substitutes != null) {
                         for (final CharSequence substitute : substitutes) {
                             if (CharSequences.equalsIgnoreCase(substitute, "language")) {
-                                mask |= MarshalContext.SUBSTITUTE_LANGUAGE;
+                                mask |= Context.SUBSTITUTE_LANGUAGE;
                             } else if (CharSequences.equalsIgnoreCase(substitute, "country"))
{
-                                mask |= MarshalContext.SUBSTITUTE_COUNTRY;
+                                mask |= Context.SUBSTITUTE_COUNTRY;
                             }
                         }
                     }
@@ -324,8 +324,8 @@ abstract class Pooled {
             if (name.equals(XML.TIMEZONE))    return timezone;
             if (name.equals(XML.STRING_SUBSTITUTES)) {
                 final StringBuilder buffer = new StringBuilder();
-                if ((bitMasks & MarshalContext.SUBSTITUTE_LANGUAGE) != 0) buffer.append("language,");
-                if ((bitMasks & MarshalContext.SUBSTITUTE_COUNTRY)  != 0) buffer.append("country,");
+                if ((bitMasks & Context.SUBSTITUTE_LANGUAGE) != 0) buffer.append("language,");
+                if ((bitMasks & Context.SUBSTITUTE_COUNTRY)  != 0) buffer.append("country,");
                 final int length = buffer.length();
                 if (length != 0) {
                     buffer.setLength(length - 1); // Remove the last coma.
@@ -417,7 +417,7 @@ abstract class Pooled {
      * operation. Must be followed by a call to {@code finish()} in a {@code finally} block.
      *
      * {@preformat java
-     *     MarshalContext context = begin();
+     *     Context context = begin();
      *     try {
      *         ...
      *     } finally {
@@ -425,9 +425,9 @@ abstract class Pooled {
      *     }
      * }
      *
-     * @see MarshalContext#finish();
+     * @see Context#finish();
      */
-    final MarshalContext begin() {
-        return new MarshalContext(converter, resolver, gmlVersion, schemas, locale, timezone,
bitMasks);
+    final Context begin() {
+        return new Context(converter, resolver, gmlVersion, schemas, locale, timezone, bitMasks);
     }
 }

Modified: sis/trunk/sis-utility/src/main/java/org/apache/sis/xml/PooledMarshaller.java
URL: http://svn.apache.org/viewvc/sis/trunk/sis-utility/src/main/java/org/apache/sis/xml/PooledMarshaller.java?rev=1480595&r1=1480594&r2=1480595&view=diff
==============================================================================
--- sis/trunk/sis-utility/src/main/java/org/apache/sis/xml/PooledMarshaller.java [UTF-8] (original)
+++ sis/trunk/sis-utility/src/main/java/org/apache/sis/xml/PooledMarshaller.java [UTF-8] Thu
May  9 11:38:52 2013
@@ -32,7 +32,7 @@ import javax.xml.validation.Schema;
 import org.xml.sax.ContentHandler;
 import org.w3c.dom.Node;
 import org.apache.sis.util.Decorator;
-import org.apache.sis.internal.jaxb.MarshalContext;
+import org.apache.sis.internal.jaxb.Context;
 
 
 /**
@@ -42,7 +42,7 @@ import org.apache.sis.internal.jaxb.Mars
  * <ul>
  *   <li>Save properties before modification, in order to restore them to their original
values
  *       when the marshaller is recycled.</li>
- *   <li>Constructs a SIS {@link MarshalContext} object on marshalling, in order to
give
+ *   <li>Constructs a SIS {@link Context} object on marshalling, in order to give
  *       additional information to the SIS object being marshalled.</li>
  * </ul>
  *
@@ -106,7 +106,7 @@ final class PooledMarshaller extends Poo
      */
     @Override
     public void marshal(final Object object, final Result output) throws JAXBException {
-        final MarshalContext context = begin();
+        final Context context = begin();
         try {
             marshaller.marshal(object, output);
         } finally {
@@ -119,7 +119,7 @@ final class PooledMarshaller extends Poo
      */
     @Override
     public void marshal(final Object object, final OutputStream output) throws JAXBException
{
-        final MarshalContext context = begin();
+        final Context context = begin();
         try {
             marshaller.marshal(object, output);
         } finally {
@@ -132,7 +132,7 @@ final class PooledMarshaller extends Poo
      */
     @Override
     public void marshal(final Object object, final File output) throws JAXBException {
-        final MarshalContext context = begin();
+        final Context context = begin();
         try {
             marshaller.marshal(object, output);
         } finally {
@@ -145,7 +145,7 @@ final class PooledMarshaller extends Poo
      */
     @Override
     public void marshal(final Object object, final Writer output) throws JAXBException {
-        final MarshalContext context = begin();
+        final Context context = begin();
         try {
             marshaller.marshal(object, output);
         } finally {
@@ -158,7 +158,7 @@ final class PooledMarshaller extends Poo
      */
     @Override
     public void marshal(final Object object, final ContentHandler output) throws JAXBException
{
-        final MarshalContext context = begin();
+        final Context context = begin();
         try {
             marshaller.marshal(object, output);
         } finally {
@@ -171,7 +171,7 @@ final class PooledMarshaller extends Poo
      */
     @Override
     public void marshal(final Object object, final Node output) throws JAXBException {
-        final MarshalContext context = begin();
+        final Context context = begin();
         try {
             marshaller.marshal(object, output);
         } finally {
@@ -184,7 +184,7 @@ final class PooledMarshaller extends Poo
      */
     @Override
     public void marshal(final Object object, final XMLStreamWriter output) throws JAXBException
{
-        final MarshalContext context = begin();
+        final Context context = begin();
         try {
             marshaller.marshal(object, output);
         } finally {
@@ -197,7 +197,7 @@ final class PooledMarshaller extends Poo
      */
     @Override
     public void marshal(final Object object, final XMLEventWriter output) throws JAXBException
{
-        final MarshalContext context = begin();
+        final Context context = begin();
         try {
             marshaller.marshal(object, output);
         } finally {
@@ -210,7 +210,7 @@ final class PooledMarshaller extends Poo
      */
     @Override
     public Node getNode(final Object object) throws JAXBException {
-        final MarshalContext context = begin();
+        final Context context = begin();
         try {
             return marshaller.getNode(object);
         } finally {

Modified: sis/trunk/sis-utility/src/main/java/org/apache/sis/xml/PooledUnmarshaller.java
URL: http://svn.apache.org/viewvc/sis/trunk/sis-utility/src/main/java/org/apache/sis/xml/PooledUnmarshaller.java?rev=1480595&r1=1480594&r2=1480595&view=diff
==============================================================================
--- sis/trunk/sis-utility/src/main/java/org/apache/sis/xml/PooledUnmarshaller.java [UTF-8]
(original)
+++ sis/trunk/sis-utility/src/main/java/org/apache/sis/xml/PooledUnmarshaller.java [UTF-8]
Thu May  9 11:38:52 2013
@@ -35,7 +35,7 @@ import javax.xml.validation.Schema;
 import org.w3c.dom.Node;
 import org.xml.sax.InputSource;
 import org.apache.sis.util.Decorator;
-import org.apache.sis.internal.jaxb.MarshalContext;
+import org.apache.sis.internal.jaxb.Context;
 
 
 /**
@@ -45,7 +45,7 @@ import org.apache.sis.internal.jaxb.Mars
  * <ul>
  *   <li>Save properties before modification, in order to restore them to their original
values
  *       when the unmarshaller is recycled.</li>
- *   <li>Constructs a SIS {@link MarshalContext} object on unmarshalling, in order
to give
+ *   <li>Constructs a SIS {@link Context} object on unmarshalling, in order to give
  *       additional information to the SIS object being unmarshalled.</li>
  * </ul>
  *
@@ -107,7 +107,7 @@ final class PooledUnmarshaller extends P
      */
     @Override
     public Object unmarshal(final InputStream input) throws JAXBException {
-        final MarshalContext context = begin();
+        final Context context = begin();
         try {
             return unmarshaller.unmarshal(input);
         } finally {
@@ -120,7 +120,7 @@ final class PooledUnmarshaller extends P
      */
     @Override
     public Object unmarshal(final URL input) throws JAXBException {
-        final MarshalContext context = begin();
+        final Context context = begin();
         try {
             return unmarshaller.unmarshal(input);
         } finally {
@@ -133,7 +133,7 @@ final class PooledUnmarshaller extends P
      */
     @Override
     public Object unmarshal(final File input) throws JAXBException {
-        final MarshalContext context = begin();
+        final Context context = begin();
         try {
             return unmarshaller.unmarshal(input);
         } finally {
@@ -146,7 +146,7 @@ final class PooledUnmarshaller extends P
      */
     @Override
     public Object unmarshal(final Reader input) throws JAXBException {
-        final MarshalContext context = begin();
+        final Context context = begin();
         try {
             return unmarshaller.unmarshal(input);
         } finally {
@@ -159,7 +159,7 @@ final class PooledUnmarshaller extends P
      */
     @Override
     public Object unmarshal(final InputSource input) throws JAXBException {
-        final MarshalContext context = begin();
+        final Context context = begin();
         try {
             return unmarshaller.unmarshal(input);
         } finally {
@@ -172,7 +172,7 @@ final class PooledUnmarshaller extends P
      */
     @Override
     public Object unmarshal(final Node input) throws JAXBException {
-        final MarshalContext context = begin();
+        final Context context = begin();
         try {
             return unmarshaller.unmarshal(input);
         } finally {
@@ -185,7 +185,7 @@ final class PooledUnmarshaller extends P
      */
     @Override
     public <T> JAXBElement<T> unmarshal(final Node input, final Class<T>
declaredType) throws JAXBException {
-        final MarshalContext context = begin();
+        final Context context = begin();
         try {
             return unmarshaller.unmarshal(input, declaredType);
         } finally {
@@ -198,7 +198,7 @@ final class PooledUnmarshaller extends P
      */
     @Override
     public Object unmarshal(final Source input) throws JAXBException {
-        final MarshalContext context = begin();
+        final Context context = begin();
         try {
             return unmarshaller.unmarshal(input);
         } finally {
@@ -211,7 +211,7 @@ final class PooledUnmarshaller extends P
      */
     @Override
     public <T> JAXBElement<T> unmarshal(final Source input, final Class<T>
declaredType) throws JAXBException {
-        final MarshalContext context = begin();
+        final Context context = begin();
         try {
             return unmarshaller.unmarshal(input, declaredType);
         } finally {
@@ -224,7 +224,7 @@ final class PooledUnmarshaller extends P
      */
     @Override
     public Object unmarshal(final XMLStreamReader input) throws JAXBException {
-        final MarshalContext context = begin();
+        final Context context = begin();
         try {
             return unmarshaller.unmarshal(input);
         } finally {
@@ -237,7 +237,7 @@ final class PooledUnmarshaller extends P
      */
     @Override
     public <T> JAXBElement<T> unmarshal(final XMLStreamReader input, final Class<T>
declaredType) throws JAXBException {
-        final MarshalContext context = begin();
+        final Context context = begin();
         try {
             return unmarshaller.unmarshal(input, declaredType);
         } finally {
@@ -250,7 +250,7 @@ final class PooledUnmarshaller extends P
      */
     @Override
     public Object unmarshal(final XMLEventReader input) throws JAXBException {
-        final MarshalContext context = begin();
+        final Context context = begin();
         try {
             return unmarshaller.unmarshal(input);
         } finally {
@@ -263,7 +263,7 @@ final class PooledUnmarshaller extends P
      */
     @Override
     public <T> JAXBElement<T> unmarshal(final XMLEventReader input, final Class<T>
declaredType) throws JAXBException {
-        final MarshalContext context = begin();
+        final Context context = begin();
         try {
             return unmarshaller.unmarshal(input, declaredType);
         } finally {

Modified: sis/trunk/sis-utility/src/test/java/org/apache/sis/test/AnnotationsTestCase.java
URL: http://svn.apache.org/viewvc/sis/trunk/sis-utility/src/test/java/org/apache/sis/test/AnnotationsTestCase.java?rev=1480595&r1=1480594&r2=1480595&view=diff
==============================================================================
--- sis/trunk/sis-utility/src/test/java/org/apache/sis/test/AnnotationsTestCase.java [UTF-8]
(original)
+++ sis/trunk/sis-utility/src/test/java/org/apache/sis/test/AnnotationsTestCase.java [UTF-8]
Thu May  9 11:38:52 2013
@@ -128,7 +128,7 @@ public abstract strictfp class Annotatio
      *   </CI_ResponsibleParty>
      * }
      *
-     * To reflect that fact, this method shall return the {@link org.apache.sis.internal.jaxb.metadata.CI_Contact}
+     * To reflect that fact, this method shall return the internal {@code CI_Contact}
      * wrapper class for the {@link org.apache.sis.metadata.iso.citation.DefaultCitation}
argument.
      * If no wrapper is expected for the given class, then this method shall return {@code
null}.
      *

Modified: sis/trunk/sis-utility/src/test/java/org/apache/sis/test/TestCase.java
URL: http://svn.apache.org/viewvc/sis/trunk/sis-utility/src/test/java/org/apache/sis/test/TestCase.java?rev=1480595&r1=1480594&r2=1480595&view=diff
==============================================================================
--- sis/trunk/sis-utility/src/test/java/org/apache/sis/test/TestCase.java [UTF-8] (original)
+++ sis/trunk/sis-utility/src/test/java/org/apache/sis/test/TestCase.java [UTF-8] Thu May
 9 11:38:52 2013
@@ -92,7 +92,7 @@ public abstract strictfp class TestCase 
      * {@code true} if the {@value org.apache.sis.test.TestConfiguration#VERBOSE_OUTPUT_KEY}
      * system property is set to {@code true}.
      */
-    static final boolean verbose;
+    public static final boolean verbose;
 
     /**
      * Sets the {@link #out} writer and its underlying {@link #buffer}.

Propchange: sis/trunk/storage/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Thu May  9 11:38:52 2013
@@ -0,0 +1,10 @@
+.project
+.settings
+.classpath
+.jetproperties
+.wtpmodules
+target
+bin
+cobertura.ser
+nbproject
+nbactions.xml

Modified: sis/trunk/storage/pom.xml
URL: http://svn.apache.org/viewvc/sis/trunk/storage/pom.xml?rev=1480595&r1=1480591&r2=1480595&view=diff
==============================================================================
--- sis/trunk/storage/pom.xml (original)
+++ sis/trunk/storage/pom.xml Thu May  9 11:38:52 2013
@@ -28,7 +28,7 @@
   <parent>
     <groupId>org.apache.sis</groupId>
     <artifactId>sis-parent</artifactId>
-    <version>0.3-jdk6-SNAPSHOT</version>
+    <version>0.3-geoapi3.0-SNAPSHOT</version>
   </parent>
 
 
@@ -85,7 +85,7 @@
     </dependency>
     <dependency>
       <groupId>org.opengis</groupId>
-      <artifactId>geoapi-pending</artifactId>
+      <artifactId>geoapi</artifactId>
     </dependency>
   </dependencies>
 

Modified: sis/trunk/storage/sis-netcdf/pom.xml
URL: http://svn.apache.org/viewvc/sis/trunk/storage/sis-netcdf/pom.xml?rev=1480595&r1=1480591&r2=1480595&view=diff
==============================================================================
--- sis/trunk/storage/sis-netcdf/pom.xml (original)
+++ sis/trunk/storage/sis-netcdf/pom.xml Thu May  9 11:38:52 2013
@@ -28,7 +28,7 @@
   <parent>
     <groupId>org.apache.sis</groupId>
     <artifactId>storage</artifactId>
-    <version>0.3-jdk6-SNAPSHOT</version>
+    <version>0.3-geoapi3.0-SNAPSHOT</version>
   </parent>
 
 



Mime
View raw message