sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1445247 [1/2] - in /sis/trunk: ./ 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/src/main/...
Date Tue, 12 Feb 2013 16:36:07 GMT
Author: desruisseaux
Date: Tue Feb 12 16:36:05 2013
New Revision: 1445247

URL: http://svn.apache.org/r1445247
Log:
Merge from the JDK6 branch.

Added:
    sis/trunk/sis-utility/src/main/java/org/apache/sis/measure/DateRange.java
      - copied unchanged from r1445244, sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/measure/DateRange.java
    sis/trunk/sis-utility/src/main/java/org/apache/sis/measure/MeasurementRange.java
      - copied unchanged from r1445244, sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/measure/MeasurementRange.java
    sis/trunk/sis-utility/src/main/java/org/apache/sis/measure/NumberRange.java
      - copied unchanged from r1445244, sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/measure/NumberRange.java
    sis/trunk/sis-utility/src/main/java/org/apache/sis/measure/Range.java
      - copied unchanged from r1445244, sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/measure/Range.java
    sis/trunk/sis-utility/src/main/java/org/apache/sis/measure/RangeFormat.java
      - copied unchanged from r1445244, sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/measure/RangeFormat.java
    sis/trunk/sis-utility/src/test/java/org/apache/sis/measure/DateRangeTest.java
      - copied unchanged from r1445244, sis/branches/JDK6/sis-utility/src/test/java/org/apache/sis/measure/DateRangeTest.java
    sis/trunk/sis-utility/src/test/java/org/apache/sis/measure/MeasurementRangeTest.java
      - copied unchanged from r1445244, sis/branches/JDK6/sis-utility/src/test/java/org/apache/sis/measure/MeasurementRangeTest.java
    sis/trunk/sis-utility/src/test/java/org/apache/sis/measure/NumberRangeTest.java
      - copied unchanged from r1445244, sis/branches/JDK6/sis-utility/src/test/java/org/apache/sis/measure/NumberRangeTest.java
    sis/trunk/sis-utility/src/test/java/org/apache/sis/measure/RangeFormatTest.java
      - copied unchanged from r1445244, sis/branches/JDK6/sis-utility/src/test/java/org/apache/sis/measure/RangeFormatTest.java
    sis/trunk/sis-utility/src/test/java/org/apache/sis/measure/RangeTest.java
      - copied unchanged from r1445244, sis/branches/JDK6/sis-utility/src/test/java/org/apache/sis/measure/RangeTest.java
    sis/trunk/sis-utility/src/test/java/org/apache/sis/util/NumbersTest.java
      - copied unchanged from r1445244, sis/branches/JDK6/sis-utility/src/test/java/org/apache/sis/util/NumbersTest.java
    sis/trunk/sis-utility/src/test/java/org/apache/sis/util/resources/LoaderTest.java
      - copied unchanged from r1445244, sis/branches/JDK6/sis-utility/src/test/java/org/apache/sis/util/resources/LoaderTest.java
Modified:
    sis/trunk/   (props changed)
    sis/trunk/sis-referencing/src/test/java/org/apache/sis/geometry/DirectPosition1DTest.java
    sis/trunk/sis-referencing/src/test/java/org/apache/sis/geometry/DirectPosition2DTest.java
    sis/trunk/sis-referencing/src/test/java/org/apache/sis/geometry/GeneralDirectPositionTest.java
    sis/trunk/sis-utility/pom.xml
    sis/trunk/sis-utility/src/main/java/org/apache/sis/internal/jaxb/MarshalContext.java
    sis/trunk/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gco/LocalNameAdapter.java
    sis/trunk/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gco/ScopedNameAdapter.java
    sis/trunk/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gco/StringAdapter.java
    sis/trunk/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gmd/PT_FreeText.java
    sis/trunk/sis-utility/src/main/java/org/apache/sis/internal/util/Citations.java
    sis/trunk/sis-utility/src/main/java/org/apache/sis/internal/util/Supervisor.java
    sis/trunk/sis-utility/src/main/java/org/apache/sis/io/CompoundFormat.java
    sis/trunk/sis-utility/src/main/java/org/apache/sis/io/TableAppender.java
    sis/trunk/sis-utility/src/main/java/org/apache/sis/io/TabularFormat.java
    sis/trunk/sis-utility/src/main/java/org/apache/sis/math/StatisticsFormat.java
    sis/trunk/sis-utility/src/main/java/org/apache/sis/measure/Angle.java
    sis/trunk/sis-utility/src/main/java/org/apache/sis/measure/AngleFormat.java
    sis/trunk/sis-utility/src/main/java/org/apache/sis/measure/package-info.java
    sis/trunk/sis-utility/src/main/java/org/apache/sis/util/Localized.java
    sis/trunk/sis-utility/src/main/java/org/apache/sis/util/Numbers.java
    sis/trunk/sis-utility/src/main/java/org/apache/sis/util/collection/CollectionsExt.java
    sis/trunk/sis-utility/src/main/java/org/apache/sis/util/collection/DefaultTreeTable.java
    sis/trunk/sis-utility/src/main/java/org/apache/sis/util/collection/TreeTableFormat.java
    sis/trunk/sis-utility/src/main/java/org/apache/sis/util/collection/UnmodifiableArrayList.java
    sis/trunk/sis-utility/src/main/java/org/apache/sis/util/collection/WeakValueHashMap.java
    sis/trunk/sis-utility/src/main/java/org/apache/sis/util/iso/AbstractInternationalString.java
    sis/trunk/sis-utility/src/main/java/org/apache/sis/util/iso/AbstractName.java
    sis/trunk/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultInternationalString.java
    sis/trunk/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultLocalName.java
    sis/trunk/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultNameSpace.java
    sis/trunk/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultScopedName.java
    sis/trunk/sis-utility/src/main/java/org/apache/sis/util/iso/ResourceInternationalString.java
    sis/trunk/sis-utility/src/main/java/org/apache/sis/util/iso/Types.java
    sis/trunk/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.java
    sis/trunk/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.properties
    sis/trunk/sis-utility/src/main/java/org/apache/sis/util/resources/Errors_fr.properties
    sis/trunk/sis-utility/src/main/java/org/apache/sis/util/resources/IndexedResourceBundle.java
    sis/trunk/sis-utility/src/main/java/org/apache/sis/util/resources/Loader.java
    sis/trunk/sis-utility/src/main/java/org/apache/sis/util/resources/Messages.java
    sis/trunk/sis-utility/src/main/java/org/apache/sis/util/resources/ResourceInternationalString.java
    sis/trunk/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary.java
    sis/trunk/sis-utility/src/main/java/org/apache/sis/xml/MarshalContext.java
    sis/trunk/sis-utility/src/main/java/org/apache/sis/xml/Namespaces.java
    sis/trunk/sis-utility/src/main/java/org/apache/sis/xml/NilObject.java
    sis/trunk/sis-utility/src/main/java/org/apache/sis/xml/ValueConverter.java
    sis/trunk/sis-utility/src/main/java/org/apache/sis/xml/XLink.java
    sis/trunk/sis-utility/src/test/java/org/apache/sis/test/suite/UtilityTestSuite.java
    sis/trunk/sis-utility/src/test/java/org/apache/sis/util/CharSequencesTest.java
    sis/trunk/sis-utility/src/test/java/org/apache/sis/util/CharactersTest.java
    sis/trunk/sis-utility/src/test/java/org/apache/sis/util/ClassesTest.java
    sis/trunk/sis-utility/src/test/java/org/apache/sis/util/collection/DerivedMapTest.java
    sis/trunk/sis-utility/src/test/java/org/apache/sis/util/collection/DerivedSetTest.java
    sis/trunk/sis-utility/src/test/java/org/apache/sis/util/collection/TableColumnTest.java
    sis/trunk/sis-utility/src/test/java/org/apache/sis/util/iso/AbstractNameTest.java
    sis/trunk/sis-utility/src/test/java/org/apache/sis/util/iso/DefaultInternationalStringTest.java
    sis/trunk/sis-utility/src/test/java/org/apache/sis/util/iso/SimpleInternationalStringTest.java
    sis/trunk/sis-utility/src/test/java/org/apache/sis/util/iso/TypesTest.java
    sis/trunk/sis-utility/src/test/java/org/apache/sis/util/resources/IndexedResourceBundleTest.java
    sis/trunk/src/main/docbook/fr/utility.xml

Propchange: sis/trunk/
------------------------------------------------------------------------------
  Merged /sis/branches/JDK7:r1441587-1445223
  Merged /sis/branches/JDK6:r1441595-1445244

Modified: sis/trunk/sis-referencing/src/test/java/org/apache/sis/geometry/DirectPosition1DTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/sis-referencing/src/test/java/org/apache/sis/geometry/DirectPosition1DTest.java?rev=1445247&r1=1445246&r2=1445247&view=diff
==============================================================================
--- sis/trunk/sis-referencing/src/test/java/org/apache/sis/geometry/DirectPosition1DTest.java (original)
+++ sis/trunk/sis-referencing/src/test/java/org/apache/sis/geometry/DirectPosition1DTest.java Tue Feb 12 16:36:05 2013
@@ -46,7 +46,7 @@ public final strictfp class DirectPositi
     }
 
     /**
-     * Tests the {@link DirectPosition1D#DirectPosition2D(String)} constructor.
+     * Tests the {@link DirectPosition1D#DirectPosition1D(CharSequence)} constructor.
      */
     @Test
     public void testWktParsing() {

Modified: sis/trunk/sis-referencing/src/test/java/org/apache/sis/geometry/DirectPosition2DTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/sis-referencing/src/test/java/org/apache/sis/geometry/DirectPosition2DTest.java?rev=1445247&r1=1445246&r2=1445247&view=diff
==============================================================================
--- sis/trunk/sis-referencing/src/test/java/org/apache/sis/geometry/DirectPosition2DTest.java (original)
+++ sis/trunk/sis-referencing/src/test/java/org/apache/sis/geometry/DirectPosition2DTest.java Tue Feb 12 16:36:05 2013
@@ -46,7 +46,7 @@ public final strictfp class DirectPositi
     }
 
     /**
-     * Tests the {@link DirectPosition2D#DirectPosition2D(String)} constructor.
+     * Tests the {@link DirectPosition2D#DirectPosition2D(CharSequence)} constructor.
      */
     @Test
     public void testWktParsing() {

Modified: sis/trunk/sis-referencing/src/test/java/org/apache/sis/geometry/GeneralDirectPositionTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/sis-referencing/src/test/java/org/apache/sis/geometry/GeneralDirectPositionTest.java?rev=1445247&r1=1445246&r2=1445247&view=diff
==============================================================================
--- sis/trunk/sis-referencing/src/test/java/org/apache/sis/geometry/GeneralDirectPositionTest.java (original)
+++ sis/trunk/sis-referencing/src/test/java/org/apache/sis/geometry/GeneralDirectPositionTest.java Tue Feb 12 16:36:05 2013
@@ -61,7 +61,7 @@ public final strictfp class GeneralDirec
     }
 
     /**
-     * Tests the {@link GeneralDirectPosition#GeneralDirectPosition(String)} constructor.
+     * Tests the {@link GeneralDirectPosition#GeneralDirectPosition(CharSequence)} constructor.
      */
     @Test
     public void testWktParsing() {

Modified: sis/trunk/sis-utility/pom.xml
URL: http://svn.apache.org/viewvc/sis/trunk/sis-utility/pom.xml?rev=1445247&r1=1445246&r2=1445247&view=diff
==============================================================================
--- sis/trunk/sis-utility/pom.xml (original)
+++ sis/trunk/sis-utility/pom.xml Tue Feb 12 16:36:05 2013
@@ -90,6 +90,12 @@ Miscellaneous utilities.
         <role>Developer</role>
       </roles>
     </contributor>
+    <contributor>
+      <name>Joe White</name>
+      <roles>
+        <role>Developer</role>
+      </roles>
+    </contributor>
   </contributors>
 
 

Modified: sis/trunk/sis-utility/src/main/java/org/apache/sis/internal/jaxb/MarshalContext.java
URL: http://svn.apache.org/viewvc/sis/trunk/sis-utility/src/main/java/org/apache/sis/internal/jaxb/MarshalContext.java?rev=1445247&r1=1445246&r2=1445247&view=diff
==============================================================================
--- sis/trunk/sis-utility/src/main/java/org/apache/sis/internal/jaxb/MarshalContext.java (original)
+++ sis/trunk/sis-utility/src/main/java/org/apache/sis/internal/jaxb/MarshalContext.java Tue Feb 12 16:36:05 2013
@@ -185,8 +185,7 @@ public final class MarshalContext extend
 
     /**
      * Returns the locale to use for marshalling, or {@code null} if no locale were explicitly
-     * specified. A {@code null} value means that some locale-neutral language should be used
-     * if available, or an implementation-default locale (typically English) otherwise.
+     * specified.
      */
     @Override
     public final Locale getLocale() {
@@ -194,8 +193,8 @@ public final class MarshalContext extend
     }
 
     /**
-     * Returns the timezone, or {@code null} if none were explicitely defined.
-     * In the later case, an implementation-default (typically UTC) timezone is used.
+     * Returns the timezone to use for marshalling, or {@code null} if none were explicitely
+     * specified.
      */
     @Override
     public final TimeZone getTimeZone() {

Modified: sis/trunk/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gco/LocalNameAdapter.java
URL: http://svn.apache.org/viewvc/sis/trunk/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gco/LocalNameAdapter.java?rev=1445247&r1=1445246&r2=1445247&view=diff
==============================================================================
--- sis/trunk/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gco/LocalNameAdapter.java (original)
+++ sis/trunk/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gco/LocalNameAdapter.java Tue Feb 12 16:36:05 2013
@@ -16,6 +16,7 @@
  */
 package org.apache.sis.internal.jaxb.gco;
 
+import java.util.Locale;
 import javax.xml.bind.annotation.adapters.XmlAdapter;
 import org.opengis.util.LocalName;
 import org.opengis.util.NameFactory;
@@ -70,7 +71,7 @@ public final class LocalNameAdapter exte
      */
     @Override
     public String marshal(final LocalName value) {
-        return (value == null) ? null : value.toInternationalString().toString(null);
+        return (value == null) ? null : value.toInternationalString().toString(Locale.ROOT);
     }
 
     /**

Modified: sis/trunk/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gco/ScopedNameAdapter.java
URL: http://svn.apache.org/viewvc/sis/trunk/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gco/ScopedNameAdapter.java?rev=1445247&r1=1445246&r2=1445247&view=diff
==============================================================================
--- sis/trunk/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gco/ScopedNameAdapter.java (original)
+++ sis/trunk/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gco/ScopedNameAdapter.java Tue Feb 12 16:36:05 2013
@@ -17,6 +17,7 @@
 package org.apache.sis.internal.jaxb.gco;
 
 import java.util.List;
+import java.util.Locale;
 import java.util.ConcurrentModificationException;
 import javax.xml.bind.annotation.adapters.XmlAdapter;
 import org.opengis.util.LocalName;
@@ -64,7 +65,7 @@ public final class ScopedNameAdapter ext
         int i=0;
         for (final LocalName name : parsedNames) {
             // Asks for the unlocalized name, since we are going to marshal that.
-            names[i++] = name.toInternationalString().toString(null);
+            names[i++] = name.toInternationalString().toString(Locale.ROOT);
         }
         if (i != names.length) {
             throw new ConcurrentModificationException(Errors.format(Errors.Keys.UnexpectedChange_1, "parsedNames"));

Modified: sis/trunk/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gco/StringAdapter.java
URL: http://svn.apache.org/viewvc/sis/trunk/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gco/StringAdapter.java?rev=1445247&r1=1445246&r2=1445247&view=diff
==============================================================================
--- sis/trunk/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gco/StringAdapter.java (original)
+++ sis/trunk/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gco/StringAdapter.java Tue Feb 12 16:36:05 2013
@@ -16,6 +16,7 @@
  */
 package org.apache.sis.internal.jaxb.gco;
 
+import java.util.Locale;
 import javax.xml.bind.annotation.adapters.XmlAdapter;
 import org.opengis.util.InternationalString;
 import org.apache.sis.internal.jaxb.MarshalContext;
@@ -44,6 +45,8 @@ public final class StringAdapter extends
      * Returns a string representation of the given character sequence. If the given
      * sequence is an instance of {@link InternationalString}, then the locale from
      * the current unmashalling context is used in order to get a string.
+     * If the context is {@code null} or does not specify any locale, then the choice
+     * of locale is left to the {@link InternationalString#toString()} implementation.
      *
      * @param  value The wrapper for the value, or {@code null}.
      * @return The string representation of the given text, or {@code null}.
@@ -54,7 +57,14 @@ public final class StringAdapter extends
             if (text != null) {
                 if (text instanceof InternationalString) {
                     final MarshalContext context = MarshalContext.current();
-                    return ((InternationalString) text).toString(context != null ? context.getLocale() : null);
+                    if (context != null) {
+                        final Locale locale = context.getLocale();
+                        if (locale != null) {
+                            // While Apache SIS accepts null locale, foreigner
+                            // implementations are not guaranteed to support null.
+                            return ((InternationalString) text).toString(locale);
+                        }
+                    }
                 }
                 return text.toString();
             }

Modified: sis/trunk/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gmd/PT_FreeText.java
URL: http://svn.apache.org/viewvc/sis/trunk/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gmd/PT_FreeText.java?rev=1445247&r1=1445246&r2=1445247&view=diff
==============================================================================
--- sis/trunk/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gmd/PT_FreeText.java (original)
+++ sis/trunk/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gmd/PT_FreeText.java Tue Feb 12 16:36:05 2013
@@ -27,6 +27,7 @@ import org.apache.sis.internal.jaxb.Mars
 import org.apache.sis.internal.jaxb.gco.GO_CharacterString;
 import org.apache.sis.util.iso.DefaultInternationalString;
 import org.apache.sis.util.iso.SimpleInternationalString;
+import org.apache.sis.util.ArraysExt;
 
 
 /**
@@ -80,42 +81,29 @@ public final class PT_FreeText extends G
     }
 
     /**
-     * Constructs a {@linkplain TextGroup text group} from a {@link DefaultInternationalString}
-     * which could contains several localized strings.
+     * Constructs a {@code PT_FreeText} containing the given text groups.
      *
-     * <p>The {@code <gco:CharacterString> element will typically be set for the {@code null} locale,
+     * <p>The {@code <gco:CharacterString>} element will typically be set for the {@link Locale#ROOT},
      * which is the "unlocalized" string (not the same thing than the string in the default locale).
      * Note that the {@link TextGroup} constructor works better if the {@code <gco:CharacterString>}
-     * have been set for the {@code null} locale (the default behavior). If a different locale were
+     * have been set for the {@code ROOT} locale (the default behavior). If a different locale were
      * set, the list of localized strings in {@code TextGroup} may contains an element which
      * duplicate the {@code <gco:CharacterString>} element, or the unlocalized string normally
      * written in {@code <gco:CharacterString>} may be missing.</p>
      *
-     * @param context The current (un)marshalling context, or {@code null} if none.
-     * @param text    An international string which could have several translations
-     *                embedded for the same text.
+     * @param text The text to write in the {@code <gco:CharacterString>} element.
+     * @param textGroup The text group elements.
      *
      * @see org.apache.sis.xml.XML#LOCALE
      */
-    private PT_FreeText(final MarshalContext context, final DefaultInternationalString text) {
-        super(text.toString(context != null ? context.getLocale() : null));
-        final Set<Locale> locales = text.getLocales();
-        int n = locales.size();
-        if (locales.contains(null)) {
-            n--;
-        }
-        textGroup = new TextGroup[n];
-        int i = 0;
-        for (final Locale locale : locales) {
-            if (locale != null) {
-                textGroup[i++] = new TextGroup(locale, text.toString(locale));
-            }
-        }
+    private PT_FreeText(final String text, final TextGroup[] textGroup) {
+        super(text);
+        this.textGroup = textGroup;
     }
 
     /**
      * Constructs a {@linkplain TextGroup text group} from the given {@link InternationalString}
-     * if it contains at least one non-null locale. Otherwise returns {@code null}, meaning that
+     * if it contains at least one non-root locale. Otherwise returns {@code null}, meaning that
      * the simpler {@link GO_CharacterString} construct should be used instead.
      *
      * @param context The current (un)marshalling context, or {@code null} if none.
@@ -129,10 +117,22 @@ public final class PT_FreeText extends G
         if (text instanceof DefaultInternationalString) {
             final DefaultInternationalString df = (DefaultInternationalString) text;
             final Set<Locale> locales = df.getLocales();
-            switch (locales.size()) {
-                case 0:  break;
-                case 1:  if (locales.contains(null)) break; // Otherwise fallthrough
-                default: return new PT_FreeText(context, df);
+            final TextGroup[] textGroup = new TextGroup[locales.size()];
+            int n = 0;
+            for (final Locale locale : locales) {
+                if (locale != null && !locale.equals(Locale.ROOT)) {
+                    textGroup[n++] = new TextGroup(locale, text.toString(locale));
+                }
+            }
+            if (n != 0) {
+                /*
+                 * Invoke toString(Locale) instead than toString() even if the locale is null,
+                 * since the desired fallback is typically Locale.ROOT instead than the system
+                 * default. It is usually safer to avoid null value, but in this particular case
+                 * the implementation (DefaultInternationalString) is known to support null.
+                 */
+                return new PT_FreeText(df.toString(context != null ? context.getLocale() : null),
+                        ArraysExt.resize(textGroup, n));
             }
         }
         return null;

Modified: sis/trunk/sis-utility/src/main/java/org/apache/sis/internal/util/Citations.java
URL: http://svn.apache.org/viewvc/sis/trunk/sis-utility/src/main/java/org/apache/sis/internal/util/Citations.java?rev=1445247&r1=1445246&r2=1445247&view=diff
==============================================================================
--- sis/trunk/sis-utility/src/main/java/org/apache/sis/internal/util/Citations.java (original)
+++ sis/trunk/sis-utility/src/main/java/org/apache/sis/internal/util/Citations.java Tue Feb 12 16:36:05 2013
@@ -18,6 +18,7 @@ package org.apache.sis.internal.util;
 
 import java.util.Collection;
 import java.util.Iterator;
+import java.util.Locale;
 import org.opengis.metadata.Identifier;
 import org.opengis.metadata.citation.Citation;
 import org.opengis.util.InternationalString;
@@ -83,8 +84,7 @@ public final class Citations extends Sta
             Iterator<? extends InternationalString> iterator = null;
             do {
                 if (candidate != null) {
-                    // The "null" locale argument is required for getting the unlocalized version.
-                    final String unlocalized = candidate.toString(null);
+                    final String unlocalized = candidate.toString(Locale.ROOT);
                     if (titleMatches(c1, unlocalized)) {
                         return true;
                     }
@@ -123,8 +123,7 @@ public final class Citations extends Sta
             Iterator<? extends InternationalString> iterator = null;
             do {
                 if (candidate != null) {
-                    // The "null" locale argument is required for getting the unlocalized version.
-                    final String unlocalized = candidate.toString(null);
+                    final String unlocalized = candidate.toString(Locale.ROOT);
                     if (equalsFiltered(unlocalized, title, LETTERS_AND_DIGITS, true)) {
                         return true;
                     }

Modified: sis/trunk/sis-utility/src/main/java/org/apache/sis/internal/util/Supervisor.java
URL: http://svn.apache.org/viewvc/sis/trunk/sis-utility/src/main/java/org/apache/sis/internal/util/Supervisor.java?rev=1445247&r1=1445246&r2=1445247&view=diff
==============================================================================
--- sis/trunk/sis-utility/src/main/java/org/apache/sis/internal/util/Supervisor.java (original)
+++ sis/trunk/sis-utility/src/main/java/org/apache/sis/internal/util/Supervisor.java Tue Feb 12 16:36:05 2013
@@ -34,6 +34,7 @@ import java.lang.management.ManagementFa
 
 import org.apache.sis.util.About;
 import org.apache.sis.util.Localized;
+import org.apache.sis.util.ArgumentChecks;
 import org.apache.sis.util.logging.Logging;
 import org.apache.sis.util.resources.Errors;
 import org.apache.sis.util.collection.TreeTable;
@@ -116,6 +117,7 @@ public final class Supervisor extends St
      */
     public Supervisor(final Locale locale) throws NotCompliantMBeanException {
         super(SupervisorMBean.class);
+        ArgumentChecks.ensureNonNull("locale", locale);
         this.locale = locale;
     }
 

Modified: sis/trunk/sis-utility/src/main/java/org/apache/sis/io/CompoundFormat.java
URL: http://svn.apache.org/viewvc/sis/trunk/sis-utility/src/main/java/org/apache/sis/io/CompoundFormat.java?rev=1445247&r1=1445246&r2=1445247&view=diff
==============================================================================
--- sis/trunk/sis-utility/src/main/java/org/apache/sis/io/CompoundFormat.java (original)
+++ sis/trunk/sis-utility/src/main/java/org/apache/sis/io/CompoundFormat.java Tue Feb 12 16:36:05 2013
@@ -30,7 +30,6 @@ import java.text.NumberFormat;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import net.jcip.annotations.NotThreadSafe;
-import org.opengis.util.InternationalString;
 
 import org.apache.sis.measure.Angle;
 import org.apache.sis.measure.AngleFormat;
@@ -82,8 +81,8 @@ public abstract class CompoundFormat<T> 
     private static final long serialVersionUID = -7094915750367581487L;
 
     /**
-     * The locale given at construction time, or {@code null} for unlocalized format.
-     * See {@link #getLocale()} for more information on {@code null} locale.
+     * The locale given at construction time, or {@link Locale#ROOT} (never {@code null}) for
+     * unlocalized format. See {@link #getLocale()} for more information on {@code ROOT} locale.
      */
     protected final Locale locale;
 
@@ -99,31 +98,30 @@ public abstract class CompoundFormat<T> 
     private transient Map<Class<?>,Format> formats;
 
     /**
-     * Creates a new format for the given locale. The given locale can be {@code null} if this
-     * format shall parse and format "unlocalized" strings. See {@link #getLocale()} for more
-     * information on {@code null} locale.
+     * Creates a new format for the given locale. The given locale can be {@code null} or
+     * {@link Locale#ROOT} if this format shall parse and format "unlocalized" strings.
+     * See {@link #getLocale()} for more information on {@code ROOT} locale.
      *
-     * @param locale   The locale, or {@code null} for unlocalized format.
+     * @param locale   The locale to use for numbers, dates and angles formatting,
+     *                 or {@code null} for the {@linkplain Locale#ROOT root locale}.
      * @param timezone The timezone, or {@code null} for UTC.
      */
     protected CompoundFormat(final Locale locale, final TimeZone timezone) {
-        this.locale   = locale;
+        this.locale   = (locale != null) ? locale : Locale.ROOT;
         this.timezone = timezone;
     }
 
     /**
-     * Returns the locale given at construction time. The returned locale may be {@code null}
+     * Returns the locale given at construction time. The returned value may be {@link Locale#ROOT}
      * if this format does not apply any localization. The definition of "unlocalized string"
      * is implementation-dependent, but some typical examples are:
      *
      * <ul>
      *   <li>Format {@link Number}s using {@code toString()} instead than {@code NumberFormat}.</li>
-     *   <li>Format {@link InternationalString}s using {@code toString(null)}. This has the desired
-     *       behavior at least with the {@linkplain org.apache.sis.util.iso.DefaultInternationalString#toString(Locale)
-     *       SIS implementation}.</li>
+     *   <li>Format {@link Date}s using the ISO pattern instead than the English one.</li>
      * </ul>
      *
-     * @return The locale used for this format, or {@code null} for unlocalized format.
+     * @return The locale used for this format, or {@link Locale#ROOT} for unlocalized format.
      */
     @Override
     public Locale getLocale() {
@@ -373,22 +371,22 @@ public abstract class CompoundFormat<T> 
          * DefaultFormat.getInstance(…) will indirectly perform this kind of comparison.
          */
         if (Number.class.isAssignableFrom(valueType)) {
-            if (locale == null) {
+            if (Locale.ROOT.equals(locale)) {
                 return DefaultFormat.getInstance(valueType);
             } else if (valueType == Number.class) {
                 return NumberFormat.getInstance(locale);
             }
         } else if (valueType == Date.class) {
             final DateFormat format;
-            if (locale != null) {
+            if (!Locale.ROOT.equals(locale)) {
                 format = DateFormat.getDateTimeInstance(DateFormat.MEDIUM, DateFormat.MEDIUM, locale);
             } else {
-                format = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss", Locale.US);
+                format = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss", Locale.ROOT);
             }
             format.setTimeZone(timezone != null ? timezone : TimeZone.getTimeZone("UTC"));
             return format;
         } else if (valueType == Angle.class) {
-            return AngleFormat.getInstance(locale != null ? locale : Locale.US);
+            return AngleFormat.getInstance(locale);
         }
         return null;
     }

Modified: sis/trunk/sis-utility/src/main/java/org/apache/sis/io/TableAppender.java
URL: http://svn.apache.org/viewvc/sis/trunk/sis-utility/src/main/java/org/apache/sis/io/TableAppender.java?rev=1445247&r1=1445246&r2=1445247&view=diff
==============================================================================
--- sis/trunk/sis-utility/src/main/java/org/apache/sis/io/TableAppender.java (original)
+++ sis/trunk/sis-utility/src/main/java/org/apache/sis/io/TableAppender.java Tue Feb 12 16:36:05 2013
@@ -77,7 +77,7 @@ import org.apache.sis.internal.util.JDK7
  * @version 0.3
  * @module
  *
- * @see org.apache.sis.util.tree.TreeTableFormat
+ * @see org.apache.sis.util.collection.TreeTableFormat
  */
 @Decorator(Appendable.class)
 public class TableAppender extends Appender implements Flushable {

Modified: sis/trunk/sis-utility/src/main/java/org/apache/sis/io/TabularFormat.java
URL: http://svn.apache.org/viewvc/sis/trunk/sis-utility/src/main/java/org/apache/sis/io/TabularFormat.java?rev=1445247&r1=1445246&r2=1445247&view=diff
==============================================================================
--- sis/trunk/sis-utility/src/main/java/org/apache/sis/io/TabularFormat.java (original)
+++ sis/trunk/sis-utility/src/main/java/org/apache/sis/io/TabularFormat.java Tue Feb 12 16:36:05 2013
@@ -135,7 +135,8 @@ public abstract class TabularFormat<T> e
     /**
      * Creates a new tabular format.
      *
-     * @param locale   The locale to use for numbers, dates and angles formatting.
+     * @param locale   The locale to use for numbers, dates and angles formatting,
+     *                 or {@code null} for the {@linkplain Locale#ROOT root locale}.
      * @param timezone The timezone, or {@code null} for UTC.
      */
     public TabularFormat(final Locale locale, final TimeZone timezone) {

Modified: sis/trunk/sis-utility/src/main/java/org/apache/sis/math/StatisticsFormat.java
URL: http://svn.apache.org/viewvc/sis/trunk/sis-utility/src/main/java/org/apache/sis/math/StatisticsFormat.java?rev=1445247&r1=1445246&r2=1445247&view=diff
==============================================================================
--- sis/trunk/sis-utility/src/main/java/org/apache/sis/math/StatisticsFormat.java (original)
+++ sis/trunk/sis-utility/src/main/java/org/apache/sis/math/StatisticsFormat.java Tue Feb 12 16:36:05 2013
@@ -110,13 +110,14 @@ public class StatisticsFormat extends Ta
      * Constructs a new format for the given numeric and header locales.
      * The timezone is used only if the values added to the {@link Statistics} are dates.
      *
-     * @param locale       The locale for numeric values, or {@code null} for unlocalized format.
+     * @param locale       The locale to use for numbers, dates and angles formatting,
+     *                     or {@code null} for the {@linkplain Locale#ROOT root locale}.
      * @param headerLocale The locale for row and column headers. Usually same as {@code locale}.
      * @param timezone     The timezone, or {@code null} for UTC.
      */
     public StatisticsFormat(final Locale locale, final Locale headerLocale, final TimeZone timezone) {
         super(locale, timezone);
-        this.headerLocale = headerLocale;
+        this.headerLocale = (headerLocale != null) ? headerLocale : Locale.ROOT;
     }
 
     /**

Modified: sis/trunk/sis-utility/src/main/java/org/apache/sis/measure/Angle.java
URL: http://svn.apache.org/viewvc/sis/trunk/sis-utility/src/main/java/org/apache/sis/measure/Angle.java?rev=1445247&r1=1445246&r2=1445247&view=diff
==============================================================================
--- sis/trunk/sis-utility/src/main/java/org/apache/sis/measure/Angle.java (original)
+++ sis/trunk/sis-utility/src/main/java/org/apache/sis/measure/Angle.java Tue Feb 12 16:36:05 2013
@@ -102,7 +102,7 @@ public class Angle implements Comparable
         } catch (ParseException exception) {
             /*
              * Use Exception.getMessage() instead than getLocalizedMessage() because the later
-             * is formatted in the AngleFormat locale, which is hard-coded to Locale.US in our
+             * is formatted in the AngleFormat locale, which is hard-coded to Locale.ROOT in our
              * 'getAngleFormat()' implementation. The getMessage() method uses the system locale,
              * which is what we actually want.
              */
@@ -240,7 +240,7 @@ public class Angle implements Comparable
     private static Format getAngleFormat() {
         assert Thread.holdsLock(Angle.class);
         if (format == null) {
-            format = AngleFormat.getInstance(Locale.US);
+            format = AngleFormat.getInstance(Locale.ROOT);
         }
         return format;
     }

Modified: sis/trunk/sis-utility/src/main/java/org/apache/sis/measure/AngleFormat.java
URL: http://svn.apache.org/viewvc/sis/trunk/sis-utility/src/main/java/org/apache/sis/measure/AngleFormat.java?rev=1445247&r1=1445246&r2=1445247&view=diff
==============================================================================
--- sis/trunk/sis-utility/src/main/java/org/apache/sis/measure/AngleFormat.java (original)
+++ sis/trunk/sis-utility/src/main/java/org/apache/sis/measure/AngleFormat.java Tue Feb 12 16:36:05 2013
@@ -239,7 +239,7 @@ public class AngleFormat extends Format 
     }
 
     /**
-     * The locale specified at construction time.
+     * The locale specified at construction time (never null).
      */
     private final Locale locale;
 
@@ -361,6 +361,7 @@ public class AngleFormat extends Format 
      * @param  locale The locale to use.
      */
     public AngleFormat(final Locale locale) {
+        ArgumentChecks.ensureNonNull("locale", locale);
         this.locale = locale;
         degreesFieldWidth     = 1;
         minutesFieldWidth     = 2;
@@ -392,6 +393,7 @@ public class AngleFormat extends Format 
      * @throws IllegalArgumentException If the specified pattern is illegal.
      */
     public AngleFormat(final String pattern, final Locale locale) throws IllegalArgumentException {
+        ArgumentChecks.ensureNonNull("locale", locale);
         this.locale = locale;
         applyPattern(pattern, SYMBOLS, '.');
     }
@@ -911,7 +913,7 @@ scan:   for (int i=0; i<length;) {
              * heavy formatToCharacterIterator(…). Otherwise the usual format(…) method fits well.
              */
             final int startPosition = toAppendTo.length();
-            if (characterIterator instanceof FormattedCharacterIterator) {
+            if (characterIterator != null) {
                 final FormattedCharacterIterator it = (FormattedCharacterIterator) characterIterator;
                 it.append(numberFormat.formatToCharacterIterator(value), toAppendTo);
                 if (suffix != null) {
@@ -1001,7 +1003,7 @@ scan:   for (int i=0; i<length;) {
             pos.setBeginIndex(startPosition);
             pos.setEndIndex(toAppendTo.length());
         }
-        if (characterIterator instanceof FormattedCharacterIterator) {
+        if (characterIterator != null) {
             ((FormattedCharacterIterator) characterIterator).addFieldLimit(
                     Field.HEMISPHERE, suffix, startPosition);
         }
@@ -1609,9 +1611,9 @@ BigBoss:    switch (skipSuffix(source, p
 
     /**
      * Returns this formatter locale. This is the locale specified at construction time if any,
-     * or the default locale at construction time otherwise.
+     * or the {@linkplain Locale#getDefault() default locale} at construction time otherwise.
      *
-     * @return This formatter locale.
+     * @return This formatter locale (never {@code null}).
      */
     @Override
     public Locale getLocale() {

Modified: sis/trunk/sis-utility/src/main/java/org/apache/sis/measure/package-info.java
URL: http://svn.apache.org/viewvc/sis/trunk/sis-utility/src/main/java/org/apache/sis/measure/package-info.java?rev=1445247&r1=1445246&r2=1445247&view=diff
==============================================================================
--- sis/trunk/sis-utility/src/main/java/org/apache/sis/measure/package-info.java (original)
+++ sis/trunk/sis-utility/src/main/java/org/apache/sis/measure/package-info.java Tue Feb 12 16:36:05 2013
@@ -24,6 +24,10 @@
  *   <li>{@link org.apache.sis.measure.Angle} and its subclasses
  *      ({@link org.apache.sis.measure.Longitude},
  *       {@link org.apache.sis.measure.Latitude})</li>
+ *   <li>{@link org.apache.sis.measure.Range} and its subclasses
+ *      ({@link org.apache.sis.measure.DateRange},
+ *       {@link org.apache.sis.measure.NumberRange},
+ *       {@link org.apache.sis.measure.MeasurementRange})</li>
  *   <li>Formatters
  *      ({@link org.apache.sis.measure.AngleFormat},
  *       {@link org.apache.sis.measure.CoordinateFormat},

Modified: sis/trunk/sis-utility/src/main/java/org/apache/sis/util/Localized.java
URL: http://svn.apache.org/viewvc/sis/trunk/sis-utility/src/main/java/org/apache/sis/util/Localized.java?rev=1445247&r1=1445246&r2=1445247&view=diff
==============================================================================
--- sis/trunk/sis-utility/src/main/java/org/apache/sis/util/Localized.java (original)
+++ sis/trunk/sis-utility/src/main/java/org/apache/sis/util/Localized.java Tue Feb 12 16:36:05 2013
@@ -35,10 +35,14 @@ public interface Localized {
      *
      * <ul>
      *   <li>A synonymous of the {@linkplain Locale#getDefault() system default locale};</li>
-     *   <li>or an "unlocalized" service, for example formatting numbers using
-     *       {@link Double#toString(double)} instead than {@link java.text.NumberFormat}.</li>
+     *   <li>A synonymous of {@link Locale#ROOT} for an "unlocalized" service. For example the
+     *       service may format numbers using {@link Double#toString(double)} instead than
+     *       {@link java.text.NumberFormat}.</li>
      * </ul>
      *
+     * Implementations are encouraged to return a non-null value in every cases.
+     * Nevertheless client codes should be prepared to receive null values.
+     *
      * @return The locale, or {@code null} if not explicitly defined.
      *
      * @see org.apache.sis.io.CompoundFormat#getLocale()

Modified: sis/trunk/sis-utility/src/main/java/org/apache/sis/util/Numbers.java
URL: http://svn.apache.org/viewvc/sis/trunk/sis-utility/src/main/java/org/apache/sis/util/Numbers.java?rev=1445247&r1=1445246&r2=1445247&view=diff
==============================================================================
--- sis/trunk/sis-utility/src/main/java/org/apache/sis/util/Numbers.java (original)
+++ sis/trunk/sis-utility/src/main/java/org/apache/sis/util/Numbers.java Tue Feb 12 16:36:05 2013
@@ -516,14 +516,21 @@ public final class Numbers extends Stati
      * </ul>
      *
      * {@note This method is intentionally restricted to primitive types. Other types
-     *        like <code>BigDecimal</code> are not the purpose of this method. See the
-     *        <code>ConverterRegistry</code> class for a more generic method.}
+     *        like <code>BigDecimal</code> are not the purpose of this method.
+     *        See <code>ObjectConverter</code> for more generic methods.}
      *
-     * @param <N> The class to cast to.
-     * @param n The number to cast.
-     * @param c The destination type.
+     * This method does not verify if the given type is wide enough for the given value,
+     * because the type has typically been calculated by {@link #widestClass(Class, Class)}
+     * or {@link #narrowestClass(Number)}. If nevertheless the given type is not wide enough,
+     * then the behavior depends on the implementation of the corresponding
+     * {@code Number.fooValue()} method - typically, the value is just rounded or truncated.
+     *
+     * @param  <N> The class to cast to.
+     * @param  n The number to cast.
+     * @param  c The destination type.
      * @return The number casted to the given type.
-     * @throws IllegalArgumentException If the given type is unknown.
+     * @throws IllegalArgumentException If the given type is not one of the primitive
+     *         wrappers for numeric types.
      */
     @SuppressWarnings("unchecked")
     public static <N extends Number> N cast(final Number n, final Class<N> c)

Modified: sis/trunk/sis-utility/src/main/java/org/apache/sis/util/collection/CollectionsExt.java
URL: http://svn.apache.org/viewvc/sis/trunk/sis-utility/src/main/java/org/apache/sis/util/collection/CollectionsExt.java?rev=1445247&r1=1445246&r2=1445247&view=diff
==============================================================================
--- sis/trunk/sis-utility/src/main/java/org/apache/sis/util/collection/CollectionsExt.java (original)
+++ sis/trunk/sis-utility/src/main/java/org/apache/sis/util/collection/CollectionsExt.java Tue Feb 12 16:36:05 2013
@@ -128,7 +128,7 @@ public final class CollectionsExt extend
      * <p>The {@link Set#add(Object) Set.add(E)} method is supported only if the given converter
      * is {@linkplain org.apache.sis.math.FunctionProperty#INVERTIBLE invertible}.
      * An invertible converter is not mandatory for other {@code Set} operations.
-     * However {@link Set#contains(Object) contains} and {@link #remove(Object) remove}
+     * However {@link Set#contains(Object) contains} and {@link Set#remove(Object) remove}
      * operations are likely to be faster if the inverse converter is available.</p>
      *
      * <p>The derived set may contain fewer elements than the original set if some elements
@@ -618,7 +618,7 @@ public final class CollectionsExt extend
     }
 
     /**
-     * Returns a comparator for map entries having comparable {@linkplain Map.Entry#getValue() values}.
+     * Returns a comparator for map entries having comparable {@linkplain java.util.Map.Entry#getValue() values}.
      * For any pair of entries {@code e1} and {@code e2}, this method performs the comparison as below:
      *
      * {@preformat java

Modified: sis/trunk/sis-utility/src/main/java/org/apache/sis/util/collection/DefaultTreeTable.java
URL: http://svn.apache.org/viewvc/sis/trunk/sis-utility/src/main/java/org/apache/sis/util/collection/DefaultTreeTable.java?rev=1445247&r1=1445246&r2=1445247&view=diff
==============================================================================
--- sis/trunk/sis-utility/src/main/java/org/apache/sis/util/collection/DefaultTreeTable.java (original)
+++ sis/trunk/sis-utility/src/main/java/org/apache/sis/util/collection/DefaultTreeTable.java Tue Feb 12 16:36:05 2013
@@ -506,8 +506,8 @@ public class DefaultTreeTable implements
 
         /**
          * Adds a new child in the {@linkplain #getChildren() children list}.
-         * The default implementation delegates to {@link #Node(Node)}, which
-         * has the following implications:
+         * The default implementation delegates to {@link Node#Node(Node)},
+         * which has the following implications:
          *
          * <ul>
          *   <li>The new node inherits the columns of this node, on the assumption that

Modified: sis/trunk/sis-utility/src/main/java/org/apache/sis/util/collection/TreeTableFormat.java
URL: http://svn.apache.org/viewvc/sis/trunk/sis-utility/src/main/java/org/apache/sis/util/collection/TreeTableFormat.java?rev=1445247&r1=1445246&r2=1445247&view=diff
==============================================================================
--- sis/trunk/sis-utility/src/main/java/org/apache/sis/util/collection/TreeTableFormat.java (original)
+++ sis/trunk/sis-utility/src/main/java/org/apache/sis/util/collection/TreeTableFormat.java Tue Feb 12 16:36:05 2013
@@ -145,7 +145,8 @@ public class TreeTableFormat extends Tab
     /**
      * Creates a new tree table format.
      *
-     * @param locale   The locale to use for numbers, dates and angles formatting.
+     * @param locale   The locale to use for numbers, dates and angles formatting,
+     *                 or {@code null} for the {@linkplain Locale#ROOT root locale}.
      * @param timezone The timezone, or {@code null} for UTC.
      */
     public TreeTableFormat(final Locale locale, final TimeZone timezone) {

Modified: sis/trunk/sis-utility/src/main/java/org/apache/sis/util/collection/UnmodifiableArrayList.java
URL: http://svn.apache.org/viewvc/sis/trunk/sis-utility/src/main/java/org/apache/sis/util/collection/UnmodifiableArrayList.java?rev=1445247&r1=1445246&r2=1445247&view=diff
==============================================================================
--- sis/trunk/sis-utility/src/main/java/org/apache/sis/util/collection/UnmodifiableArrayList.java (original)
+++ sis/trunk/sis-utility/src/main/java/org/apache/sis/util/collection/UnmodifiableArrayList.java Tue Feb 12 16:36:05 2013
@@ -63,7 +63,7 @@ public class UnmodifiableArrayList<E> ex
      * retained (i.e. the array is <strong>not</strong> cloned). Consequently the given array
      * shall not be modified after construction if this list is intended to be immutable.
      *
-     * <p>This constructor is for sub-classing only. Users should invoke the {@link #wrap(E[])}
+     * <p>This constructor is for sub-classing only. Users should invoke the {@link #wrap(Object[])}
      * static method instead.</p>
      *
      * @param array The array to wrap.
@@ -253,7 +253,7 @@ public class UnmodifiableArrayList<E> ex
      * @return A view of the specified range within this list.
      * @throws IndexOutOfBoundsException If the lower or upper value are out of bounds.
      *
-     * @see #wrap(E[], int, int)
+     * @see #wrap(Object[], int, int)
      */
     @Override
     public UnmodifiableArrayList<E> subList(final int lower, final int upper)

Modified: sis/trunk/sis-utility/src/main/java/org/apache/sis/util/collection/WeakValueHashMap.java
URL: http://svn.apache.org/viewvc/sis/trunk/sis-utility/src/main/java/org/apache/sis/util/collection/WeakValueHashMap.java?rev=1445247&r1=1445246&r2=1445247&view=diff
==============================================================================
--- sis/trunk/sis-utility/src/main/java/org/apache/sis/util/collection/WeakValueHashMap.java (original)
+++ sis/trunk/sis-utility/src/main/java/org/apache/sis/util/collection/WeakValueHashMap.java Tue Feb 12 16:36:05 2013
@@ -30,8 +30,8 @@ import org.apache.sis.util.Debug;
 import org.apache.sis.util.ArraysExt;
 import org.apache.sis.util.Utilities;
 import org.apache.sis.util.Workaround;
-import org.apache.sis.util.ArgumentChecks;
 import org.apache.sis.util.NullArgumentException;
+import org.apache.sis.util.resources.Errors;
 
 import static org.apache.sis.util.collection.WeakEntry.*;
 
@@ -386,8 +386,10 @@ public class WeakValueHashMap<K,V> exten
      */
     @Override
     public V put(final K key, final V value) throws NullArgumentException {
-        ArgumentChecks.ensureNonNull("key",   key);
-        ArgumentChecks.ensureNonNull("value", value);
+        if (key == null || value == null) {
+            throw new NullArgumentException(Errors.format(key == null
+                    ? Errors.Keys.NullMapKey : Errors.Keys.NullMapValue));
+        }
         return intern(key, value);
     }
 

Modified: sis/trunk/sis-utility/src/main/java/org/apache/sis/util/iso/AbstractInternationalString.java
URL: http://svn.apache.org/viewvc/sis/trunk/sis-utility/src/main/java/org/apache/sis/util/iso/AbstractInternationalString.java?rev=1445247&r1=1445246&r2=1445247&view=diff
==============================================================================
--- sis/trunk/sis-utility/src/main/java/org/apache/sis/util/iso/AbstractInternationalString.java (original)
+++ sis/trunk/sis-utility/src/main/java/org/apache/sis/util/iso/AbstractInternationalString.java Tue Feb 12 16:36:05 2013
@@ -44,11 +44,11 @@ public abstract class AbstractInternatio
      * The string in the {@linkplain Locale#getDefault() system default} locale, or {@code null}
      * if this string has not yet been determined. This is the default string returned by
      * {@link #toString()} and others methods from the {@link CharSequence} interface.
-     * <P>
-     * This field is not serialized because serialization is often used for data transmission
+     *
+     * <p>This field is not serialized because serialization is often used for data transmission
      * between a server and a client, and the client may not use the same locale than the server.
-     * We want the locale to be examined again on the client side.
-     * <P>
+     * We want the locale to be examined again on the client side.</p>
+     *
      * This field is read and written by {@link SimpleInternationalString}.
      */
     transient String defaultValue;
@@ -127,15 +127,33 @@ public abstract class AbstractInternatio
 
     /**
      * Returns this string in the given locale. If no string is available in the given locale,
-     * then some default locale is used. The default locale is implementation-dependent.
-     * It may or may not be the {@linkplain Locale#getDefault() system default}.
+     * then some fallback locale is used. The fallback locale is implementation-dependent, and
+     * is not necessarily the same than the default locale used by the {@link #toString()} method.
+     *
+     * {@section Handling of <code>Locale.ROOT</code> argument value}
+     * {@link Locale#ROOT} can be given to this method for requesting a "unlocalized" string,
+     * typically some programmatic values like enumerations or identifiers. While identifiers
+     * often look like English words, {@code Locale.ROOT} is not considered synonymous to
+     * {@link Locale#ENGLISH} because the values may differ in the way numbers and dates are
+     * formatted (e.g. using the ISO 8601 standard for dates instead than English conventions).
+     *
+     * {@section Handling of <code>null</code> argument value}
+     * The {@code Locale.ROOT} constant is new in Java 6. Some other libraries designed for Java 5
+     * use the {@code null} value for "unlocalized" strings. Apache SIS accepts {@code null} value
+     * for inter-operability with those libraries. However the behavior is implementation dependent:
+     * some subclasses will take {@code null} as a synonymous of the system default locale, while
+     * other subclasses will take {@code null} as a synonymous of the root locale. In order to
+     * ensure determinist behavior, client code are encouraged to specify only non-null values.
+     *
+     * @param  locale The desired locale for the string to be returned.
+     * @return The string in the given locale if available, or in an
+     *         implementation-dependent fallback locale otherwise.
      *
-     * @param  locale The desired locale for the string to be returned,
-     *         or {@code null} for a string in the implementation default locale.
-     * @return The string in the given locale if available, or in the default locale otherwise.
+     * @see Locale#getDefault()
+     * @see Locale#ROOT
      */
     @Override
-    public abstract String toString(final Locale locale);
+    public abstract String toString(Locale locale);
 
     /**
      * Returns this string in the default locale. Invoking this method is equivalent to invoking

Modified: sis/trunk/sis-utility/src/main/java/org/apache/sis/util/iso/AbstractName.java
URL: http://svn.apache.org/viewvc/sis/trunk/sis-utility/src/main/java/org/apache/sis/util/iso/AbstractName.java?rev=1445247&r1=1445246&r2=1445247&view=diff
==============================================================================
--- sis/trunk/sis-utility/src/main/java/org/apache/sis/util/iso/AbstractName.java (original)
+++ sis/trunk/sis-utility/src/main/java/org/apache/sis/util/iso/AbstractName.java Tue Feb 12 16:36:05 2013
@@ -234,8 +234,8 @@ public abstract class AbstractName imple
             }
             asString = buffer.toString();
         }
-        // Note: there is no need to invoke InternationalString.toString(null) for the
-        // unlocalized version, because our International inner class is implemented in
+        // Note: there is no need to invoke InternationalString.toString(Locale.ROOT) for
+        // the unlocalized version, because our International inner class is implemented in
         // such a way that InternationalString.toString() returns AbstractName.toString().
         return asString.toString();
     }

Modified: sis/trunk/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultInternationalString.java
URL: http://svn.apache.org/viewvc/sis/trunk/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultInternationalString.java?rev=1445247&r1=1445246&r2=1445247&view=diff
==============================================================================
--- sis/trunk/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultInternationalString.java (original)
+++ sis/trunk/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultInternationalString.java Tue Feb 12 16:36:05 2013
@@ -29,6 +29,7 @@ import java.util.Locale;
 import net.jcip.annotations.ThreadSafe;
 import org.opengis.util.InternationalString;
 import org.apache.sis.util.Locales;
+import org.apache.sis.util.ArgumentChecks;
 import org.apache.sis.util.resources.Errors;
 
 import static org.apache.sis.util.collection.CollectionsExt.isNullOrEmpty;
@@ -85,7 +86,7 @@ public class DefaultInternationalString 
      */
     public DefaultInternationalString(final String string) {
         if (string != null) {
-            localeMap = Collections.singletonMap(null, string);
+            localeMap = Collections.singletonMap(Locale.ROOT, string);
         } else {
             localeMap = Collections.emptyMap();
         }
@@ -111,43 +112,48 @@ public class DefaultInternationalString 
                 // If HashMap is replaced by an other type, please revisit 'getLocales()'.
             }
         }
+        final boolean nullMapKey = localeMap.containsKey(null);
+        if (nullMapKey || localeMap.containsValue(null)) {
+            throw new IllegalArgumentException(Errors.format(nullMapKey
+                    ? Errors.Keys.NullMapKey : Errors.Keys.NullMapValue));
+        }
     }
 
     /**
      * Adds a string for the given locale.
      *
-     * @param  locale The locale for the {@code string} value, or {@code null}.
+     * @param  locale The locale for the {@code string} value.
      * @param  string The localized string.
      * @throws IllegalArgumentException if a different string value was already set for
      *         the given locale.
      */
     public synchronized void add(final Locale locale, final String string) throws IllegalArgumentException {
-        if (string != null) {
-            switch (localeMap.size()) {
-                case 0: {
-                    localeMap = Collections.singletonMap(locale, string);
-                    localeSet = null;
-                    defaultValue = null; // Will be recomputed when first needed.
-                    return;
-                }
-                case 1: {
-                    // If HashMap is replaced by an other type, please revisit 'getLocales()'.
-                    localeMap = new LinkedHashMap<Locale,String>(localeMap);
-                    localeSet = null;
-                    break;
-                }
+        ArgumentChecks.ensureNonNull("locale", locale);
+        ArgumentChecks.ensureNonNull("string", string);
+        switch (localeMap.size()) {
+            case 0: {
+                localeMap = Collections.singletonMap(locale, string);
+                localeSet = null;
+                defaultValue = null; // Will be recomputed when first needed.
+                return;
             }
-            final String old = localeMap.put(locale, string);
-            if (old != null) {
-                localeMap.put(locale, old);
-                if (string.equals(old)) {
-                    return;
-                }
-                throw new IllegalArgumentException(Errors.format(
-                        Errors.Keys.ValueAlreadyDefined_1, locale));
+            case 1: {
+                // If HashMap is replaced by an other type, please revisit 'getLocales()'.
+                localeMap = new LinkedHashMap<Locale,String>(localeMap);
+                localeSet = null;
+                break;
             }
-            defaultValue = null; // Will be recomputed when first needed.
         }
+        final String old = localeMap.put(locale, string);
+        if (old != null) {
+            localeMap.put(locale, old);
+            if (string.equals(old)) {
+                return;
+            }
+            throw new IllegalArgumentException(Errors.format(
+                    Errors.Keys.ValueAlreadyDefined_1, locale));
+        }
+        defaultValue = null; // Will be recomputed when first needed.
     }
 
     /**
@@ -250,60 +256,69 @@ public class DefaultInternationalString 
      * part. If no string are found, then this method searches for a locale without the
      * {@linkplain Locale#getCountry() country} part. For example if the {@code "fr_CA"} locale
      * was requested but not found, then this method looks for the {@code "fr"} locale.
-     * The {@code null} locale (which stand for unlocalized message) is tried last.
+     * The {@linkplain Locale#ROOT root locale} is tried last.
      *
-     * {@section Handling of <code>null</code> argument value}
-     * A {@code null} argument value can be given to this method for requesting a "unlocalized" string,
-     * typically some programmatic strings like {@linkplain org.opengis.annotation.UML#identifier() UML
-     * identifiers}. While such identifiers often look like English words, the {@code null} locale is
-     * not considered synonymous to the {@linkplain Locale#ENGLISH English locale} since the values may
-     * differ in the way numbers and dates are formatted (e.g. using the ISO 8601 standard for dates
-     * instead than English conventions). In order to produce a value close to the common practice,
-     * this method handles {@code null} argument value as below:
+     * {@section Handling of <code>Locale.ROOT</code> argument value}
+     * {@link Locale#ROOT} can be given to this method for requesting a "unlocalized" string,
+     * typically some programmatic values like enumerations or identifiers.
+     * While identifiers often look like English words, {@code Locale.ROOT} is not considered
+     * synonymous to {@link Locale#ENGLISH} because the values may differ in the way numbers and
+     * dates are formatted (e.g. using the ISO 8601 standard for dates instead than English conventions).
+     * In order to produce a value close to the common practice, this method handles {@code Locale.ROOT}
+     * as below:
      *
      * <ul>
-     *   <li>If a string has been explicitly {@linkplain #add(Locale, String) added} for the
-     *       {@code null} locale, then that string is returned.</li>
+     *   <li>If a string has been explicitly {@linkplain #add(Locale, String) added} for
+     *       {@code Locale.ROOT}, then that string is returned.</li>
      *   <li>Otherwise, acknowledging that UML identifiers in OGC/ISO specifications are primarily
-     *       expressed in the English language, this method looks for an English string as an
-     *       approximation of a "unlocalized" string.</li>
-     *   <li>If no English string was found, this method looks for a string for the
+     *       expressed in the English language, this method looks for strings associated to
+     *       {@link Locale#US} as an approximation of "unlocalized" strings.</li>
+     *   <li>If no English string was found, then this method looks for a string for the
      *       {@linkplain Locale#getDefault() system default locale}.</li>
      *   <li>If none of the above steps found a string, then this method returns
      *       an arbitrary string.</li>
      * </ul>
      *
-     * @param  locale The locale to look for, or {@code null}.
-     * @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 given locale if available, or in an
+     *         implementation-dependent fallback locale otherwise.
      */
     @Override
     public synchronized String toString(final Locale locale) {
         String text = getString(locale);
         if (text == null) {
             /*
-             * No string for the requested locale. Try the string in the 'null' locale first, then
-             * the string in the system-default last.  Note: in a previous version we were looking
-             * for the system default first, but it produced unexpected results in many cases. The
-             * i18n string is often constructed with an English sentence for the "null" locale (the
-             * unlocalized text) without explicit entry for the English locale since the "null" one
-             * is supposed to be the default according javadoc. If we were looking for the default
-             * locale on a system having French as the default, the effect would be to return a
-             * sentence in French when the user asked for a sentence in English (or any language
-             * not explicitly declared). Generally the "unlocalized" text is in English, so it is
-             * a better bet as a fallback.
+             * No localized string for the requested locale.
+             * Try fallbacks in the following order:
+             *
+             *  1) Locale.ROOT
+             *  2) Locale.US, as an approximation of "unlocalized" strings.
+             *  3) Locale.getDefault()
+             *
+             * Locale.getDefault() must be last because the i18n string is often constructed with
+             * an English sentence for the 'ROOT' locale (the unlocalized text), without explicit
+             * entry for the English locale since the 'ROOT' locale is the fallback. If we were
+             * looking for the default locale first on a system having French as the default locale,
+             * we would get a sentence in French when the user asked for a sentence in English or
+             * any language not explicitly declared.
              */
-            text = localeMap.get(null);
+            text = localeMap.get(Locale.ROOT);
             if (text == null) {
-                Locale def = Locale.US; // The default language for "unlocalized" string.
-                if (locale != def) { // Avoid requesting the same locale twice (optimization).
-                    text = getString(def);
+                Locale fallback = Locale.US; // The fallback language for "unlocalized" string.
+                if (fallback != locale) { // Avoid requesting the same locale twice (optimization).
+                    text = getString(fallback);
                     if (text != null) {
                         return text;
                     }
                 }
-                def = Locale.getDefault();
-                if (locale != def && def != Locale.US) {
-                    text = getString(def);
+                fallback = Locale.getDefault();
+                if (fallback != locale && fallback != Locale.US) {
+                    text = getString(fallback);
                     if (text != null) {
                         return text;
                     }

Modified: sis/trunk/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultLocalName.java
URL: http://svn.apache.org/viewvc/sis/trunk/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultLocalName.java?rev=1445247&r1=1445246&r2=1445247&view=diff
==============================================================================
--- sis/trunk/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultLocalName.java (original)
+++ sis/trunk/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultLocalName.java Tue Feb 12 16:36:05 2013
@@ -18,6 +18,7 @@ package org.apache.sis.util.iso;
 
 import java.util.List;
 import java.util.Collections;
+import java.util.Locale;
 import java.io.ObjectStreamException;
 import javax.xml.bind.annotation.XmlElement;
 import javax.xml.bind.annotation.XmlRootElement;
@@ -89,7 +90,7 @@ public class DefaultLocalName extends Ab
     /**
      * Constructs a local name from the given character sequence.
      * If the character sequence is an instance of {@link InternationalString},
-     * then its {@link InternationalString#toString(java.util.Locale) toString(null)}
+     * then its {@link InternationalString#toString(java.util.Locale) toString(Locale.ROOT)}
      * method will be invoked for fetching an unlocalized name.
      * Otherwise the {@link CharSequence#toString()} method will be used.
      *
@@ -182,13 +183,12 @@ public class DefaultLocalName extends Ab
     public synchronized String toString() {
         if (asString == null) {
             if (name instanceof InternationalString) {
-                // We really want the 'null' locale, not the system default one.
-                asString = ((InternationalString) name).toString(null);
+                asString = ((InternationalString) name).toString(Locale.ROOT);
             } else {
                 asString = name.toString();
             }
         } else if (asString instanceof InternationalString) {
-            return ((InternationalString) asString).toString(null);
+            return ((InternationalString) asString).toString(Locale.ROOT);
         }
         return asString.toString();
     }

Modified: sis/trunk/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultNameSpace.java
URL: http://svn.apache.org/viewvc/sis/trunk/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultNameSpace.java?rev=1445247&r1=1445246&r2=1445247&view=diff
==============================================================================
--- sis/trunk/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultNameSpace.java (original)
+++ sis/trunk/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultNameSpace.java Tue Feb 12 16:36:05 2013
@@ -19,6 +19,7 @@ package org.apache.sis.util.iso;
 import java.util.Map;
 import java.util.List;
 import java.util.ListIterator;
+import java.util.Locale;
 import java.io.Serializable;
 import java.io.ObjectStreamException;
 import net.jcip.annotations.Immutable;
@@ -344,7 +345,7 @@ public class DefaultNameSpace implements
      */
     private static String key(final CharSequence name) {
         return (name instanceof InternationalString) ?
-                ((InternationalString) name).toString(null) : name.toString();
+                ((InternationalString) name).toString(Locale.ROOT) : name.toString();
     }
 
     /**

Modified: sis/trunk/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultScopedName.java
URL: http://svn.apache.org/viewvc/sis/trunk/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultScopedName.java?rev=1445247&r1=1445246&r2=1445247&view=diff
==============================================================================
--- sis/trunk/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultScopedName.java (original)
+++ sis/trunk/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultScopedName.java Tue Feb 12 16:36:05 2013
@@ -103,8 +103,8 @@ public class DefaultScopedName extends A
     /**
      * Constructs a scoped name from the specified list of strings.
      * If any of the given names is an instance of {@link InternationalString}, then its
-     * {@link InternationalString#toString(java.util.Locale) toString(null)} method will
-     * be invoked for fetching an unlocalized name.
+     * {@link InternationalString#toString(java.util.Locale) toString(Locale.ROOT)}
+     * method will be invoked for fetching an unlocalized name.
      * Otherwise the {@link CharSequence#toString()} method will be used.
      *
      * @param scope The scope of this name, or {@code null} for the global scope.

Modified: sis/trunk/sis-utility/src/main/java/org/apache/sis/util/iso/ResourceInternationalString.java
URL: http://svn.apache.org/viewvc/sis/trunk/sis-utility/src/main/java/org/apache/sis/util/iso/ResourceInternationalString.java?rev=1445247&r1=1445246&r2=1445247&view=diff
==============================================================================
--- sis/trunk/sis-utility/src/main/java/org/apache/sis/util/iso/ResourceInternationalString.java (original)
+++ sis/trunk/sis-utility/src/main/java/org/apache/sis/util/iso/ResourceInternationalString.java Tue Feb 12 16:36:05 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/trunk/sis-utility/src/main/java/org/apache/sis/util/iso/Types.java
URL: http://svn.apache.org/viewvc/sis/trunk/sis-utility/src/main/java/org/apache/sis/util/iso/Types.java?rev=1445247&r1=1445246&r2=1445247&view=diff
==============================================================================
--- sis/trunk/sis-utility/src/main/java/org/apache/sis/util/iso/Types.java (original)
+++ sis/trunk/sis-utility/src/main/java/org/apache/sis/util/iso/Types.java Tue Feb 12 16:36:05 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/trunk/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.java
URL: http://svn.apache.org/viewvc/sis/trunk/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.java?rev=1445247&r1=1445246&r2=1445247&view=diff
==============================================================================
--- sis/trunk/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.java (original)
+++ sis/trunk/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.java Tue Feb 12 16:36:05 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/trunk/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.properties
URL: http://svn.apache.org/viewvc/sis/trunk/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.properties?rev=1445247&r1=1445246&r2=1445247&view=diff
==============================================================================
--- sis/trunk/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.properties (original)
+++ sis/trunk/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.properties Tue Feb 12 16:36:05 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/trunk/sis-utility/src/main/java/org/apache/sis/util/resources/Errors_fr.properties
URL: http://svn.apache.org/viewvc/sis/trunk/sis-utility/src/main/java/org/apache/sis/util/resources/Errors_fr.properties?rev=1445247&r1=1445246&r2=1445247&view=diff
==============================================================================
--- sis/trunk/sis-utility/src/main/java/org/apache/sis/util/resources/Errors_fr.properties (original)
+++ sis/trunk/sis-utility/src/main/java/org/apache/sis/util/resources/Errors_fr.properties Tue Feb 12 16:36:05 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.



Mime
View raw message