sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1445244 [2/2] - in /sis/branches/JDK6: ./ sis-referencing/src/test/java/org/apache/sis/geometry/ sis-utility/ sis-utility/src/main/java/org/apache/sis/internal/jaxb/ sis-utility/src/main/java/org/apache/sis/internal/jaxb/gco/ sis-utility/s...
Date Tue, 12 Feb 2013 16:32:30 GMT
Modified: sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/util/iso/ResourceInternationalString.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/util/iso/ResourceInternationalString.java?rev=1445244&r1=1445243&r2=1445244&view=diff
==============================================================================
--- sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/util/iso/ResourceInternationalString.java (original)
+++ sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/util/iso/ResourceInternationalString.java Tue Feb 12 16:32:28 2013
@@ -107,9 +107,8 @@ public class ResourceInternationalString
 
     /**
      * Returns the resource bundle for the given locale. The default implementation fetches the
-     * bundle from the name given at {@linkplain #ResourceInternationalString(String,String)
-     * construction time}. Subclasses can override this method if they need to fetch the
-     * bundle in an other way.
+     * bundle from the name given at {@linkplain #ResourceInternationalString construction time}.
+     * Subclasses can override this method if they need to fetch the bundle in an other way.
      *
      * @param  locale The locale for which to get the resource bundle.
      * @return The resource bundle for the given locale.
@@ -123,21 +122,22 @@ public class ResourceInternationalString
 
     /**
      * Returns a string in the specified locale. If there is no string for the specified
-     * {@code locale}, then this method search for a string in an other locale as
+     * {@code locale}, then this method searches for a string in an other locale as
      * specified in the {@link ResourceBundle} class description.
      *
-     * @param  locale The locale to look for, or {@code null} for an unlocalized version.
-     * @return The string in the specified locale, or in a default locale.
+     * {@section Handling of <code>null</code> argument value}
+     * In the default implementation, the {@code null} locale is handled as a synonymous of
+     * {@code Locale.ROOT}. However subclasses are free to use a different fallback. Client
+     * code are encouraged to specify only non-null values for more determinist behavior.
+     *
+     * @param  locale The desired locale for the string to be returned.
+     * @return The string in the specified locale, or in a fallback locale.
      * @throws MissingResourceException is the key given to the constructor is invalid.
      */
     @Override
     public String toString(Locale locale) throws MissingResourceException {
         if (locale == null) {
-            // The English locale (NOT the system default) is often used
-            // as the real identifier in OGC IdentifiedObject naming. If
-            // a user wants a string in the system default locale, he
-            // should invokes the 'toString()' method instead.
-            locale = Locale.ENGLISH;
+            locale = Locale.ROOT; // For consistency with DefaultInternationalString.
         }
         return getBundle(locale).getString(key);
     }

Modified: sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/util/iso/Types.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/util/iso/Types.java?rev=1445244&r1=1445243&r2=1445244&view=diff
==============================================================================
--- sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/util/iso/Types.java (original)
+++ sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/util/iso/Types.java Tue Feb 12 16:32:28 2013
@@ -217,9 +217,8 @@ public final class Types extends Static 
      *
      * <ul>
      *   <li>If {@code code} is {@code null}, then this method returns {@code null}.</li>
-     *   <li>If {@code locale} is {@code null}, then this method uses {@link Locale#US}
-     *       as a close approximation of "unlocalized" strings since OGC standards are
-     *       defined in English.</li>
+     *   <li>If {@code locale} is {@code null}, then this method uses {@link Locale#ROOT}
+     *       for "unlocalized" (typically English) strings.</li>
      *   <li>If there is no resources for the given code in the given language, then this method
      *       fallback on other languages as described in {@link ResourceBundle} javadoc.</li>
      *   <li>If there is no localized resources for the given code, then this method fallback
@@ -237,7 +236,7 @@ public final class Types extends Static 
             return null;
         }
         if (locale == null) {
-            locale = Locale.US;
+            locale = Locale.ROOT;
         }
         /*
          * The code below is a duplicated - in a different way - of CodeListProxy(CodeList)

Modified: sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.java?rev=1445244&r1=1445243&r2=1445244&view=diff
==============================================================================
--- sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.java (original)
+++ sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.java Tue Feb 12 16:32:28 2013
@@ -16,6 +16,7 @@
  */
 package org.apache.sis.util.resources;
 
+import java.net.URL;
 import java.util.Locale;
 import java.util.MissingResourceException;
 import org.opengis.util.InternationalString;
@@ -174,6 +175,11 @@ public final class Errors extends Indexe
         public static final int IllegalRange_2 = 11;
 
         /**
+         * Units “{0}” and “{1}” are incompatible.
+         */
+        public static final int IncompatibleUnits_2 = 67;
+
+        /**
          * Value “{1}” of attribute ‘{0}’ is inconsistent with other attributes.
          */
         public static final int InconsistentAttribute_2 = 27;
@@ -234,6 +240,11 @@ public final class Errors extends Indexe
         public static final int NegativeArgument_2 = 8;
 
         /**
+         * No unit of measurement has been specified.
+         */
+        public static final int NoUnit = 68;
+
+        /**
          * Node “{0}” can not be a child of itself.
          */
         public static final int NodeChildOfItself_1 = 37;
@@ -289,11 +300,26 @@ public final class Errors extends Indexe
         public static final int NotAPrimitiveWrapper_1 = 10;
 
         /**
+         * Class ‘{0}’ is not a comparable.
+         */
+        public static final int NotComparableClass_1 = 66;
+
+        /**
          * Argument ‘{0}’ shall not be null.
          */
         public static final int NullArgument_1 = 0;
 
         /**
+         * Null key is not allowed in this dictionary.
+         */
+        public static final int NullMapKey = 64;
+
+        /**
+         * Null values are not allowed in this dictionary.
+         */
+        public static final int NullMapValue = 65;
+
+        /**
          * Array length is {0}, while we expected an even length.
          */
         public static final int OddArrayLength_1 = 61;
@@ -369,6 +395,11 @@ public final class Errors extends Indexe
         public static final int UnsupportedOperation_1 = 20;
 
         /**
+         * The ‘{0}’ type is unsupported.
+         */
+        public static final int UnsupportedType_1 = 69;
+
+        /**
          * A value is already defined for “{0}”.
          */
         public static final int ValueAlreadyDefined_1 = 13;
@@ -387,10 +418,11 @@ public final class Errors extends Indexe
     /**
      * Constructs a new resource bundle loading data from the given UTF file.
      *
-     * @param filename The file or the JAR entry containing resources.
+     * @param resources The path of the binary file containing resources, or {@code null} if
+     *        there is no resources. The resources may be a file or an entry in a JAR file.
      */
-    Errors(final String filename) {
-        super(filename);
+    Errors(final URL resources) {
+        super(resources);
     }
 
     /**

Modified: sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.properties
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.properties?rev=1445244&r1=1445243&r2=1445244&view=diff
==============================================================================
--- sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.properties (original)
+++ sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.properties Tue Feb 12 16:32:28 2013
@@ -46,6 +46,7 @@ IllegalLanguageCode_1           = The \u
 IllegalOrdinateRange_3          = The [{0} \u2026 {1}] range of ordinate values is not valid for the \u201c{2}\u201d axis.
 IllegalPropertyClass_2          = Property \u2018{0}\u2019 can be associated to an instance of \u2018{1}\u2019.
 IllegalRange_2                  = Range [{0} \u2026 {1}] is not valid.
+IncompatibleUnits_2             = Units \u201c{0}\u201d and \u201c{1}\u201d are incompatible.
 InconsistentAttribute_2         = Value \u201c{1}\u201d of attribute \u2018{0}\u2019 is inconsistent with other attributes.
 InconsistentTableColumns        = Inconsistent table columns.
 IdentifierAlreadyBound_1        = Identifier \u201c{0}\u201d is already associated to another object.
@@ -70,7 +71,12 @@ NonScaleUnit_1                  = \u201c
 NonTemporalUnit_1               = \u201c{0}\u201d is not a time unit.
 NotANumber_1                    = Argument \u2018{0}\u2019 shall not be NaN (Not-a-Number).
 NotAPrimitiveWrapper_1          = Class \u2018{0}\u2019 is not a primitive type wrapper.
+NotComparableClass_1            = Class \u2018{0}\u2019 is not a comparable.
+NoUnit                          = No unit of measurement has been specified.
 NullArgument_1                  = Argument \u2018{0}\u2019 shall not be null.
+# Use the OGC/ISO "Dictionary" word instead of "Map" for avoiding confusion with geographic map.
+NullMapKey                      = Null key is not allowed in this dictionary.
+NullMapValue                    = Null values are not allowed in this dictionary.
 OddArrayLength_1                = Array length is {0}, while we expected an even length.
 RecursiveCreateCallForKey_1     = Recursive call while creating an object for the \u201c{0}\u201d key.
 RequireDecimalSeparator         = A decimal separator is required.
@@ -86,6 +92,7 @@ UnparsableStringForClass_3      = Text \
 UnspecifiedFormatForClass_1     = No format is specified for objects of class \u2018{0}\u2019.
 UnsupportedImplementation_1     = Can not handle instances of \u2018{0}\u2019 because arbitrary implementations are not yet supported.
 UnsupportedOperation_1          = The \u2018{0}\u2019 operation is unsupported.
+UnsupportedType_1               = The \u2018{0}\u2019 type is unsupported.
 ValueAlreadyDefined_1           = A value is already defined for \u201c{0}\u201d.
 ValueNotGreaterThanZero_2       = Value \u2018{0}\u2019={1} is invalid. Expected a number greater than 0.
 ValueOutOfRange_4               = Value \u2018{0}\u2019={3} is invalid. Expected a value in the [{1} \u2026 {2}] range.

Modified: sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/util/resources/Errors_fr.properties
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/util/resources/Errors_fr.properties?rev=1445244&r1=1445243&r2=1445244&view=diff
==============================================================================
--- sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/util/resources/Errors_fr.properties (original)
+++ sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/util/resources/Errors_fr.properties Tue Feb 12 16:32:28 2013
@@ -35,6 +35,7 @@ IllegalLanguageCode_1           = Le cod
 IllegalOrdinateRange_3          = La plage de valeurs de coordonn\u00e9es [{1} \u2026 {2}] n\u2019est pas valide pour l\u2019axe \u201c{0}\u201d.
 IllegalPropertyClass_2          = La propri\u00e9t\u00e9 \u2018{0}\u2019 ne peut pas \u00eatre associ\u00e9e \u00e0 une valeur de type \u2018{1}\u2019.
 IllegalRange_2                  = La plage [{0} \u2026 {1}] n\u2019est pas valide.
+IncompatibleUnits_2             = Les unit\u00e9s \u201c{0}\u201d et \u201c{1}\u201d ne sont pas compatibles.
 InconsistentAttribute_2         = La valeur \u201c{1}\u201d de l\u2019attribut \u2018{0}\u2019 n\u2019est pas coh\u00e9rente avec celles des autres attributs.
 InconsistentTableColumns        = Les colonnes des tables ne sont pas coh\u00e9rentes.
 IdentifierAlreadyBound_1        = L\u2019identifiant \u201c{0}\u201d est d\u00e9j\u00e0 associ\u00e9 \u00e0 un autre objet.
@@ -59,7 +60,11 @@ NonScaleUnit_1                  = \u201c
 NonTemporalUnit_1               = \u201c{0}\u201d n\u2019est pas une unit\u00e9 de temps.
 NotANumber_1                    = L\u2019argument \u2018{0}\u2019 ne doit pas \u00eatre NaN (Not-a-Number).
 NotAPrimitiveWrapper_1          = La classe \u2018{0}\u2019 n\u2019est pas un adaptateur d\u2019un type primitif.
+NotComparableClass_1            = La classe \u2018{0}\u2019 n\u2019est pas comparable.
+NoUnit                          = Aucune unit\u00e9 de mesure n\u2019a \u00e9t\u00e9 sp\u00e9cifi\u00e9e.
 NullArgument_1                  = L\u2019argument \u2018{0}\u2019 ne doit pas \u00eatre nul.
+NullMapKey                      = La cl\u00e9 nulle n\u2019est pas autoris\u00e9e dans ce dictionnaire.
+NullMapValue                    = Les valeurs nulles ne sont pas autoris\u00e9es dans ce dictionnaire.
 OddArrayLength_1                = La longueur du tableau est {0}, alors qu\u2019on attendait une longueur paire.
 RecursiveCreateCallForKey_1     = Appel r\u00e9cursif lors de la cr\u00e9ation d\u2019un objet pour la cl\u00e9 \u201c{0}\u201d.
 RequireDecimalSeparator         = Un s\u00e9parateur d\u00e9cimal est requis.
@@ -75,6 +80,7 @@ UnparsableStringForClass_2      = Le tex
 UnparsableStringForClass_3      = Le texte \u201c{1}\u201d n\u2019est pas reconnu comme un objet de type \u2018{0}\u2019, \u00e0 cause des caract\u00e8res \u201c{2}\u201d.
 UnsupportedImplementation_1     = Les instances de \u2018{0}\u2019 ne peuvent pas \u00eatre g\u00e9r\u00e9es parce que les impl\u00e9mentations arbitraires ne sont pas encore support\u00e9es.
 UnsupportedOperation_1          = L\u2019op\u00e9ration \u2018{0}\u2019 n\u2019est pas support\u00e9e.
+UnsupportedType_1               = Le type \u2018{0}\u2019 n\u2019est pas support\u00e9.
 ValueAlreadyDefined_1           = Une valeur est d\u00e9j\u00e0 d\u00e9finie pour \u201c{0}\u201d.
 ValueNotGreaterThanZero_2       = La valeur \u2018{0}\u2019={1} n\u2019est pas valide. On attendait un nombre positif non-nul.
 ValueOutOfRange_4               = La valeur \u2018{0}\u2019={3} est invalide. Une valeur dans la plage [{1} \u2026 {2}] \u00e9tait attendue.

Modified: sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/util/resources/IndexedResourceBundle.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/util/resources/IndexedResourceBundle.java?rev=1445244&r1=1445243&r2=1445244&view=diff
==============================================================================
--- sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/util/resources/IndexedResourceBundle.java (original)
+++ sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/util/resources/IndexedResourceBundle.java Tue Feb 12 16:32:28 2013
@@ -16,11 +16,10 @@
  */
 package org.apache.sis.util.resources;
 
+import java.net.URL;
 import java.io.BufferedInputStream;
 import java.io.DataInputStream;
-import java.io.FileNotFoundException;
 import java.io.IOException;
-import java.io.InputStream;
 import java.text.MessageFormat;
 import java.util.Enumeration;
 import java.util.Locale;
@@ -35,6 +34,7 @@ import org.opengis.util.InternationalStr
 
 import org.apache.sis.util.Debug;
 import org.apache.sis.util.Classes;
+import org.apache.sis.util.Localized;
 import org.apache.sis.util.Exceptions;
 import org.apache.sis.util.CharSequences;
 import org.apache.sis.util.logging.Logging;
@@ -60,7 +60,7 @@ import org.apache.sis.internal.util.JDK7
  * @module
  */
 @ThreadSafe
-public class IndexedResourceBundle extends ResourceBundle {
+public class IndexedResourceBundle extends ResourceBundle implements Localized {
     /**
      * Maximum string length for text inserted into another text. This parameter is used by
      * {@link #summarize}. Resource strings are never cut to this length. However, text replacing
@@ -69,33 +69,23 @@ public class IndexedResourceBundle exten
     private static final int MAX_STRING_LENGTH = 200;
 
     /**
-     * The resource name of the binary file containing resources. It may be a file name or an
-     * entry in a JAR file. The path must be relative to the package containing the subclass
-     * of {@code IndexedResourceBundle}.
+     * The path of the binary file containing resources, or {@code null} if there is no resources
+     * of if the resources have already been loaded. The resources may be a file or an entry in a
+     * JAR file.
      */
-    private final String filename;
+    private URL resources;
 
     /**
      * The array of resources. Keys are an array index. For example, the value for key "14" is
      * {@code values[14]}. This array will be loaded only when first needed. We should not load
      * it at construction time, because some {@code ResourceBundle} objects will never ask for
-     * values. This is particularly the case for ancestor classes of {@code Resources_fr_CA},
+     * values. This is particularly the case for parent resources of {@code Resources_fr_CA},
      * {@code Resources_en}, {@code Resources_de}, etc., which will only be used if a key has
-     * not been found in the subclass.
+     * not been found in the child resources.
      *
      * @see #ensureLoaded(String)
      */
-    private String[] values;
-
-    /**
-     * The locale for formatting objects like number, date, etc. There are two possible Locales
-     * we could use: default locale or resource bundle locale. If the default locale uses the same
-     * language as this ResourceBundle's locale, then we will use the default locale. This allows
-     * dates and numbers to be formatted according to user conventions (e.g. French Canada) even
-     * if the ResourceBundle locale is different (e.g. standard French). However, if languages
-     * don't match, then we will use ResourceBundle locale for better coherence.
-     */
-    private transient Locale formatLocale;
+    private volatile String[] values;
 
     /**
      * The object to use for formatting messages. This object
@@ -113,11 +103,11 @@ public class IndexedResourceBundle exten
     /**
      * Constructs a new resource bundle loading data from the given UTF file.
      *
-     * @param filename The file or the JAR entry containing resources. The path must be relative
-     *        to the package of the {@code IndexedResourceBundle} subclass being constructed.
+     * @param resources The path of the binary file containing resources, or {@code null} if
+     *        there is no resources. The resources may be a file or an entry in a JAR file.
      */
-    protected IndexedResourceBundle(final String filename) {
-        this.filename = filename;
+    protected IndexedResourceBundle(final URL resources) {
+        this.resources = resources;
     }
 
     /**
@@ -143,24 +133,6 @@ public class IndexedResourceBundle exten
     }
 
     /**
-     * Returns the locale to use for formatters. It is often the same than {@link #getLocale()},
-     * except if the later has the same language than the default locale, in which case this
-     * method returns the default locale. For example if this {@code IndexResourceBundle} is
-     * for the French locale but the user is French Canadian, we will format the dates using
-     * Canada French conventions rather than France conventions.
-     */
-    private Locale getFormatLocale() {
-        if (formatLocale == null) {
-            formatLocale = Locale.getDefault();
-            final Locale rl = getLocale(); // Sometime null with IBM's JDK.
-            if (rl != null && !formatLocale.getLanguage().equalsIgnoreCase(rl.getLanguage())) {
-                formatLocale = rl;
-            }
-        }
-        return formatLocale;
-    }
-
-    /**
      * Returns a handler for the constants declared in the inner {@code Keys} class.
      * Subclasses defined in the {@code org.apache.sis.util.resources} package
      * override this method for efficiency. However the default implementation
@@ -271,78 +243,75 @@ public class IndexedResourceBundle exten
      * @throws MissingResourceException if this method failed to load resources.
      */
     private String[] ensureLoaded(final String key) throws MissingResourceException {
-        final String methodName = (key != null) ? "getObject" : "getKeys";
-        LogRecord record = null;
-        try {
-            String[] values;
-            synchronized (this) {
-                values = this.values;
-                if (values != null) {
-                    return values;
-                }
+        String[] values = this.values;
+        if (values == null) synchronized (this) {
+            values = this.values;
+            if (values == null) {
                 /*
-                 * Prepares a log record.  We will wait for successful loading before
-                 * posting this record.  If loading fails, the record will be changed
-                 * into an error record. Note that the message must be logged outside
-                 * the synchronized block, otherwise there is dead locks!
+                 * If there is no explicit resources for this instance, inherit the resources
+                 * from the parent. Note that this IndexedResourceBundle instance may still
+                 * differ from its parent in the way date and numbers are formatted.
                  */
-                record = new LogRecord(Level.FINER, "Loaded resources for {0} from bundle \"{1}\".");
-                /*
-                 * Loads resources from the UTF file.
-                 */
-                InputStream in;
-                String name = filename;
-                while ((in = getClass().getResourceAsStream(name)) == null) { // NOSONAR
-                    final int ext  = name.lastIndexOf('.');
-                    final int lang = name.lastIndexOf('_', ext-1);
-                    if (lang <= 0) {
-                        throw new FileNotFoundException(filename);
-                    }
-                    final int length = name.length();
-                    name = new StringBuilder(lang + (length-ext))
-                            .append(name, 0, lang).append(name, ext, length).toString();
-                }
-                final DataInputStream input = new DataInputStream(new BufferedInputStream(in));
-                try {
-                    this.values = values = new String[input.readInt()];
-                    for (int i=0; i<values.length; i++) {
-                        values[i] = input.readUTF();
-                        if (values[i].isEmpty()) {
-                            values[i] = null;
+                if (resources == null) {
+                    // If we get a NullPointerException or ClassCastException here,
+                    // it would be a bug in the way we create the chain of parents.
+                    values = ((IndexedResourceBundle) parent).ensureLoaded(key);
+                } else {
+                    /*
+                     * Prepares a log record.  We will wait for successful loading before
+                     * posting this record.  If loading fails, the record will be changed
+                     * into an error record. Note that the message must be logged outside
+                     * the synchronized block, otherwise there is dead locks!
+                     */
+                    final Locale    locale     = getLocale(); // Sometime null with IBM's JDK.
+                    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}\".");
+                    /*
+                     * Loads resources from the UTF file.
+                     */
+                    try {
+                        DataInputStream input = new DataInputStream(new BufferedInputStream(resources.openStream()));
+                        values = new String[input.readInt()];
+                        for (int i=0; i<values.length; i++) {
+                            values[i] = input.readUTF();
+                            if (values[i].isEmpty()) {
+                                values[i] = null;
+                            }
                         }
+                        input.close();
+                    } catch (IOException exception) {
+                        record.setLevel  (Level.WARNING);
+                        record.setMessage(exception.getMessage()); // For administrator, use system locale.
+                        record.setThrown (exception);
+                        Logging.log(IndexedResourceBundle.class, methodName, record);
+                        final MissingResourceException error = new MissingResourceException(
+                                Exceptions.getLocalizedMessage(exception, locale), // For users, use requested locale.
+                                baseName, key);
+                        error.initCause(exception);
+                        throw error;
                     }
-                } finally {
-                    input.close();
-                }
-                /*
-                 * Now, logs the message. This message is not localized.  Note that
-                 * Locale.getDisplayName() may return different string on different
-                 * Java implementation, but it doesn't matter here since we use the
-                 * result only for logging purpose.
-                 */
-                String language = null;
-                final Locale rl = getLocale(); // Sometime null with IBM's JDK.
-                if (rl != null) {
-                    language = rl.getDisplayName(Locale.US);
-                }
-                if (language == null || language.isEmpty()) {
-                    language = "<default>";
+                    /*
+                     * Now, logs the message. This message is provided only in English.
+                     * Note that Locale.getDisplayName() may return different string on
+                     * different Java implementation, but it doesn't matter here since
+                     * we use the result only for logging purpose.
+                     */
+                    String language = null;
+                    if (locale != null) {
+                        language = locale.getDisplayName(Locale.US);
+                    }
+                    if (language == null || language.isEmpty()) {
+                        language = "<root>";
+                    }
+                    record.setParameters(new String[] {language, baseName});
+                    Logging.log(IndexedResourceBundle.class, methodName, record);
+                    resources = null; // Not needed anymore, let GC do its job.
                 }
-                record.setParameters(new String[] {language, getClass().getCanonicalName()});
+                this.values = values;
             }
-            Logging.log(IndexedResourceBundle.class, methodName, record);
-            return values;
-        } catch (IOException exception) {
-            record.setLevel  (Level.WARNING);
-            record.setMessage(exception.getMessage()); // For administrator, use system locale.
-            record.setThrown (exception);
-            Logging.log(IndexedResourceBundle.class, methodName, record);
-            final MissingResourceException error = new MissingResourceException(
-                    Exceptions.getLocalizedMessage(exception, getLocale()), // For users, use requested locale.
-                    getClass().getCanonicalName(), key);
-            error.initCause(exception);
-            throw error;
         }
+        return values;
     }
 
     /**
@@ -404,11 +373,11 @@ public class IndexedResourceBundle exten
             if (element instanceof CharSequence) {
                 CharSequence text = (CharSequence) element;
                 if (text instanceof InternationalString) {
-                    text = ((InternationalString) element).toString(getFormatLocale());
+                    text = ((InternationalString) element).toString(getLocale());
                 }
                 replacement = CharSequences.shortSentence(text, MAX_STRING_LENGTH);
             } else if (element instanceof Throwable) {
-                String message = Exceptions.getLocalizedMessage((Throwable) element, getFormatLocale());
+                String message = Exceptions.getLocalizedMessage((Throwable) element, getLocale());
                 if (message == null) {
                     message = Classes.getShortClassName(element);
                 }
@@ -496,7 +465,7 @@ public class IndexedResourceBundle exten
                 /*
                  * Constructs a new MessageFormat for formatting the arguments.
                  */
-                format = new MessageFormat(pattern, getFormatLocale());
+                format = new MessageFormat(pattern, getLocale());
                 lastKey = key;
             } else if (key != lastKey) {
                 /*

Modified: sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/util/resources/Loader.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/util/resources/Loader.java?rev=1445244&r1=1445243&r2=1445244&view=diff
==============================================================================
--- sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/util/resources/Loader.java (original)
+++ sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/util/resources/Loader.java Tue Feb 12 16:32:28 2013
@@ -16,6 +16,7 @@
  */
 package org.apache.sis.util.resources;
 
+import java.net.URL;
 import java.util.List;
 import java.util.Locale;
 import java.util.Collections;
@@ -105,25 +106,16 @@ final class Loader extends ResourceBundl
          * bundle only if the file is found.
          */
         final String classname = classe.getSimpleName();
-        String filename = toResourceName(toBundleName(classname, locale), EXTENSION);
-        if (classe.getResource(filename) == null) {
-            if (!Locale.ENGLISH.equals(locale)) {
-                return null;
-            }
-            // We have no explicit resources for English. We use the default one for that.
-            filename = toResourceName(classname, EXTENSION);
-            if (classe.getResource(filename) == null) {
-                return null;
-            }
-        }
+        final URL resources = classe.getResource(toResourceName(toBundleName(classname, locale), EXTENSION));
         /*
-         * If the file exists, instantiate now the resource bundle. Note that the constructor
-         * will not loads the data immediately, which is why we don't pass it the above URL.
+         * Instantiate now the resource bundle. The resources URL may be null, in which case the
+         * bundle will inherit the strings from the parent bundle. In every cases, the strings
+         * will be loaded only when first needed.
          *
          * Note: Do not call Constructor.setAccessible(true) - this is not allowed in Applet.
          */
         try {
-            return (ResourceBundle) classe.getDeclaredConstructor(String.class).newInstance(filename);
+            return (ResourceBundle) classe.getDeclaredConstructor(URL.class).newInstance(resources);
         } catch (Exception e) { // The JDK7 branch uses multi-catches here.
             InstantiationException exception = new InstantiationException(Exceptions.getLocalizedMessage(e, locale));
             exception.initCause(e);

Modified: sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/util/resources/Messages.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/util/resources/Messages.java?rev=1445244&r1=1445243&r2=1445244&view=diff
==============================================================================
--- sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/util/resources/Messages.java (original)
+++ sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/util/resources/Messages.java Tue Feb 12 16:32:28 2013
@@ -16,6 +16,7 @@
  */
 package org.apache.sis.util.resources;
 
+import java.net.URL;
 import java.util.Locale;
 import java.util.MissingResourceException;
 import org.opengis.util.InternationalString;
@@ -67,10 +68,11 @@ public final class Messages extends Inde
     /**
      * Constructs a new resource bundle loading data from the given UTF file.
      *
-     * @param filename The file or the JAR entry containing resources.
+     * @param resources The path of the binary file containing resources, or {@code null} if
+     *        there is no resources. The resources may be a file or an entry in a JAR file.
      */
-    Messages(final String filename) {
-        super(filename);
+    Messages(final URL resources) {
+        super(resources);
     }
 
     /**

Modified: sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/util/resources/ResourceInternationalString.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/util/resources/ResourceInternationalString.java?rev=1445244&r1=1445243&r2=1445244&view=diff
==============================================================================
--- sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/util/resources/ResourceInternationalString.java (original)
+++ sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/util/resources/ResourceInternationalString.java Tue Feb 12 16:32:28 2013
@@ -106,23 +106,15 @@ abstract class ResourceInternationalStri
     /**
      * Returns a string in the specified locale.
      *
-     * @param  locale The locale to look for, or {@code null} for an unlocalized version.
-     * @return The string in the specified locale, or in a default locale.
+     * @param  locale The desired locale for the string to be returned.
+     * @return The string in the specified locale, or in a fallback locale.
      * @throws MissingResourceException is the key given to the constructor is invalid.
      */
     @Override
-    public String toString(Locale locale) throws MissingResourceException {
-        if (locale == null) {
-            // The English locale (NOT the system default) is often used
-            // as the real identifier in OGC IdentifiedObject naming. If
-            // a user wants a string in the system default locale, he
-            // should invokes the 'toString()' method instead.
-            locale = Locale.ENGLISH;
-        }
+    public String toString(final Locale locale) throws MissingResourceException {
         final IndexedResourceBundle resources = getBundle(locale);
-        return (key < 0)
-                ? resources.getString(~key)
-                : resources.getString(key, arguments);
+        return (key < 0) ? resources.getString(~key)
+                         : resources.getString(key, arguments);
     }
 
     /**

Modified: sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary.java?rev=1445244&r1=1445243&r2=1445244&view=diff
==============================================================================
--- sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary.java (original)
+++ sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary.java Tue Feb 12 16:32:28 2013
@@ -16,6 +16,7 @@
  */
 package org.apache.sis.util.resources;
 
+import java.net.URL;
 import java.util.Locale;
 import java.util.MissingResourceException;
 import org.opengis.util.InternationalString;
@@ -247,10 +248,11 @@ public final class Vocabulary extends In
     /**
      * Constructs a new resource bundle loading data from the given UTF file.
      *
-     * @param filename The file or the JAR entry containing resources.
+     * @param resources The path of the binary file containing resources, or {@code null} if
+     *        there is no resources. The resources may be a file or an entry in a JAR file.
      */
-    Vocabulary(final String filename) {
-        super(filename);
+    Vocabulary(final URL resources) {
+        super(resources);
     }
 
     /**

Modified: sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/xml/MarshalContext.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/xml/MarshalContext.java?rev=1445244&r1=1445243&r2=1445244&view=diff
==============================================================================
--- sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/xml/MarshalContext.java (original)
+++ sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/xml/MarshalContext.java Tue Feb 12 16:32:28 2013
@@ -60,35 +60,34 @@ public abstract class MarshalContext {
      * Returns the locale to use for (un)marshalling, or {@code null} if no locale were explicitly
      * specified. The locale returned by this method can be used for choosing a language in an
      * {@link org.opengis.util.InternationalString}.
-     * This locale may vary in different fragments of the same XML document.
+     *
+     * <p>This locale may vary in different fragments of the same XML document.
      * In particular children of {@link org.opengis.metadata.Metadata} inherit the locale
-     * specified by the {@link org.opengis.metadata.Metadata#getLanguage()} attribute.
+     * specified by the {@link org.opengis.metadata.Metadata#getLanguage()} attribute.</p>
+     *
+     * {@section Handling of <code>Locale.ROOT</code>}
+     * {@link Locale#ROOT} is interpreted as a request for locale-neutral strings.
+     * The meaning of "locale-neutral" is implementation specific - this is usually
+     * very close to the English locale, but not necessarily. For examples dates are
+     * formatted according ISO standard instead than the rules of the English locale.
      *
-     * {@section Null locale}
-     * Null locales are typically interpreted as a request for locale-independent strings in SIS.
-     * The meaning of "locale-independent" is implementation specific -
-     * this is usually very close to the English locale, but not necessarily
-     * (e.g. dates formatted according ISO standard instead then English locale).
-     * If the locale is {@code null}, then callers shall select a default locale as documented
-     * in the {@link org.apache.sis.util.iso.DefaultInternationalString#toString(Locale)} javadoc.
-     * As a matter of rule:
-     *
-     * <ul>
-     *   <li>If the locale is given to an {@code InternationalString.toString(Locale)} method,
-     *       keep the {@code null} value since the international string is already expected to
-     *       returns a "unlocalized" string in such case.</li>
-     *   <li>Otherwise, if a {@code Locale} instance is really needed, use {@link Locale#US}
-     *       as an approximation of "unlocalized" string.</li>
-     * </ul>
+     * {@section Handling of <code>null</code> locale}
+     * A {@code null} value means that the locale is unspecified. Callers are encouraged
+     * to use the root locale as the default value, but some flexibility is allowed.
      *
      * @return The locale for the XML fragment being (un)marshalled, or {@code null} is unspecified.
+     *
+     * @see org.apache.sis.util.iso.DefaultInternationalString#toString(Locale)
      */
     public abstract Locale getLocale();
 
     /**
      * Returns the timezone to use for (un)marshalling, or {@code null} if none were explicitely
-     * specified. If {@code null}, then an implementation-default (typically UTC) timezone is
-     * assumed.
+     * specified.
+     *
+     * {@section Handling of <code>null</code> timezone}
+     * A {@code null} value means that the timezone is unspecified. Callers are encouraged
+     * to use the UTC timezone as the default value, but some flexibility is allowed.
      *
      * @return The timezone for the XML fragment being (un)marshalled, or {@code null} if unspecified.
      */

Modified: sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/xml/Namespaces.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/xml/Namespaces.java?rev=1445244&r1=1445243&r2=1445244&view=diff
==============================================================================
--- sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/xml/Namespaces.java (original)
+++ sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/xml/Namespaces.java Tue Feb 12 16:32:28 2013
@@ -184,7 +184,7 @@ public final class Namespaces extends St
         if (prefix != null) {
             return prefix;
         }
-        namespace = namespace.toLowerCase(Locale.US);
+        namespace = namespace.toLowerCase(Locale.ROOT);
         for (final String baseURL : GENERIC_URLS) {
             if (namespace.startsWith(baseURL)) {
                 final int startAt = baseURL.length();

Modified: sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/xml/NilObject.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/xml/NilObject.java?rev=1445244&r1=1445243&r2=1445244&view=diff
==============================================================================
--- sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/xml/NilObject.java (original)
+++ sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/xml/NilObject.java Tue Feb 12 16:32:28 2013
@@ -74,7 +74,6 @@ package org.apache.sis.xml;
  * @module
  *
  * @see NilReason#createNilObject(Class)
- * @see ReferenceResolver#resolve(MarshalContext, Class, NilReason)
  * @see org.apache.sis.util.Numbers#valueOfNil(Class)
  */
 public interface NilObject {

Modified: sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/xml/ValueConverter.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/xml/ValueConverter.java?rev=1445244&r1=1445243&r2=1445244&view=diff
==============================================================================
--- sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/xml/ValueConverter.java (original)
+++ sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/xml/ValueConverter.java Tue Feb 12 16:32:28 2013
@@ -97,7 +97,7 @@ public class ValueConverter {
      * @param  value The value that can't be converted.
      * @param  sourceType The base type of the value to convert. This is determined by the argument
      *         type of the method that caught the exception. For example the source type is always
-     *         {@code URI.class} if the exception has been caught by the {@link #toURL(URI)} method.
+     *         {@code URI.class} if the exception has been caught by the {@link #toURL(MarshalContext, URI)} method.
      * @param  targetType The expected type of the converted object.
      * @param  exception The exception that occurred during the conversion attempt.
      * @return {@code true} if the (un)marshalling process should continue despite this error,

Modified: sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/xml/XLink.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/xml/XLink.java?rev=1445244&r1=1445243&r2=1445244&view=diff
==============================================================================
--- sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/xml/XLink.java (original)
+++ sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/xml/XLink.java Tue Feb 12 16:32:28 2013
@@ -301,7 +301,7 @@ public class XLink implements Serializab
          * Returns the attribute name for this type.
          */
         final String identifier() {
-            return name().toLowerCase(Locale.US);
+            return name().toLowerCase(Locale.ROOT);
         }
     }
 

Copied: sis/branches/JDK6/sis-utility/src/test/java/org/apache/sis/measure/DateRangeTest.java (from r1445223, sis/branches/JDK7/sis-utility/src/test/java/org/apache/sis/measure/DateRangeTest.java)
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/sis-utility/src/test/java/org/apache/sis/measure/DateRangeTest.java?p2=sis/branches/JDK6/sis-utility/src/test/java/org/apache/sis/measure/DateRangeTest.java&p1=sis/branches/JDK7/sis-utility/src/test/java/org/apache/sis/measure/DateRangeTest.java&r1=1445223&r2=1445244&rev=1445244&view=diff
==============================================================================
--- sis/branches/JDK7/sis-utility/src/test/java/org/apache/sis/measure/DateRangeTest.java (original)
+++ sis/branches/JDK6/sis-utility/src/test/java/org/apache/sis/measure/DateRangeTest.java Tue Feb 12 16:32:28 2013
@@ -60,7 +60,7 @@ public final strictfp class DateRangeTes
         /*
          * Same test than above, but with a cast from Range to DateRange.
          */
-        final Range<Date> outerAsRange = new Range<>(Date.class, min, max);
+        final Range<Date> outerAsRange = new Range<Date>(Date.class, min, max);
         assertSame(outerAsRange, outerAsRange.union(inner));
         assertEquals(outer, inner.union(outerAsRange));
     }
@@ -90,7 +90,7 @@ public final strictfp class DateRangeTes
         /*
          * Same test than above, but with a cast from Range to DateRange.
          */
-        final Range<Date> innerAsRange = new Range<>(Date.class, in1, in2);
+        final Range<Date> innerAsRange = new Range<Date>(Date.class, in1, in2);
         assertSame(innerAsRange, innerAsRange.intersect(outer));
         assertEquals(inner, outer.intersect(innerAsRange));
     }

Copied: sis/branches/JDK6/sis-utility/src/test/java/org/apache/sis/measure/RangeFormatTest.java (from r1445223, sis/branches/JDK7/sis-utility/src/test/java/org/apache/sis/measure/RangeFormatTest.java)
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/sis-utility/src/test/java/org/apache/sis/measure/RangeFormatTest.java?p2=sis/branches/JDK6/sis-utility/src/test/java/org/apache/sis/measure/RangeFormatTest.java&p1=sis/branches/JDK7/sis-utility/src/test/java/org/apache/sis/measure/RangeFormatTest.java&r1=1445223&r2=1445244&rev=1445244&view=diff
==============================================================================
--- sis/branches/JDK7/sis-utility/src/test/java/org/apache/sis/measure/RangeFormatTest.java (original)
+++ sis/branches/JDK6/sis-utility/src/test/java/org/apache/sis/measure/RangeFormatTest.java Tue Feb 12 16:32:28 2013
@@ -166,14 +166,14 @@ public final strictfp class RangeFormatT
         assertEquals("maxPos.endIndex",   7, maxPos.getEndIndex());
 
         // Positive infinity with integers
-        assertEquals("[50 … ∞)", format(new NumberRange<>(Integer.class, 50, null)));
+        assertEquals("[50 … ∞)", format(new NumberRange<Integer>(Integer.class, 50, null)));
         assertEquals("minPos.beginIndex", 1, minPos.getBeginIndex());
         assertEquals("minPos.endIndex",   3, minPos.getEndIndex());
         assertEquals("maxPos.beginIndex", 6, maxPos.getBeginIndex());
         assertEquals("maxPos.endIndex",   7, maxPos.getEndIndex());
 
         // Negative infinity with integers
-        assertEquals("(-∞ … 40]", format(new NumberRange<>(Integer.class, null, 40)));
+        assertEquals("(-∞ … 40]", format(new NumberRange<Integer>(Integer.class, null, 40)));
         assertEquals("minPos.beginIndex", 1, minPos.getBeginIndex());
         assertEquals("minPos.endIndex",   3, minPos.getEndIndex());
         assertEquals("maxPos.beginIndex", 6, maxPos.getBeginIndex());

Copied: sis/branches/JDK6/sis-utility/src/test/java/org/apache/sis/measure/RangeTest.java (from r1445223, sis/branches/JDK7/sis-utility/src/test/java/org/apache/sis/measure/RangeTest.java)
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/sis-utility/src/test/java/org/apache/sis/measure/RangeTest.java?p2=sis/branches/JDK6/sis-utility/src/test/java/org/apache/sis/measure/RangeTest.java&p1=sis/branches/JDK7/sis-utility/src/test/java/org/apache/sis/measure/RangeTest.java&r1=1445223&r2=1445244&rev=1445244&view=diff
==============================================================================
--- sis/branches/JDK7/sis-utility/src/test/java/org/apache/sis/measure/RangeTest.java (original)
+++ sis/branches/JDK6/sis-utility/src/test/java/org/apache/sis/measure/RangeTest.java Tue Feb 12 16:32:28 2013
@@ -36,35 +36,35 @@ public final strictfp class RangeTest ex
      */
     @Test
     public void testConstructor() {
-        Range<Integer> range = new Range<>(Integer.class, 3, 5);
+        Range<Integer> range = new Range<Integer>(Integer.class, 3, 5);
         assertEquals(Integer.valueOf(3), range.getMinValue());
         assertEquals(Integer.valueOf(5), range.getMaxValue());
         assertTrue  (range.isMaxIncluded());
         assertTrue  (range.isMinIncluded());
         assertFalse (range.isEmpty());
 
-        range = new Range<>(Integer.class, 3, false, 5, true);
+        range = new Range<Integer>(Integer.class, 3, false, 5, true);
         assertEquals(Integer.valueOf(3), range.getMinValue());
         assertEquals(Integer.valueOf(5), range.getMaxValue());
         assertTrue  (range.isMaxIncluded());
         assertFalse (range.isMinIncluded());
         assertFalse (range.isEmpty());
 
-        range = new Range<>(Integer.class, 2, true, 7, false);
+        range = new Range<Integer>(Integer.class, 2, true, 7, false);
         assertEquals(Integer.valueOf(2), range.getMinValue());
         assertEquals(Integer.valueOf(7), range.getMaxValue());
         assertFalse (range.isMaxIncluded());
         assertTrue  (range.isMinIncluded());
         assertFalse (range.isEmpty());
 
-        range = new Range<>(Integer.class, 3, false, 10, false);
+        range = new Range<Integer>(Integer.class, 3, false, 10, false);
         assertEquals(Integer.valueOf( 3), range.getMinValue());
         assertEquals(Integer.valueOf(10), range.getMaxValue());
         assertFalse (range.isMaxIncluded());
         assertFalse (range.isMinIncluded());
         assertFalse (range.isEmpty());
 
-        range = new Range<>(Integer.class, 10, 2);
+        range = new Range<Integer>(Integer.class, 10, 2);
         assertEquals(Integer.valueOf(10), range.getMinValue());
         assertEquals(Integer.valueOf( 2), range.getMaxValue());
         assertTrue (range.isEmpty());
@@ -99,7 +99,7 @@ public final strictfp class RangeTest ex
      */
     @Test
     public void testContains() {
-        final Range<Integer> range = new Range<>(Integer.class, 3, 5);
+        final Range<Integer> range = new Range<Integer>(Integer.class, 3, 5);
         assertTrue (range.contains(4));
         assertFalse(range.contains(6));
         assertFalse(range.contains(2));
@@ -112,7 +112,7 @@ public final strictfp class RangeTest ex
      */
     @Test
     public void testContainsNotInclusiveMinimum() {
-        final Range<Integer> range = new Range<>(Integer.class, 2, false, 5, true);
+        final Range<Integer> range = new Range<Integer>(Integer.class, 2, false, 5, true);
         assertTrue (range.contains(4));
         assertFalse(range.contains(6));
         assertFalse(range.contains(2));
@@ -126,7 +126,7 @@ public final strictfp class RangeTest ex
      */
     @Test
     public void testContainsNotInclusiveMaximum() {
-        final Range<Integer> range = new Range<>(Integer.class, 3, true, 6, false);
+        final Range<Integer> range = new Range<Integer>(Integer.class, 3, true, 6, false);
         assertTrue (range.contains(4));
         assertFalse(range.contains(6));
         assertFalse(range.contains(2));
@@ -139,7 +139,7 @@ public final strictfp class RangeTest ex
      */
     @Test
     public void testContainsNoLowerBound() {
-        final Range<Integer> range = new Range<>(Integer.class, null, 5);
+        final Range<Integer> range = new Range<Integer>(Integer.class, null, 5);
         assertTrue (range.contains(-555));
         assertTrue (range.contains(5));
         assertFalse(range.contains(6));
@@ -150,7 +150,7 @@ public final strictfp class RangeTest ex
      */
     @Test
     public void testContainsNoUpperBound() {
-        final Range<Integer> range = new Range<>(Integer.class, 3, null);
+        final Range<Integer> range = new Range<Integer>(Integer.class, 3, null);
         assertFalse(range.contains(1));
         assertTrue (range.contains(3));
         assertTrue (range.contains(10000));
@@ -161,7 +161,7 @@ public final strictfp class RangeTest ex
      */
     @Test
     public void testContainsNoBounds() {
-        final Range<Integer> range = new Range<>(Integer.class, null, null);
+        final Range<Integer> range = new Range<Integer>(Integer.class, null, null);
         assertTrue(range.contains(-55555));
         assertTrue(range.contains(100000));
     }
@@ -171,8 +171,8 @@ public final strictfp class RangeTest ex
      */
     @Test
     public void testContainsRange() {
-        final Range<Integer> range  = new Range<>(Integer.class, -10, 10);
-        final Range<Integer> inside = new Range<>(Integer.class,  -5,  5);
+        final Range<Integer> range  = new Range<Integer>(Integer.class, -10, 10);
+        final Range<Integer> inside = new Range<Integer>(Integer.class,  -5,  5);
 
         assertTrue(range.contains(inside));
         assertFalse(inside.contains(range));
@@ -183,8 +183,8 @@ public final strictfp class RangeTest ex
      */
     @Test
     public void testContainsRangeNoLowerBound() {
-        final Range<Integer> range  = new Range<>(Integer.class,  null, 500);
-        final Range<Integer> inside = new Range<>(Integer.class, -2500, 305);
+        final Range<Integer> range  = new Range<Integer>(Integer.class,  null, 500);
+        final Range<Integer> inside = new Range<Integer>(Integer.class, -2500, 305);
 
         assertTrue (range.contains(inside));
         assertFalse(inside.contains(range));
@@ -195,8 +195,8 @@ public final strictfp class RangeTest ex
      */
     @Test
     public void testContainsRangeNoUpperBound() {
-        final Range<Integer> range  = new Range<>(Integer.class, -2500, null);
-        final Range<Integer> inside = new Range<>(Integer.class,    17,  305);
+        final Range<Integer> range  = new Range<Integer>(Integer.class, -2500, null);
+        final Range<Integer> inside = new Range<Integer>(Integer.class,    17,  305);
 
         assertTrue(range.contains(inside));
         assertFalse(inside.contains(range));
@@ -207,8 +207,8 @@ public final strictfp class RangeTest ex
      */
     @Test(expected = IllegalArgumentException.class)
     public void testIncompatibleTypeRangeContains() {
-        final Range<Integer> intRange = new Range<>(Integer.class, 0, 10);
-        final Range<Double> doubleRange = new Range<>(Double.class, 2.0, 5.0);
+        final Range<Integer> intRange = new Range<Integer>(Integer.class, 0, 10);
+        final Range<Double> doubleRange = new Range<Double>(Double.class, 2.0, 5.0);
 
         intRange.contains(doubleRange);
     }
@@ -218,8 +218,8 @@ public final strictfp class RangeTest ex
      */
     @Test(expected = IllegalArgumentException.class)
     public void testIncompatibleTypeContains() {
-        final Range<Integer> intRange = new Range<>(Integer.class, 0, 10);
-        final Range<Double> doubleRange = new Range<>(Double.class, 2.0, 5.0);
+        final Range<Integer> intRange = new Range<Integer>(Integer.class, 0, 10);
+        final Range<Double> doubleRange = new Range<Double>(Double.class, 2.0, 5.0);
 
         intRange.contains(doubleRange);
     }
@@ -229,9 +229,9 @@ public final strictfp class RangeTest ex
      */
     @Test
     public void testIntersects() {
-        final Range<Character> range1 = new Range<>(Character.class, 'a', 'g');
-        final Range<Character> range2 = new Range<>(Character.class, 'c', 'm');
-        final Range<Character> range3 = new Range<>(Character.class, 'o', 'z');
+        final Range<Character> range1 = new Range<Character>(Character.class, 'a', 'g');
+        final Range<Character> range2 = new Range<Character>(Character.class, 'c', 'm');
+        final Range<Character> range3 = new Range<Character>(Character.class, 'o', 'z');
 
         assertTrue (range1.intersects(range2));
         assertTrue (range2.intersects(range1));
@@ -244,8 +244,8 @@ public final strictfp class RangeTest ex
      */
     @Test(expected = IllegalArgumentException.class)
     public void testIntersectsIncompatibleTypes() {
-        final Range<Character> range1 = new Range<>(Character.class, 'a', 'g');
-        final Range<Integer>   range2 = new Range<>(Integer.class, 5, 7);
+        final Range<Character> range1 = new Range<Character>(Character.class, 'a', 'g');
+        final Range<Integer>   range2 = new Range<Integer>(Integer.class, 5, 7);
 
         range1.intersects(range2);
     }
@@ -255,8 +255,8 @@ public final strictfp class RangeTest ex
      */
     @Test
     public void testIntersection() {
-        final Range<Integer> range1 = new Range<>(Integer.class, 1, 5);
-        final Range<Integer> range2 = new Range<>(Integer.class, 4, 6);
+        final Range<Integer> range1 = new Range<Integer>(Integer.class, 1, 5);
+        final Range<Integer> range2 = new Range<Integer>(Integer.class, 4, 6);
 
         final Range<?> intersection = range1.intersect(range2);
         assertEquals(Integer.class, intersection.getElementType());
@@ -269,8 +269,8 @@ public final strictfp class RangeTest ex
      */
     @Test
     public void testIntersectionOfNonIntersectingRanges() {
-        final Range<Integer> range1 = new Range<>(Integer.class, 1,  5);
-        final Range<Integer> range2 = new Range<>(Integer.class, 8, 10);
+        final Range<Integer> range1 = new Range<Integer>(Integer.class, 1,  5);
+        final Range<Integer> range2 = new Range<Integer>(Integer.class, 8, 10);
 
         final Range<?> intersection = range1.intersect(range2);
         assertEquals(Integer.class, intersection.getElementType());
@@ -282,8 +282,8 @@ public final strictfp class RangeTest ex
      */
     @Test
     public void testUnion() {
-        final Range<Character> range1 = new Range<>(Character.class, 'a', 'f');
-        final Range<Character> range2 = new Range<>(Character.class, 'd', 'h');
+        final Range<Character> range1 = new Range<Character>(Character.class, 'a', 'f');
+        final Range<Character> range2 = new Range<Character>(Character.class, 'd', 'h');
 
         final Range<?> union = range1.union(range2);
         assertFalse(union.isEmpty());
@@ -296,8 +296,8 @@ public final strictfp class RangeTest ex
      */
     @Test
     public void testDisjointUnion() {
-        final Range<Character> range1 = new Range<>(Character.class, 'a', 'f');
-        final Range<Character> range2 = new Range<>(Character.class, 'm', 'v');
+        final Range<Character> range1 = new Range<Character>(Character.class, 'a', 'f');
+        final Range<Character> range2 = new Range<Character>(Character.class, 'm', 'v');
 
         final Range<?> unionRange = range1.union(range2);
         assertFalse(unionRange.isEmpty());
@@ -311,20 +311,20 @@ public final strictfp class RangeTest ex
     @Test
     public void testEquality() {
         // Positive test - success case
-        final Range<Character> range1 = new Range<>(Character.class, 'a', 'f');
-        final Range<Character> range2 = new Range<>(Character.class, 'a', 'f');
+        final Range<Character> range1 = new Range<Character>(Character.class, 'a', 'f');
+        final Range<Character> range2 = new Range<Character>(Character.class, 'a', 'f');
         assertTrue(range1.equals(range2));
 
         // Positive test - failure case
-        final Range<Character> range3 = new Range<>(Character.class, 'a', 'g');
+        final Range<Character> range3 = new Range<Character>(Character.class, 'a', 'g');
         assertFalse(range1.equals(range3));
 
         // Failure due to type incompatibility
-        final Range<String> range4 = new Range<>(String.class, "a", "g");
+        final Range<String> range4 = new Range<String>(String.class, "a", "g");
         assertFalse(range3.equals(range4));
 
-        final Range<Character> range5 = new Range<>(Character.class, 'g', 'a');
-        final Range<Character> range6 = new Range<>(Character.class, 'g', 'a');
+        final Range<Character> range5 = new Range<Character>(Character.class, 'g', 'a');
+        final Range<Character> range6 = new Range<Character>(Character.class, 'g', 'a');
         assertTrue(range5.isEmpty());
         assertTrue(range6.isEmpty());
         assertTrue(range5.equals(range6));
@@ -335,7 +335,7 @@ public final strictfp class RangeTest ex
      */
     @Test
     public void testSerialization() {
-        final Range<Integer> range  = new Range<>(Integer.class, -10, 10);
+        final Range<Integer> range  = new Range<Integer>(Integer.class, -10, 10);
         assertNotSame(range, assertSerializedEquals(range));
     }
 }

Modified: sis/branches/JDK6/sis-utility/src/test/java/org/apache/sis/test/suite/UtilityTestSuite.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/sis-utility/src/test/java/org/apache/sis/test/suite/UtilityTestSuite.java?rev=1445244&r1=1445243&r2=1445244&view=diff
==============================================================================
--- sis/branches/JDK6/sis-utility/src/test/java/org/apache/sis/test/suite/UtilityTestSuite.java (original)
+++ sis/branches/JDK6/sis-utility/src/test/java/org/apache/sis/test/suite/UtilityTestSuite.java Tue Feb 12 16:32:28 2013
@@ -39,9 +39,11 @@ import org.junit.runners.Suite;
     org.apache.sis.util.CharSequencesTest.class,
     org.apache.sis.util.StringBuildersTest.class,
     org.apache.sis.util.UtilitiesTest.class,
+    org.apache.sis.util.NumbersTest.class,
     org.apache.sis.util.ClassesTest.class,
     org.apache.sis.util.VersionTest.class,
     org.apache.sis.util.LocalesTest.class,
+    org.apache.sis.util.resources.LoaderTest.class,
     org.apache.sis.util.resources.IndexedResourceBundleTest.class,
     org.apache.sis.util.logging.PerformanceLevelTest.class,
     org.apache.sis.math.MathFunctionsTest.class,
@@ -69,7 +71,12 @@ import org.junit.runners.Suite;
 
     // Measurements and formatting.
     org.apache.sis.measure.UnitsTest.class,
+    org.apache.sis.measure.RangeTest.class,
+    org.apache.sis.measure.DateRangeTest.class,
+    org.apache.sis.measure.NumberRangeTest.class,
+    org.apache.sis.measure.MeasurementRangeTest.class,
     org.apache.sis.measure.FormattedCharacterIteratorTest.class,
+    org.apache.sis.measure.RangeFormatTest.class,
     org.apache.sis.measure.AngleFormatTest.class,
     org.apache.sis.measure.AngleTest.class,
     org.apache.sis.internal.util.X364Test.class,

Modified: sis/branches/JDK6/sis-utility/src/test/java/org/apache/sis/util/CharSequencesTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/sis-utility/src/test/java/org/apache/sis/util/CharSequencesTest.java?rev=1445244&r1=1445243&r2=1445244&view=diff
==============================================================================
--- sis/branches/JDK6/sis-utility/src/test/java/org/apache/sis/util/CharSequencesTest.java (original)
+++ sis/branches/JDK6/sis-utility/src/test/java/org/apache/sis/util/CharSequencesTest.java Tue Feb 12 16:32:28 2013
@@ -76,8 +76,8 @@ public final strictfp class CharSequence
     }
 
     /**
-     * Tests the {@link CharSequences#indexOf(CharSequence, CharSequence, int)} method.
-     * We test four time with different kind of character sequences.
+     * Tests the {@link CharSequences#indexOf(CharSequence, CharSequence, int, int)} method.
+     * We test four times with different kind of character sequences.
      */
     @Test
     public void testIndexOf() {
@@ -100,9 +100,9 @@ public final strictfp class CharSequence
     }
 
     /**
-     * Tests the {@link CharSequences#indexOf(CharSequence, int, int)} and
-     * {@link CharSequences#lastIndexOf(CharSequence, int, int)} methods.
-     * We test two time with different kind of character sequences, in order
+     * Tests the {@link CharSequences#indexOf(CharSequence, int, int, int)} and
+     * {@link CharSequences#lastIndexOf(CharSequence, int, int, int)} methods.
+     * We test two times with different kind of character sequences, in order
      * to test the {@link String} optimization case.
      */
     @Test
@@ -359,7 +359,7 @@ public final strictfp class CharSequence
     }
 
     /**
-     * Tests the {@link CharSequences#isUpperCase(CharSequence)} method.
+     * Tests the {@link CharSequences#isUpperCase(CharSequence, int, int)} method.
      */
     @Test
     public void testIsUpperCase() {

Modified: sis/branches/JDK6/sis-utility/src/test/java/org/apache/sis/util/CharactersTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/sis-utility/src/test/java/org/apache/sis/util/CharactersTest.java?rev=1445244&r1=1445243&r2=1445244&view=diff
==============================================================================
--- sis/branches/JDK6/sis-utility/src/test/java/org/apache/sis/util/CharactersTest.java (original)
+++ sis/branches/JDK6/sis-utility/src/test/java/org/apache/sis/util/CharactersTest.java Tue Feb 12 16:32:28 2013
@@ -94,7 +94,7 @@ public final strictfp class CharactersTe
     }
 
     /**
-     * Tests the pre-defined {@link Characters.Filter} constants.
+     * Tests the pre-defined {@link org.apache.sis.util.Characters.Filter} constants.
      */
     @Test
     public void testPredefinedFilters() {
@@ -107,7 +107,7 @@ public final strictfp class CharactersTe
     }
 
     /**
-     * Tests the {@link Characters.Filter#forTypes(byte[])} method.
+     * Tests the {@link org.apache.sis.util.Characters.Filter#forTypes(byte[])} method.
      */
     @Test
     public void testFilterForTypes() {
@@ -118,7 +118,8 @@ public final strictfp class CharactersTe
     }
 
     /**
-     * Scans the full {@code char} range in order to check for {@link Character.Filter} consistency.
+     * Scans the full {@code char} range in order to check for
+     * {@link org.apache.sis.util.Characters.Filter} consistency.
      */
     @Test
     public void scanCharacterRange() {

Modified: sis/branches/JDK6/sis-utility/src/test/java/org/apache/sis/util/ClassesTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/sis-utility/src/test/java/org/apache/sis/util/ClassesTest.java?rev=1445244&r1=1445243&r2=1445244&view=diff
==============================================================================
--- sis/branches/JDK6/sis-utility/src/test/java/org/apache/sis/util/ClassesTest.java (original)
+++ sis/branches/JDK6/sis-utility/src/test/java/org/apache/sis/util/ClassesTest.java Tue Feb 12 16:32:28 2013
@@ -16,6 +16,7 @@
  */
 package org.apache.sis.util;
 
+import java.lang.reflect.Field;
 import org.junit.Test;
 import org.apache.sis.test.TestCase;
 
@@ -184,7 +185,7 @@ public final strictfp class ClassesTest 
     }
 
     /**
-     * Tests the {@link #boundOfParameterizedAttribute} method.
+     * Tests the {@link Classes#boundOfParameterizedAttribute(Field)} method.
      *
      * @throws NoSuchFieldException  Should never occur.
      * @throws NoSuchMethodException Should never occur.

Modified: sis/branches/JDK6/sis-utility/src/test/java/org/apache/sis/util/collection/DerivedMapTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/sis-utility/src/test/java/org/apache/sis/util/collection/DerivedMapTest.java?rev=1445244&r1=1445243&r2=1445244&view=diff
==============================================================================
--- sis/branches/JDK6/sis-utility/src/test/java/org/apache/sis/util/collection/DerivedMapTest.java (original)
+++ sis/branches/JDK6/sis-utility/src/test/java/org/apache/sis/util/collection/DerivedMapTest.java Tue Feb 12 16:32:28 2013
@@ -45,7 +45,7 @@ public final strictfp class DerivedMapTe
     /**
      * The value to replace by {@code null}.
      */
-    private static final int EXCLUDED = 17;
+    protected static final int EXCLUDED = 17; // non-private for javadoc purpose.
 
     /**
      * Fills test values in the given maps.
@@ -117,7 +117,7 @@ public final strictfp class DerivedMapTe
     @Override public Class<Integer> getTargetClass() {return Integer.class;}
 
     /**
-     * Multiply the given value by 10, except value {@value #EXCLUDED}.
+     * Multiplies the given value by 10, except value {@value #EXCLUDED}.
      *
      * @param  value The value to multiply.
      * @return The multiplied value, or {@code null}.

Modified: sis/branches/JDK6/sis-utility/src/test/java/org/apache/sis/util/collection/DerivedSetTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/sis-utility/src/test/java/org/apache/sis/util/collection/DerivedSetTest.java?rev=1445244&r1=1445243&r2=1445244&view=diff
==============================================================================
--- sis/branches/JDK6/sis-utility/src/test/java/org/apache/sis/util/collection/DerivedSetTest.java (original)
+++ sis/branches/JDK6/sis-utility/src/test/java/org/apache/sis/util/collection/DerivedSetTest.java Tue Feb 12 16:32:28 2013
@@ -43,7 +43,7 @@ public final strictfp class DerivedSetTe
     /**
      * The value to replace by {@code null}.
      */
-    private static final int EXCLUDED = 19;
+    protected static final int EXCLUDED = 19; // non-private for javadoc purpose.
 
     /**
      * Tests {@link DerivedSet} without excluded value.

Modified: sis/branches/JDK6/sis-utility/src/test/java/org/apache/sis/util/collection/TableColumnTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/sis-utility/src/test/java/org/apache/sis/util/collection/TableColumnTest.java?rev=1445244&r1=1445243&r2=1445244&view=diff
==============================================================================
--- sis/branches/JDK6/sis-utility/src/test/java/org/apache/sis/util/collection/TableColumnTest.java (original)
+++ sis/branches/JDK6/sis-utility/src/test/java/org/apache/sis/util/collection/TableColumnTest.java Tue Feb 12 16:32:28 2013
@@ -41,11 +41,13 @@ public final strictfp class TableColumnT
     @Test
     public void testConstantHeader() {
         InternationalString i18n = NAME.getHeader();
+        assertEquals("Name", i18n.toString(Locale.ROOT));
         assertEquals("Name", i18n.toString(Locale.ENGLISH));
         assertEquals("Nom",  i18n.toString(Locale.FRENCH));
         assertSame("Test caching", i18n, NAME.getHeader());
 
         i18n = TYPE.getHeader();
+        assertEquals("Type", i18n.toString(Locale.ROOT));
         assertEquals("Type", i18n.toString(Locale.ENGLISH));
         assertEquals("Type", i18n.toString(Locale.FRENCH));
         assertSame("Test caching", i18n, TYPE.getHeader());

Modified: sis/branches/JDK6/sis-utility/src/test/java/org/apache/sis/util/iso/AbstractNameTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/sis-utility/src/test/java/org/apache/sis/util/iso/AbstractNameTest.java?rev=1445244&r1=1445243&r2=1445244&view=diff
==============================================================================
--- sis/branches/JDK6/sis-utility/src/test/java/org/apache/sis/util/iso/AbstractNameTest.java (original)
+++ sis/branches/JDK6/sis-utility/src/test/java/org/apache/sis/util/iso/AbstractNameTest.java Tue Feb 12 16:32:28 2013
@@ -29,7 +29,7 @@ import static org.apache.sis.util.iso.De
 /**
  * Tests the {@link DefaultLocalName} and {@link DefaultScopedName} implementations.
  * This test suite instantiate the objects directly, without using {@link DefaultNameFactory}.
- * For tests using the name factory, see {@link NameFactoryTest}.
+ * For tests using the name factory, see {@link DefaultNameFactoryTest}.
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.3 (derived from goetk-3.00)

Modified: sis/branches/JDK6/sis-utility/src/test/java/org/apache/sis/util/iso/DefaultInternationalStringTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/sis-utility/src/test/java/org/apache/sis/util/iso/DefaultInternationalStringTest.java?rev=1445244&r1=1445243&r2=1445244&view=diff
==============================================================================
--- sis/branches/JDK6/sis-utility/src/test/java/org/apache/sis/util/iso/DefaultInternationalStringTest.java (original)
+++ sis/branches/JDK6/sis-utility/src/test/java/org/apache/sis/util/iso/DefaultInternationalStringTest.java Tue Feb 12 16:32:28 2013
@@ -49,6 +49,7 @@ public final strictfp class DefaultInter
         toTest.add(Locale.ENGLISH, MESSAGE);
         assertSame(MESSAGE, toTest.toString());
         assertSame(MESSAGE, toTest.toString(null));
+        assertSame(MESSAGE, toTest.toString(Locale.ROOT));
         validate(toTest);
     }
 
@@ -85,6 +86,7 @@ public final strictfp class DefaultInter
      */
     private static void assertLocalized(final InternationalString toTest, final String quebecker) {
         assertEquals ("Unlocalized message:", MESSAGE,    toTest.toString(null));
+        assertEquals ("Unlocalized message:", MESSAGE,    toTest.toString(Locale.ROOT));
         assertEquals ("English message:",     MESSAGE_en, toTest.toString(Locale.ENGLISH));
         assertEquals ("French message:",      MESSAGE_fr, toTest.toString(Locale.FRENCH));
         assertEquals ("Quebecker message:",   quebecker,  toTest.toString(Locale.CANADA_FRENCH));
@@ -102,12 +104,14 @@ public final strictfp class DefaultInter
         toTest.add(Locale.FRENCH,        MESSAGE_fr);
         toTest.add(Locale.CANADA_FRENCH, MESSAGE_fr_CA);
 
-        assertEquals("Unlocalized message:", MESSAGE,    String.format((Locale) null,  "%s", toTest));
+        assertEquals("Unlocalized message:", MESSAGE,    String.format(Locale.ROOT,    "%s", toTest));
         assertEquals("English message:",     MESSAGE_en, String.format(Locale.ENGLISH, "%s", toTest));
         assertEquals("French message:",      MESSAGE_fr, String.format(Locale.FRENCH,  "%s", toTest));
 
+        assertEquals("  This", String.format(Locale.ROOT,    "%6.4s",  toTest));
         assertEquals("  This", String.format(Locale.ENGLISH, "%6.4s",  toTest));
         assertEquals(" Voici", String.format(Locale.FRENCH,  "%6.5s",  toTest));
+        assertEquals("THIS  ", String.format(Locale.ROOT,    "%-6.5S", toTest));
         assertEquals("THIS  ", String.format(Locale.ENGLISH, "%-6.5S", toTest));
         assertEquals("VOICI ", String.format(Locale.FRENCH,  "%-6.5S", toTest));
     }

Modified: sis/branches/JDK6/sis-utility/src/test/java/org/apache/sis/util/iso/SimpleInternationalStringTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/sis-utility/src/test/java/org/apache/sis/util/iso/SimpleInternationalStringTest.java?rev=1445244&r1=1445243&r2=1445244&view=diff
==============================================================================
--- sis/branches/JDK6/sis-utility/src/test/java/org/apache/sis/util/iso/SimpleInternationalStringTest.java (original)
+++ sis/branches/JDK6/sis-utility/src/test/java/org/apache/sis/util/iso/SimpleInternationalStringTest.java Tue Feb 12 16:32:28 2013
@@ -16,6 +16,7 @@
  */
 package org.apache.sis.util.iso;
 
+import java.util.Locale;
 import org.apache.sis.test.TestCase;
 import org.junit.Test;
 
@@ -41,6 +42,8 @@ public final strictfp class SimpleIntern
         final SimpleInternationalString toTest = new SimpleInternationalString(MESSAGE);
         assertSame(MESSAGE, toTest.toString());
         assertSame(MESSAGE, toTest.toString(null));
+        assertSame(MESSAGE, toTest.toString(Locale.ROOT));
+        assertSame(MESSAGE, toTest.toString(Locale.JAPANESE));
         validate(toTest);
     }
 
@@ -53,6 +56,8 @@ public final strictfp class SimpleIntern
         final SimpleInternationalString after  = assertSerializedEquals(before);
         assertEquals(MESSAGE, after.toString());
         assertEquals(MESSAGE, after.toString(null));
+        assertEquals(MESSAGE, after.toString(Locale.ROOT));
+        assertEquals(MESSAGE, after.toString(Locale.JAPANESE));
         validate(after);
     }
 }

Modified: sis/branches/JDK6/sis-utility/src/test/java/org/apache/sis/util/iso/TypesTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/sis-utility/src/test/java/org/apache/sis/util/iso/TypesTest.java?rev=1445244&r1=1445243&r2=1445244&view=diff
==============================================================================
--- sis/branches/JDK6/sis-utility/src/test/java/org/apache/sis/util/iso/TypesTest.java (original)
+++ sis/branches/JDK6/sis-utility/src/test/java/org/apache/sis/util/iso/TypesTest.java Tue Feb 12 16:32:28 2013
@@ -81,6 +81,8 @@ public final strictfp class TypesTest ex
     @Test
     public void testGetDescription() {
         assertEquals("Name of the character coding standard used in the resource.",
+                Types.getDescription(CharacterSet.class, Locale.ROOT));
+        assertEquals("Name of the character coding standard used in the resource.",
                 Types.getDescription(CharacterSet.class, Locale.ENGLISH));
         assertEquals("Jeu de caractères.",
                 Types.getDescription(CharacterSet.class, Locale.FRENCH));
@@ -92,6 +94,8 @@ public final strictfp class TypesTest ex
     @Test
     public void testGetCodeDescription() {
         assertEquals("ISO/IEC 8859-1, Information technology - 8-bit single byte coded graphic character sets - Part 1 : Latin alphabet No.1.",
+                Types.getDescription(CharacterSet.ISO_8859_1, Locale.ROOT));
+        assertEquals("ISO/IEC 8859-1, Information technology - 8-bit single byte coded graphic character sets - Part 1 : Latin alphabet No.1.",
                 Types.getDescription(CharacterSet.ISO_8859_1, Locale.ENGLISH));
         assertEquals("ISO/IEC 8859-1, alphabet latin 1.",
                 Types.getDescription(CharacterSet.ISO_8859_1, Locale.FRENCH));
@@ -132,6 +136,7 @@ public final strictfp class TypesTest ex
      */
     @Test
     public void testGetLocalizedCodeTitle() {
+        assertEquals("Download",       Types.getCodeTitle(OnLineFunction.DOWNLOAD, Locale.ROOT));
         assertEquals("Download",       Types.getCodeTitle(OnLineFunction.DOWNLOAD, Locale.ENGLISH));
         assertEquals("Téléchargement", Types.getCodeTitle(OnLineFunction.DOWNLOAD, Locale.FRENCH));
     }

Modified: sis/branches/JDK6/sis-utility/src/test/java/org/apache/sis/util/resources/IndexedResourceBundleTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/sis-utility/src/test/java/org/apache/sis/util/resources/IndexedResourceBundleTest.java?rev=1445244&r1=1445243&r2=1445244&view=diff
==============================================================================
--- sis/branches/JDK6/sis-utility/src/test/java/org/apache/sis/util/resources/IndexedResourceBundleTest.java (original)
+++ sis/branches/JDK6/sis-utility/src/test/java/org/apache/sis/util/resources/IndexedResourceBundleTest.java Tue Feb 12 16:32:28 2013
@@ -40,7 +40,7 @@ import static org.apache.sis.test.Assert
  * @since   0.3 (derived from geotk-2.2)
  * @version 0.3
  */
-@DependsOn(org.apache.sis.util.ArraysExtTest.class)
+@DependsOn(LoaderTest.class)
 public final strictfp class IndexedResourceBundleTest extends TestCase {
     /**
      * The resource bundle in process of being tested. Shall be reset to {@code null} after every
@@ -56,14 +56,18 @@ public final strictfp class IndexedResou
     public void testGetResources() {
         final Errors english = Errors.getResources(Locale.ENGLISH);
         final Errors french  = Errors.getResources(Locale.FRENCH);
+        final Errors canada  = Errors.getResources(Locale.CANADA);
+        final Errors quebec  = Errors.getResources(Locale.CANADA_FRENCH);
+        assertNotSame(english, Errors.getResources(Locale.US));
+        assertNotSame(english, Errors.getResources(Locale.UK));
         assertNotSame(english, french);
+        assertNotSame(english, canada);
+        assertNotSame(french,  quebec);
 
         assertSame(english, Errors.getResources(Locale.ENGLISH));
-        assertSame(english, Errors.getResources(Locale.US));
-        assertSame(english, Errors.getResources(Locale.UK));
-        assertSame(english, Errors.getResources(Locale.CANADA));
+        assertSame(canada,  Errors.getResources(Locale.CANADA));
         assertSame(french,  Errors.getResources(Locale.FRENCH));
-        assertSame(french,  Errors.getResources(Locale.CANADA_FRENCH));
+        assertSame(quebec,  Errors.getResources(Locale.CANADA_FRENCH));
     }
 
     /**
@@ -153,11 +157,13 @@ public final strictfp class IndexedResou
     @DependsOnMethod("testGetResources")
     public void testFormatInternational() {
         InternationalString i18n = Errors.formatInternational(Errors.Keys.NullArgument_1);
+        assertEquals("Argument ‘{0}’ shall not be null.",      i18n.toString(Locale.ROOT));
         assertEquals("Argument ‘{0}’ shall not be null.",      i18n.toString(Locale.ENGLISH));
         assertEquals("L’argument ‘{0}’ ne doit pas être nul.", i18n.toString(Locale.FRENCH));
         assertNotSame(i18n, assertSerializedEquals(i18n));
 
         i18n = Errors.formatInternational(Errors.Keys.NullArgument_1, "CRS");
+        assertEquals("Argument ‘CRS’ shall not be null.",      i18n.toString(Locale.ROOT));
         assertEquals("Argument ‘CRS’ shall not be null.",      i18n.toString(Locale.ENGLISH));
         assertEquals("L’argument ‘CRS’ ne doit pas être nul.", i18n.toString(Locale.FRENCH));
         assertNotSame(i18n, assertSerializedEquals(i18n));

Modified: sis/branches/JDK6/src/main/docbook/fr/utility.xml
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/src/main/docbook/fr/utility.xml?rev=1445244&r1=1445243&r2=1445244&view=diff
==============================================================================
--- sis/branches/JDK6/src/main/docbook/fr/utility.xml (original)
+++ sis/branches/JDK6/src/main/docbook/fr/utility.xml Tue Feb 12 16:32:28 2013
@@ -173,10 +173,10 @@
     </section>
 
     <section>
-      <title>Convention locale nulle</title>
+      <title>Convention <constant>Locale.ROOT</constant></title>
       <para>
-        La plupart des méthodes <acronym>SIS</acronym> recevant ou retournant une valeur de type <classname>Locale</classname>
-        acceptent la valeur <constant>null</constant>. Cette valeur est interprétée comme signifiant de ne pas localiser le texte.
+        Toutes les méthodes <acronym>SIS</acronym> recevant ou retournant une valeur de type <classname>Locale</classname>
+        acceptent la valeur <constant>Locale.ROOT</constant>. Cette valeur est interprétée comme signifiant de ne pas localiser le texte.
         La notion de <quote>texte non-localisé</quote> est un peu fausse, puisqu’il faut bien choisir une convention de format.
         Mais cette convention, bien que très proche de l’anglais, sera généralement légèrement différente.
         Par exemple:



Mime
View raw message