sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1480602 [10/15] - in /sis/branches/Android: ./ ide-project/ ide-project/NetBeans/ ide-project/NetBeans/nbproject/ ide-project/eclipse/ sis-app/src/main/java/org/apache/sis/cli/ sis-build-helper/ sis-build-helper/src/main/java/org/apache/si...
Date Thu, 09 May 2013 12:24:20 GMT
Modified: sis/branches/Android/sis-utility/src/main/java/org/apache/sis/util/collection/TreeTable.java
URL: http://svn.apache.org/viewvc/sis/branches/Android/sis-utility/src/main/java/org/apache/sis/util/collection/TreeTable.java?rev=1480602&r1=1480601&r2=1480602&view=diff
==============================================================================
--- sis/branches/Android/sis-utility/src/main/java/org/apache/sis/util/collection/TreeTable.java [iso-8859-1] (original)
+++ sis/branches/Android/sis-utility/src/main/java/org/apache/sis/util/collection/TreeTable.java [UTF-8] Thu May  9 12:24:13 2013
@@ -16,6 +16,7 @@
  */
 package org.apache.sis.util.collection;
 
+import java.util.Collection;
 import java.util.List;
 
 
@@ -30,17 +31,17 @@ import java.util.List;
  *
  * {@preformat text
  *   Citation
- *   ├───Title…………………………………………………………… Open Geospatial Consortium
- *   ├───Presentation Forms………………………… document digital
- *   ├───Cited Responsible Parties
- *   │   ├───Organisation Name………………… Open Geospatial Consortium
- *   │   ├───Role…………………………………………………… resource provider
- *   │   └───Contact Info
- *   │       └───Online Resource
- *   │           ├───Linkage……………………… http://www.opengeospatial.org/
- *   │           └───Function…………………… information
- *   └───Identifiers
- *       └───Code…………………………………………………… OGC
+ *     ├─Title…………………………………………………………… Open Geospatial Consortium
+ *     ├─Presentation Forms………………………… document digital
+ *     ├─Cited Responsible Parties
+ *     │   ├─Organisation Name………………… Open Geospatial Consortium
+ *     │   ├─Role…………………………………………………… resource provider
+ *     │   └─Contact Info
+ *     │       └─Online Resource
+ *     │           ├─Linkage……………………… http://www.opengeospatial.org/
+ *     │           └─Function…………………… information
+ *     └─Identifiers
+ *         └─Code…………………………………………………… OGC
  * }
  *
  * <p>In many cases, the columns are known in advance as hard-coded static constants.
@@ -70,7 +71,7 @@ public interface TreeTable {
     /**
      * Returns the table columns, in the order they shall be rendered by default.
      * This method returns the union of all table columns in every nodes of this
-     * tree. However any {@link Node} instance can return {@code null} for a
+     * tree. However any {@link Node} instance can return {@code null} for a
      * particular column if the node doesn't have that column.
      *
      * @return The union of all table columns in every tree node.
@@ -124,10 +125,10 @@ public interface TreeTable {
         /**
          * Returns the parent node, or {@code null} if this node is the root of the tree.
          *
-         * <p>There is intentionally no {@code setParent(Node)} method, as children and parent
-         * managements are highly implementation-dependant. If the {@linkplain #getChildren()
-         * children list} is modifiable, then implementations are encouraged to update automatically
-         * the parent when a child is <em>added to</em> or <em>removed from</em> the children list.</p>
+         * <p>There is intentionally no {@code setParent(Node)} method, as children and parent managements
+         * are highly implementation-dependant. If the {@linkplain #getChildren() children collection} is
+         * modifiable, then implementations are encouraged to update automatically the parent when a child
+         * is <em>added to</em> or <em>removed from</em> that collection.</p>
          *
          * @return The parent, or {@code null} if none.
          * @category tree
@@ -135,9 +136,21 @@ public interface TreeTable {
         Node getParent();
 
         /**
-         * Returns the children of this node. The returned list may or may not be modifiable, at
-         * implementation choice. If the list is modifiable, then it shall be <cite>live</cite>,
-         * i.e. any modification to the returned list are reflected immediately in the tree.
+         * Returns {@code true} if this node can not have any children. The {@linkplain #getChildren() children
+         * collection} of a leaf node can only be empty, and adding {@linkplain #newChild() new child}
+         * is an unsupported operation.
+         *
+         * <p>This value is provided as a tip for graphical user interfaces, in order to determine if
+         * a node is expandable (even if empty). {@link TreeTableFormat} does not use this value.</p>
+         *
+         * @return {@code true} if this node can not have any children.
+         */
+        boolean isLeaf();
+
+        /**
+         * Returns the children of this node. The returned collection may or may not be modifiable, at
+         * implementation choice. If the collection is modifiable, then it shall be <cite>live</cite>,
+         * i.e. any modification to the returned collection are reflected immediately in the tree.
          * This allows addition or removal of child nodes as below:
          *
          * {@preformat java
@@ -145,23 +158,28 @@ public interface TreeTable {
          *     parent.getChildren().add(newNode);
          * }
          *
-         * @return The children, or an empty list if none.
+         * The collection is often a {@link List}, but not necessarily. For some implementations like the
+         * {@linkplain org.apache.sis.metadata.AbstractMetadata#asTreeTable() metadata tree table view},
+         * compliance to the {@code List} contract is impractical or inefficient.
+         *
+         * @return The children, or an empty collection if none.
          * @category tree
          */
-        List<Node> getChildren();
+        Collection<Node> getChildren();
 
         /**
-         * Creates a new child with the same columns than the other children, and add it to
-         * the {@linkplain #getChildren() children list}. The new child is typically added at
-         * the end of the list, but this is not mandatory: implementations can add the child
+         * Creates a new child with the same columns than the other children, and adds it to
+         * the {@linkplain #getChildren() children collection}. The new child is typically added at
+         * the end of the collection, but this is not mandatory: implementations can add the child
          * at whatever position they see fit.
          *
          * @return The new child.
+         * @throws UnsupportedOperationException If this node can not add new children.
          */
-        Node newChild();
+        Node newChild() throws UnsupportedOperationException;
 
         /**
-         * Returns the value in the given column, or {@code null} if none.
+         * Returns the value in the given column, or {@code null} if none.
          *
          * @param  <V>    The base type of values in the given column.
          * @param  column Identifier of the column from which to get the value.
@@ -187,7 +205,7 @@ public interface TreeTable {
          * @see #isEditable(TableColumn)
          * @category table
          */
-        <V> void setValue(TableColumn<V> column, V value);
+        <V> void setValue(TableColumn<V> column, V value) throws IllegalArgumentException, UnsupportedOperationException;
 
         /**
          * Determines whether the value in the specified column is editable. If the given

Propchange: sis/branches/Android/sis-utility/src/main/java/org/apache/sis/util/collection/TreeTable.java
------------------------------------------------------------------------------
--- svn:mime-type (original)
+++ svn:mime-type Thu May  9 12:24:13 2013
@@ -1 +1 @@
-text/plain
+text/plain;charset=UTF-8

Modified: sis/branches/Android/sis-utility/src/main/java/org/apache/sis/util/collection/TreeTableFormat.java
URL: http://svn.apache.org/viewvc/sis/branches/Android/sis-utility/src/main/java/org/apache/sis/util/collection/TreeTableFormat.java?rev=1480602&r1=1480601&r2=1480602&view=diff
==============================================================================
--- sis/branches/Android/sis-utility/src/main/java/org/apache/sis/util/collection/TreeTableFormat.java [iso-8859-1] (original)
+++ sis/branches/Android/sis-utility/src/main/java/org/apache/sis/util/collection/TreeTableFormat.java [UTF-8] Thu May  9 12:24:13 2013
@@ -17,6 +17,7 @@
 package org.apache.sis.util.collection;
 
 import java.util.Arrays;
+import java.util.Iterator;
 import java.util.Map;
 import java.util.List;
 import java.util.Locale;
@@ -27,10 +28,13 @@ import java.text.ParsePosition;
 import java.text.ParseException;
 import java.util.regex.Matcher;
 import net.jcip.annotations.NotThreadSafe;
+import org.opengis.util.CodeList;
+import org.opengis.util.InternationalString;
 import org.apache.sis.io.LineAppender;
 import org.apache.sis.io.TableAppender;
 import org.apache.sis.io.TabularFormat;
 import org.apache.sis.io.CompoundFormat;
+import org.apache.sis.util.iso.Types;
 import org.apache.sis.util.Workaround;
 import org.apache.sis.util.CharSequences;
 import org.apache.sis.util.ArgumentChecks;
@@ -40,31 +44,31 @@ import org.apache.sis.internal.util.Loca
 import static org.apache.sis.util.Characters.NO_BREAK_SPACE;
 
 // Related to JDK7
-import org.apache.sis.internal.util.JDK7;
+import org.apache.sis.internal.jdk7.JDK7;
 
 
 /**
  * A parser and formatter for {@link TreeTable} instances.
  * This formatter is given an arbitrary number of {@link TableColumn}s
  * to use during the formatting. The first column is taken as the node label.
- * If a {@code TreeTable} is formatted with only that column,
+ * If a {@code TreeTable} is formatted with only that column,
  * then the {@link String} result is like the following example:
  *
  * {@preformat text
  *   Node #1
- *   ├───Node #2
- *   │   └───Node #4
- *   └───Node #3
+ *     ├─Node #2
+ *     │   └─Node #4
+ *     └─Node #3
  * }
  *
- * If the same {@code TreeTable} is formatted with two columns,
+ * If the same {@code TreeTable} is formatted with two columns,
  * then the {@link String} result is like the following example:
  *
  * {@preformat text
- *   Node #1……………………… More #1
- *   ├───Node #2…………… More #2
- *   │   └───Node #4… More #4
- *   └───Node #3…………… More #3
+ *   Node #1……………………… More #1
+ *     ├─Node #2…………… More #2
+ *     │   └─Node #4… More #4
+ *     └─Node #3…………… More #3
  * }
  *
  * This representation can be printed to the {@linkplain java.io.Console#writer() console output}
@@ -75,8 +79,8 @@ import org.apache.sis.internal.util.JDK7
  * below nodes) can be modified by calls to the setter methods defined in this formatter.
  * In particular, the dots joining the node labels to their values can be specified by the
  * {@linkplain #setColumnSeparatorPattern(String) column separator pattern}.
- * The default pattern is {@code "?……[…] "}, which means "<cite>If the next value is non-null,
- * then insert the {@code "……"} string, repeat the {@code '…'} character as many time as needed
+ * The default pattern is {@code "?……[…] "}, which means "<cite>If the next value is non-null,
+ * then insert the {@code "……"} string, repeat the {@code '…'} character as many time as needed
  * (may be zero), and finally insert a space</cite>".
  *
  * @author  Martin Desruisseaux (IRD, Geomatys)
@@ -89,7 +93,7 @@ public class TreeTableFormat extends Tab
     /**
      * For cross-version compatibility.
      */
-    private static final long serialVersionUID = -4476366905386037025L;
+    private static final long serialVersionUID = 147992015470098561L;
 
     /**
      * Shared {@code TreeTableFormat} instance for {@link TreeTable#toString()} implementation.
@@ -118,7 +122,7 @@ public class TreeTableFormat extends Tab
 
     /**
      * The position of the vertical line, relative to the position of the label of the parent node.
-     * The default value is 0, which means that the vertical line is drawn below the first letter
+     * The default value is 2, which means that the vertical line is drawn below the third letter
      * of the node label.
      *
      * @see #getVerticalLinePosition()
@@ -131,10 +135,10 @@ public class TreeTableFormat extends Tab
      * The default symbols are as below:
      *
      * <ul>
-     *   <li>{@code treeBlank} = {@code "    "}</li>
-     *   <li>{@code treeLine}  = {@code "│   "}</li>
-     *   <li>{@code treeCross} = {@code "├───"}</li>
-     *   <li>{@code treeEnd}   = {@code "└───"}</li>
+     *   <li>{@code treeBlank} = {@code "    "}</li>
+     *   <li>{@code treeLine}  = {@code "  │ "}</li>
+     *   <li>{@code treeCross} = {@code "  ├─"}</li>
+     *   <li>{@code treeEnd}   = {@code "  └─"}</li>
      * </ul>
      *
      * @see #clearTreeSymbols()
@@ -145,15 +149,17 @@ 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) {
         super(locale, timezone);
-        indentation       = 4;
-        beforeFill        = "……";
-        fillCharacter     = '…';
-        omitTrailingNulls = true;
+        indentation          = 4;
+        verticalLinePosition = 2;
+        beforeFill           = "……";
+        fillCharacter        = '…';
+        omitTrailingNulls    = true;
     }
 
     /**
@@ -240,7 +246,7 @@ public class TreeTableFormat extends Tab
 
     /**
      * Returns the position of the vertical line, relative to the position of the root label.
-     * The default value is 0, which means that the vertical line is drawn below the first
+     * The default value is 2, which means that the vertical line is drawn below the third
      * letter of the root label.
      *
      * @return The current vertical line position.
@@ -289,14 +295,14 @@ public class TreeTableFormat extends Tab
     /**
      * Creates a tree from the given character sequence,
      * or returns {@code null} if an error occurred while parsing the characters.
-     * This method can parse the trees created by the {@code format(…)} methods
+     * This method can parse the trees created by the {@code format(…)} methods
      * defined in this class.
      *
      * {@section Parsing rules}
      * <ul>
      *   <li>Each node shall be represented by a single line made of two parts, in that order:
      *     <ol>
-     *       <li>white spaces and tree drawing characters ({@code '│'}, {@code '├'}, {@code '└'} or {@code '─'});</li>
+     *       <li>white spaces and tree drawing characters ({@code '│'}, {@code '├'}, {@code '└'} or {@code '─'});</li>
      *       <li>string representations of node values, separated by the
      *           {@linkplain #getColumnSeparatorPattern() colunm separator}.</li>
      *     </ol>
@@ -334,7 +340,7 @@ public class TreeTableFormat extends Tab
                 endOfLine--; // Skip trailing '\r' and '\n'.
             }
             /*
-             * Skip leading spaces using Character.isSpaceChar(…) instead than isWhitespace(…)
+             * Skip leading spaces using Character.isSpaceChar(…) instead than isWhitespace(…)
              * because we need to skip non-breaking spaces as well as ordinary space. We don't
              * need to consider line feeds since they were handled by the lines just above.
              */
@@ -344,7 +350,7 @@ public class TreeTableFormat extends Tab
                 final int c = Character.codePointAt(text, i);
                 if (!Character.isSpaceChar(c)) {
                     hasChar = true;
-                    if ("─│└├".indexOf(c) < 0) {
+                    if ("─│└├".indexOf(c) < 0) {
                         break;
                     }
                 }
@@ -354,7 +360,7 @@ public class TreeTableFormat extends Tab
                 break; // The line contains only whitespaces.
             }
             /*
-             * Go back to the fist non-space character (should be '─'). We do that in case the
+             * Go back to the fist non-space character (should be '─'). We do that in case the
              * user puts some spaces in the text of the node label, since we don't want those
              * user-spaces to interfer with the calculation of indentation.
              */
@@ -479,12 +485,12 @@ public class TreeTableFormat extends Tab
             final char vc, hc;
             if ((k & 2) == 0) {
                 // No horizontal line
-                vc = (k & 1) == 0 ? NO_BREAK_SPACE : '│';
+                vc = (k & 1) == 0 ? NO_BREAK_SPACE : '│';
                 hc = NO_BREAK_SPACE;
             } else {
                 // With a horizontal line
-                vc = (k & 1) == 0 ? '└' : '├';
-                hc = '─';
+                vc = (k & 1) == 0 ? '└' : '├';
+                hc = '─';
             }
             Arrays.fill(buffer, 0, verticalLinePosition, NO_BREAK_SPACE);
             buffer[verticalLinePosition] = vc;
@@ -560,7 +566,7 @@ public class TreeTableFormat extends Tab
             this.values  = new Object[columns.length];
             this.isLast  = new boolean[8];
             setTabulationExpanded(true);
-            setLineSeparator(" ¶ ");
+            setLineSeparator(" ¶ ");
         }
 
         /**
@@ -579,6 +585,12 @@ public class TreeTableFormat extends Tab
                     return;
                 }
                 text = format.format(value);
+            } else if (value instanceof InternationalString) {
+                text = ((InternationalString) value).toString(locale);
+            } else if (value instanceof CodeList<?>) {
+                text = Types.getCodeTitle((CodeList<?>) value).toString(locale);
+            } else if (value instanceof Enum<?>) {
+                text = CharSequences.upperCaseToSentence(((Enum<?>) value).name());
             } else {
                 text = String.valueOf(value);
             }
@@ -624,11 +636,13 @@ public class TreeTableFormat extends Tab
             if (level >= isLast.length) {
                 isLast = Arrays.copyOf(isLast, level*2);
             }
-            final List<? extends TreeTable.Node> children = node.getChildren();
-            final int count = children.size();
-            for (int i=0; i<count; i++) {
-                isLast[level] = (i == count-1);
-                format(children.get(i), level+1);
+            final Iterator<? extends TreeTable.Node> it = node.getChildren().iterator();
+            boolean hasNext = it.hasNext();
+            while (hasNext) {
+                final TreeTable.Node child = it.next();
+                hasNext = it.hasNext();
+                isLast[level] = !hasNext; // Must be set before the call to 'format' below.
+                format(child, level+1);
             }
         }
     }

Propchange: sis/branches/Android/sis-utility/src/main/java/org/apache/sis/util/collection/TreeTableFormat.java
------------------------------------------------------------------------------
--- svn:mime-type (original)
+++ svn:mime-type Thu May  9 12:24:13 2013
@@ -1 +1 @@
-text/plain
+text/plain;charset=UTF-8

Modified: sis/branches/Android/sis-utility/src/main/java/org/apache/sis/util/collection/TreeTables.java
URL: http://svn.apache.org/viewvc/sis/branches/Android/sis-utility/src/main/java/org/apache/sis/util/collection/TreeTables.java?rev=1480602&r1=1480601&r2=1480602&view=diff
==============================================================================
--- sis/branches/Android/sis-utility/src/main/java/org/apache/sis/util/collection/TreeTables.java [iso-8859-1] (original)
+++ sis/branches/Android/sis-utility/src/main/java/org/apache/sis/util/collection/TreeTables.java [UTF-8] Thu May  9 12:24:13 2013
@@ -24,11 +24,9 @@ import java.io.File;
 import java.text.ParseException;
 import org.opengis.util.InternationalString;
 import org.apache.sis.util.Static;
+import org.apache.sis.util.ArraysExt;
 import org.apache.sis.util.ArgumentChecks;
 
-import static org.apache.sis.util.Arrays.resize;
-import static org.apache.sis.util.Arrays.insert;
-
 
 /**
  * Static methods working on {@link TreeTable} objects and their nodes.
@@ -39,66 +37,71 @@ import static org.apache.sis.util.Arrays
  * Developers can copy and adapt those examples as they see fit.</p>
  *
  * {@section Example 1: Reduce the depth of a tree}
- * For every branch containing only one child and no value, the following method merges in-place
- * that branch and the node together. This method can be used for simplifying depth trees into
- * something less verbose. However for any column other than {@code NAME}, this method preserves
- * the values of the child node but lost all value of the parent node. For this reason, we perform
- * the merge only if the parent has no value.
- *
- * <p>For example given the tree on the left side, this method transforms it into the tree on the
- * right side:</p>
- *
- * <table class="compact"><tr><td>
+ * For every branch containing exactly one child, the following method concatenates in-place
+ * that branch and its child together. This method can be used for simplifying depth trees into
+ * something less verbose. For example given the tree on the left side, this method transforms
+ * it into the tree on the right side:
+ *
+ * <table class="sis">
+ * <tr><th>Before</th><th class="sep">After</th></tr>
+ * <tr><td>
  * {@preformat text
  *   root
- *   ├───users
- *   │   └───alice
- *   │       ├───data
- *   │       │   └───mercator
- *   │       └───document
- *   └───lib
+ *     ├─users
+ *     │   └─alice
+ *     │       ├─data
+ *     │       │   └─mercator
+ *     │       └─document
+ *     └─lib
  * }
- * </td><td>
+ * </td><td class="sep">
  * {@preformat text
  *   root
- *   ├───users/alice
- *   │   ├───data/mercator
- *   │   └───document
- *   └───lib
+ *     ├─users/alice
+ *     │   ├─data/mercator
+ *     │   └─document
+ *     └─lib
  * }
  * </td></tr></table>
+ * There is no pre-defined method for this task because there is too many parameters that
+ * developers may want to customize (columns to merge, conditions for accepting the merge,
+ * kind of objects to merge, name separator, <i>etc.</i>). In the following code snippet,
+ * the content of the {@code NAME} columns are concatenated only if the {@code VALUE} column
+ * has no value (for avoiding data lost when the node is discarded) and use the system file
+ * separator as name separator:
+ *
  * {@preformat java
- *   import static org.apache.sis.util.collection.TableColumn.NAME;          // The column to merge
- *   import static org.apache.sis.util.collection.TableColumn.VALUE_AS_TEXT; // The column which must be empty
+ *     final TableColumn columnToProtect = TableColumn.VALUE;
+ *     final TableColumn columnToConcatenate = TableColumn.NAME;
  *
- *   public class MyClass {
- *       private static TreeTable.Node concatenateSingletons(final TreeTable.Node node) {
- *           final List<TreeTable.Node> children = node.getChildren();
- *           final int size = children.size();
- *           for (int i=0; i<size; i++) {
- *               children.set(i, concatenateSingletons(children.get(i)));
- *           }
- *           if (size == 1) {
- *               final TreeTable.Node child = children.get(0);
- *               if (node.getValue(VALUE_AS_TEXT) == null) {
- *                   children.remove(0);
- *                   child.setValue(NAME, node.getValue(NAME) + File.separator + child.getValue(NAME));
- *                   return child;
- *               }
- *           }
- *           return node;
- *       }
- *   }
+ *     TreeTable.Node concatenateSingletons(final TreeTable.Node node) {
+ *         // This simple example is restricted to nodes which are known to handle
+ *         // their children in a list instead than some other kind of collection.
+ *         final List<TreeTable.Node> children = (List<TreeTable.Node>) node.getChildren();
+ *         final int size = children.size();
+ *         for (int i=0; i<size; i++) {
+ *             children.set(i, concatenateSingletons(children.get(i)));
+ *         }
+ *         if (size == 1) {
+ *             final TreeTable.Node child = children.get(0);
+ *             if (node.getValue(columnToProtect) == null) {
+ *                 children.remove(0);
+ *                 child.setValue(columnToConcatenate,
+ *                         node .getValue(columnToConcatenate) + File.separator +
+ *                         child.getValue(columnToConcatenate));
+ *                 return child;
+ *             }
+ *         }
+ *         return node;
+ *     }
  * }
  *
- * There is no pre-defined method for this task because there is too many parameters that
- * developers may want to customize (columns to merge, conditions for accepting the merge,
- * kind of objects to merge, name separator).
- *
  * @author  Martin Desruisseaux
  * @since   0.3
  * @version 0.3
  * @module
+ *
+ * @see TreeTable
  */
 public final class TreeTables extends Static {
     /**
@@ -110,7 +113,7 @@ public final class TreeTables extends St
     /**
      * Finds the node for the given path, or creates a new node if none exists.
      * First, this method searches in the node {@linkplain TreeTable.Node#getChildren()
-     * children list} for the root element of the given path. If no such node is found,
+     * children collection} for the root element of the given path. If no such node is found,
      * a {@linkplain TreeTable.Node#newChild() new child} is created. Then this method
      * repeats the process (searching in the children of the child for the second path
      * element), until the last path element is reached.
@@ -121,9 +124,9 @@ public final class TreeTables extends St
      *
      * {@preformat text
      *   from
-     *   └───users
-     *       └───alice
-     *           └───data
+     *     └─users
+     *         └─alice
+     *             └─data
      * }
      *
      * @param  from   The root node from which to start the search.
@@ -153,8 +156,8 @@ public final class TreeTables extends St
     }
 
     /**
-     * For every columns having values {@linkplain Class#isAssignableFrom(Class) assignable from}
-     * {@code String}, converts the values to {@code String}s. During conversions, this method also
+     * For every columns having values of type {@link CharSequence} or {@link String},
+     * converts the values to localized {@code String}s. During conversions, this method also
      * replaces duplicated {@code String} instances by references to the same singleton instance.
      *
      * <p>This method may be invoked before to serialize the table in order to reduce the
@@ -165,7 +168,7 @@ public final class TreeTables extends St
      * @return Number of replacements done.
      */
     @SuppressWarnings({"unchecked", "rawtypes"})
-    public static int valuesAsStrings(final TreeTable table, final Locale locale) {
+    public static int replaceCharSequences(final TreeTable table, final Locale locale) {
         ArgumentChecks.ensureNonNull("table", table);
         final List<TableColumn<?>> columns = table.getColumns();
         TableColumn<? super String>[] filtered = new TableColumn[columns.size()];
@@ -175,12 +178,12 @@ public final class TreeTables extends St
                 filtered[count++] = (TableColumn<? super String>) column;
             }
         }
-        filtered = resize(filtered, count);
-        return valuesAsStrings(table.getRoot(), filtered, locale, new HashMap<String,String>());
+        filtered = ArraysExt.resize(filtered, count);
+        return replaceCharSequences(table.getRoot(), filtered, locale, new HashMap<String,String>());
     }
 
     /**
-     * Implementation of the public {@link #valuesAsStrings(TreeTable, Locale)} method.
+     * Implementation of the public {@link #replaceCharSequences(TreeTable, Locale)} method.
      *
      * @param  node    The node in which to replace values by their string representations.
      * @param  columns The columns where to perform the replacements.
@@ -188,12 +191,12 @@ public final class TreeTables extends St
      * @param  pool    An initially empty pool of string representations, to be filled by this method.
      * @return Number of replacements done.
      */
-    private static int valuesAsStrings(final TreeTable.Node node, final TableColumn<? super String>[] columns,
+    private static int replaceCharSequences(final TreeTable.Node node, final TableColumn<? super String>[] columns,
             final Locale locale, final Map<String,String> pool)
     {
         int changes = 0;
         for (final TreeTable.Node child : node.getChildren()) {
-            changes += valuesAsStrings(child, columns, locale, pool);
+            changes += replaceCharSequences(child, columns, locale, pool);
         }
         for (final TableColumn<? super String> column : columns) {
             final Object value = node.getValue(column);
@@ -220,7 +223,7 @@ public final class TreeTables extends St
 
     /**
      * Returns a string representation of the given tree table.
-     * The default implementation uses a shared instance of {@link TreeTableFormat}.
+     * The current implementation uses a shared instance of {@link TreeTableFormat}.
      * This is okay for debugging or occasional usages. However for more extensive usages,
      * developers are encouraged to create and configure their own {@code TreeTableFormat}
      * instance.
@@ -240,27 +243,27 @@ public final class TreeTables extends St
      * This helper method is sometime useful for quick tests or debugging purposes.
      * For more extensive use, consider using {@link TreeTableFormat} instead.
      *
-     * @param  text   The string representation to parse.
-     * @param  nodes  The columns where to store the node labels. This is often {@link TableColumn#NAME}.
-     * @param  values Optional columns where to store the values, if any.
+     * @param  tree         The string representation of the tree to parse.
+     * @param  labelColumn  The columns where to store the node labels. This is often {@link TableColumn#NAME}.
+     * @param  otherColumns Optional columns where to store the values, if any.
      * @return A tree parsed from the given string.
      * @throws ParseException If an error occurred while parsing the tree.
      */
-    public static TreeTable parse(final String text, final TableColumn<?> nodes,
-            final TableColumn<?>... values) throws ParseException
+    public static TreeTable parse(final String tree, final TableColumn<?> labelColumn,
+            final TableColumn<?>... otherColumns) throws ParseException
     {
-        ArgumentChecks.ensureNonNull("text",  text);
-        ArgumentChecks.ensureNonNull("nodes", nodes);
+        ArgumentChecks.ensureNonNull("tree", tree);
+        ArgumentChecks.ensureNonNull("labelColumn", labelColumn);
         TableColumn<?>[] columns = null; // Default to singleton(NAME).
-        if (values.length != 0 || nodes != TableColumn.NAME) {
-            columns = insert(values, 0, 1);
-            columns[0] = nodes;
+        if (otherColumns.length != 0 || labelColumn != TableColumn.NAME) {
+            columns = ArraysExt.insert(otherColumns, 0, 1);
+            columns[0] = labelColumn;
         }
         final TreeTableFormat format = TreeTableFormat.INSTANCE;
         synchronized (format) {
             try {
                 format.setColumns(columns);
-                return format.parseObject(text);
+                return format.parseObject(tree);
             } finally {
                 format.setColumns((TableColumn<?>[]) null);
             }

Propchange: sis/branches/Android/sis-utility/src/main/java/org/apache/sis/util/collection/TreeTables.java
------------------------------------------------------------------------------
--- svn:mime-type (original)
+++ svn:mime-type Thu May  9 12:24:13 2013
@@ -1 +1 @@
-text/plain
+text/plain;charset=UTF-8

Propchange: sis/branches/Android/sis-utility/src/main/java/org/apache/sis/util/collection/WeakEntry.java
------------------------------------------------------------------------------
--- svn:mime-type (original)
+++ svn:mime-type Thu May  9 12:24:13 2013
@@ -1 +1 @@
-text/plain
+text/plain;charset=UTF-8

Modified: sis/branches/Android/sis-utility/src/main/java/org/apache/sis/util/collection/WeakHashSet.java
URL: http://svn.apache.org/viewvc/sis/branches/Android/sis-utility/src/main/java/org/apache/sis/util/collection/WeakHashSet.java?rev=1480602&r1=1480601&r2=1480602&view=diff
==============================================================================
--- sis/branches/Android/sis-utility/src/main/java/org/apache/sis/util/collection/WeakHashSet.java [iso-8859-1] (original)
+++ sis/branches/Android/sis-utility/src/main/java/org/apache/sis/util/collection/WeakHashSet.java [UTF-8] Thu May  9 12:24:13 2013
@@ -23,16 +23,16 @@ import java.lang.reflect.Array;
 import net.jcip.annotations.ThreadSafe;
 
 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 static org.apache.sis.util.Arrays.resize;
 import static org.apache.sis.util.collection.WeakEntry.*;
 
 // Related to JDK7
-import org.apache.sis.internal.util.Objects;
+import org.apache.sis.internal.jdk7.Objects;
 
 
 /**
@@ -234,7 +234,7 @@ public class WeakHashSet<E> extends Abst
      */
     @Override
     public synchronized boolean remove(final Object element) {
-        return intern(elementType.cast(element), REMOVE) != null;
+        return intern(element, REMOVE) != null;
     }
 
     /**
@@ -242,14 +242,13 @@ public class WeakHashSet<E> extends Abst
      * contain any object equals to {@code element}, then this method returns {@code null}.
      * Null values are considered never present.
      *
-     * @param  <T> The type of the element to get. Can be {@code null}.
      * @param  element The element to get.
      * @return An element equals to the given one if already presents in the set,
      *         or {@code null} otherwise.
      *
      * @see #unique(Object)
      */
-    public synchronized <T extends E> T get(final T element) {
+    public synchronized E get(final Object element) {
         return intern(element, GET);
     }
 
@@ -289,28 +288,10 @@ public class WeakHashSet<E> extends Abst
      *         or the given {@code object} otherwise.
      */
     public synchronized <T extends E> T unique(final T element) {
-        return intern(element, INTERN);
-    }
-
-    /**
-     * Iteratively call {@link #unique(Object)} for an array of objects.
-     * This method is equivalents to the following code:
-     *
-     * {@preformat java
-     *     for (int i=0; i<elements.length; i++) {
-     *         elements[i] = unique(elements[i]);
-     *     }
-     * }
-     *
-     * @param elements
-     *          On input, the objects to add to this set if not already present. On output,
-     *          elements that are equal, but where every reference to an instance already
-     *          presents in this set has been replaced by a reference to the existing instance.
-     */
-    public synchronized void uniques(final E[] elements) {
-        for (int i=0; i<elements.length; i++) {
-            elements[i] = intern(elements[i], INTERN);
-        }
+        // There is no way to make sure that this operation is really safe.
+        // We have to trust the Object.equals(Object) method to be strict
+        // about the type of compared objects.
+        return (T) intern(element, INTERN);
     }
 
     // Arguments for the {@link #intern} method.
@@ -320,23 +301,10 @@ public class WeakHashSet<E> extends Abst
     /** The "intern" operation.  */  private static final int INTERN = +2;
 
     /**
-     * Returns an object equals to {@code obj} if such an object already exist in this
-     * {@code WeakHashSet}. Otherwise, add {@code obj} to this {@code WeakHashSet}.
-     * This method is equivalents to the following code:
-     *
-     * {@preformat java
-     *     if (object!=null) {
-     *         final Object current = get(object);
-     *         if (current != null) {
-     *             return current;
-     *         } else {
-     *             add(object);
-     *         }
-     *     }
-     *     return object;
-     * }
+     * Implementation of the {@link #add(Object)}, {@link #remove(Object)}, {@link #get(Object)},
+     * {@link #contains(Object)} and {@link #intern(Object)} methods.
      */
-    private <T> T intern(final T obj, final int operation) {
+    private E intern(final Object obj, final int operation) {
         assert isValid();
         if (obj != null) {
             /*
@@ -352,10 +320,7 @@ public class WeakHashSet<E> extends Abst
                     if (operation == REMOVE) {
                         e.dispose();
                     }
-                    // There is no way to make sure that this operation is really safe.
-                    // We have to trust the Object.equals(Object) method to be strict
-                    // about the type of compared objects.
-                    return (T) candidate;
+                    return candidate;
                 }
                 // Do not remove the null element; lets ReferenceQueue do its job
                 // (it was a bug to remove element here as an "optimization")
@@ -371,11 +336,15 @@ public class WeakHashSet<E> extends Abst
                     }
                     lastTimeNormalCapacity = System.nanoTime();
                 }
-                table[index] = new Entry(elementType.cast(obj), table[index], hash);
+                final E element = elementType.cast(obj);
+                table[index] = new Entry(element, table[index], hash);
+                assert isValid();
+                if (operation == INTERN) {
+                    return element;
+                }
             }
         }
-        assert isValid();
-        return (operation == INTERN) ? obj : null;
+        return null;
     }
 
     /**
@@ -408,7 +377,7 @@ public class WeakHashSet<E> extends Abst
                 }
             }
         }
-        return resize(elements, index);
+        return ArraysExt.resize(elements, index);
     }
 
     /**

Propchange: sis/branches/Android/sis-utility/src/main/java/org/apache/sis/util/collection/WeakHashSet.java
------------------------------------------------------------------------------
--- svn:mime-type (original)
+++ svn:mime-type Thu May  9 12:24:13 2013
@@ -1 +1 @@
-text/plain
+text/plain;charset=UTF-8

Modified: sis/branches/Android/sis-utility/src/main/java/org/apache/sis/util/collection/WeakValueHashMap.java
URL: http://svn.apache.org/viewvc/sis/branches/Android/sis-utility/src/main/java/org/apache/sis/util/collection/WeakValueHashMap.java?rev=1480602&r1=1480601&r2=1480602&view=diff
==============================================================================
--- sis/branches/Android/sis-utility/src/main/java/org/apache/sis/util/collection/WeakValueHashMap.java [iso-8859-1] (original)
+++ sis/branches/Android/sis-utility/src/main/java/org/apache/sis/util/collection/WeakValueHashMap.java [UTF-8] Thu May  9 12:24:13 2013
@@ -27,16 +27,16 @@ import java.lang.ref.WeakReference;
 import net.jcip.annotations.ThreadSafe;
 
 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.Arrays.resize;
 import static org.apache.sis.util.collection.WeakEntry.*;
 
 // Related to JDK7
-import org.apache.sis.internal.util.Objects;
+import org.apache.sis.internal.jdk7.Objects;
 
 
 /**
@@ -340,12 +340,9 @@ public class WeakValueHashMap<K,V> exten
 
     /**
      * Implementation of {@link #put(Object, Object)} and {@link #remove(Object)} operations
-     *
-     * @param putIfAbsent If {@code true} and a value is found for the given key,
-     *        returns the old value without modifying the map.
      */
     @SuppressWarnings("unchecked")
-    private synchronized V intern(final Object key, final V value, final boolean putIfAbsent) {
+    private synchronized V intern(final Object key, final V value) {
         assert isValid();
         /*
          * If 'value' is already contained in this WeakValueHashMap, we need to clear it.
@@ -357,9 +354,6 @@ public class WeakValueHashMap<K,V> exten
         for (Entry e = table[index]; e != null; e = (Entry) e.next) {
             if (keyEquals(key, e.key)) {
                 oldValue = e.get();
-                if (putIfAbsent) {
-                    return oldValue;
-                }
                 e.dispose();
                 table = this.table; // May have changed.
                 index = hash % table.length;
@@ -392,27 +386,11 @@ 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);
-        return intern(key, value, false);
-    }
-
-    /**
-     * Associates the specified value with the specified key only if no value is currently
-     * associated to that key. If a value already exists for the given key, then this method
-     * returns the current value without changing the map.
-     *
-     * @param  key key with which the specified value is to be associated.
-     * @param  value value to be associated with the specified key.
-     * @return {@code null} if the given value has been associated to the given key,
-     *         or the current (unchanged) value if a mapping already exists for that key.
-     *
-     * @throws NullArgumentException if the key or the value is {@code null}.
-     */
-    public V putIfAbsent(final K key, final V value) throws NullArgumentException {
-        ArgumentChecks.ensureNonNull("key",   key);
-        ArgumentChecks.ensureNonNull("value", value);
-        return intern(key, value, true);
+        if (key == null || value == null) {
+            throw new NullArgumentException(Errors.format(key == null
+                    ? Errors.Keys.NullMapKey : Errors.Keys.NullMapValue));
+        }
+        return intern(key, value);
     }
 
     /**
@@ -424,7 +402,7 @@ public class WeakValueHashMap<K,V> exten
      */
     @Override
     public V remove(final Object key) {
-        return intern(key, null, false);
+        return intern(key, null);
     }
 
     /**
@@ -489,7 +467,7 @@ public class WeakValueHashMap<K,V> exten
                         }
                     }
                 }
-                return resize(elements, index);
+                return ArraysExt.resize(elements, index);
             }
         }
 

Propchange: sis/branches/Android/sis-utility/src/main/java/org/apache/sis/util/collection/WeakValueHashMap.java
------------------------------------------------------------------------------
--- svn:mime-type (original)
+++ svn:mime-type Thu May  9 12:24:13 2013
@@ -1 +1 @@
-text/plain
+text/plain;charset=UTF-8

Modified: sis/branches/Android/sis-utility/src/main/java/org/apache/sis/util/collection/package-info.java
URL: http://svn.apache.org/viewvc/sis/branches/Android/sis-utility/src/main/java/org/apache/sis/util/collection/package-info.java?rev=1480602&r1=1480601&r2=1480602&view=diff
==============================================================================
--- sis/branches/Android/sis-utility/src/main/java/org/apache/sis/util/collection/package-info.java [iso-8859-1] (original)
+++ sis/branches/Android/sis-utility/src/main/java/org/apache/sis/util/collection/package-info.java [UTF-8] Thu May  9 12:24:13 2013
@@ -34,22 +34,13 @@
  *     and supports concurrency, while the other implementations are more lightweight, sometime
  *     thread-safe but without concurrency support.
  *   </li><li>
- *     {@link org.apache.sis.util.collection.CheckedContainer},
- *     {@link org.apache.sis.util.collection.CheckedArrayList},
- *     {@link org.apache.sis.util.collection.CheckedHashSet} and
- *     {@link org.apache.sis.util.collection.CheckedHashMap} can be used for combining <em>runtime</em>
- *     type safety with thread-safety (without concurrency). They are similar in functionalities to
- *     the wrappers provided by the standard {@link java.util.Collections} methods, except that they
- *     combine both functionalities in a single class (so reducing the amount of indirection), provide
- *     a hook for making the collections read-only and allow the caller to specify the synchronization
- *     lock of his choice.
- *   </li><li>
- *     {@linkplain org.apache.sis.util.collection.Collections#derivedMap Derived Map} and
- *     {@linkplain org.apache.sis.util.collection.Collections#derivedSet derived Set} are wrapper collections
+ *     {@linkplain org.apache.sis.util.collection.Containers#derivedMap Derived Map} and
+ *     {@linkplain org.apache.sis.util.collection.Containers#derivedSet derived Set} are wrapper collections
  *     in which the keys or the values are derived on-the-fly from the content of an other collection.
  *     The can also be used for creating filtered views.
  *   </li><li>
- *     {@link org.apache.sis.util.collection.IntegerList} and
+ *     {@link org.apache.sis.util.collection.IntegerList},
+ *     {@link org.apache.sis.util.collection.CodeListSet} and
  *     {@link org.apache.sis.util.collection.RangeSet} are collections specialized for a particular kind
  *     of content, providing more efficient storage than what we would get with the general-purpose
  *     collection implementations.

Propchange: sis/branches/Android/sis-utility/src/main/java/org/apache/sis/util/collection/package-info.java
------------------------------------------------------------------------------
--- svn:mime-type (original)
+++ svn:mime-type Thu May  9 12:24:13 2013
@@ -1 +1 @@
-text/plain
+text/plain;charset=UTF-8

Propchange: sis/branches/Android/sis-utility/src/main/java/org/apache/sis/util/iso/AbstractFactory.java
------------------------------------------------------------------------------
--- svn:mime-type (original)
+++ svn:mime-type Thu May  9 12:24:13 2013
@@ -1 +1 @@
-text/plain
+text/plain;charset=UTF-8

Modified: sis/branches/Android/sis-utility/src/main/java/org/apache/sis/util/iso/AbstractInternationalString.java
URL: http://svn.apache.org/viewvc/sis/branches/Android/sis-utility/src/main/java/org/apache/sis/util/iso/AbstractInternationalString.java?rev=1480602&r1=1480601&r2=1480602&view=diff
==============================================================================
--- sis/branches/Android/sis-utility/src/main/java/org/apache/sis/util/iso/AbstractInternationalString.java [iso-8859-1] (original)
+++ sis/branches/Android/sis-utility/src/main/java/org/apache/sis/util/iso/AbstractInternationalString.java [UTF-8] Thu May  9 12:24:13 2013
@@ -22,6 +22,7 @@ import java.util.Formattable;
 import java.util.FormattableFlags;
 import org.opengis.util.InternationalString;
 import org.apache.sis.internal.util.Utilities;
+import org.apache.sis.util.CharSequences;
 
 
 /**
@@ -44,12 +45,16 @@ 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>
+     *
+     * {@section Thread safety}
+     * For thread safety this field shall either be read and written in a synchronized block,
+     * or be fixed at construction time and never changed after than point. All other usages
+     * are prohibited.
+     *
+     * {@section Serialization}
      * 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>
-     * This field is read and written by {@link SimpleInternationalString}.
      */
     transient String defaultValue;
 
@@ -67,15 +72,7 @@ public abstract class AbstractInternatio
      */
     @Override
     public int length() {
-        String text = defaultValue;
-        if (text == null) {
-            text = toString();
-            if (text == null) {
-                return 0;
-            }
-            defaultValue = text;
-        }
-        return text.length();
+        return CharSequences.length(toString());
     }
 
     /**
@@ -88,15 +85,7 @@ public abstract class AbstractInternatio
      */
     @Override
     public char charAt(final int index) throws IndexOutOfBoundsException {
-        String text = defaultValue;
-        if (text == null) {
-            text = toString();
-            if (text == null) {
-                throw new StringIndexOutOfBoundsException();
-            }
-            defaultValue = text;
-        }
-        return text.charAt(index);
+        return toString().charAt(index);
     }
 
     /**
@@ -111,31 +100,38 @@ public abstract class AbstractInternatio
      */
     @Override
     public CharSequence subSequence(final int start, final int end) {
-        String text = defaultValue;
-        if (text == null) {
-            text = toString();
-            if (text == null) {
-                if (start == 0 && end == 0) {
-                    return "";
-                }
-                throw new StringIndexOutOfBoundsException();
-            }
-            defaultValue = text;
-        }
-        return text.substring(start, end);
+        return toString().substring(start, end);
     }
 
     /**
      * 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
@@ -147,7 +143,7 @@ public abstract class AbstractInternatio
      * @return The string in the default locale.
      */
     @Override
-    public String toString() {
+    public synchronized String toString() {
         String text = defaultValue;
         if (text == null) {
             text = toString(Locale.getDefault());
@@ -174,28 +170,8 @@ public abstract class AbstractInternatio
      *                  or -1 for no restriction.
      */
     @Override
-    public void formatTo(final Formatter formatter, int flags, final int width, int precision) {
-        final Locale locale = formatter.locale();
-        String value = toString(locale);
-        if (precision >= 0) {
-            if ((flags & FormattableFlags.UPPERCASE) != 0) {
-                value = value.toUpperCase(locale); // May change the length in some locales.
-                flags &= ~FormattableFlags.UPPERCASE;
-            }
-            final int length = value.length();
-            if (precision < length) {
-                try {
-                    precision = value.offsetByCodePoints(0, precision);
-                } catch (IndexOutOfBoundsException e) {
-                    precision = length;
-                    // Happen if the string has fewer code-points than 'precision'. We could
-                    // avoid the try-catch block by checking value.codePointCount(…), but it
-                    // would result in scanning the string twice.
-                }
-                value = value.substring(0, precision);
-            }
-        }
-        Utilities.formatTo(formatter, flags, width, value);
+    public void formatTo(final Formatter formatter, final int flags, final int width, final int precision) {
+        Utilities.formatTo(formatter, flags, width, precision, toString(formatter.locale()));
     }
 
     /**

Propchange: sis/branches/Android/sis-utility/src/main/java/org/apache/sis/util/iso/AbstractInternationalString.java
------------------------------------------------------------------------------
--- svn:mime-type (original)
+++ svn:mime-type Thu May  9 12:24:13 2013
@@ -1 +1 @@
-text/plain
+text/plain;charset=UTF-8

Modified: sis/branches/Android/sis-utility/src/main/java/org/apache/sis/util/iso/AbstractName.java
URL: http://svn.apache.org/viewvc/sis/branches/Android/sis-utility/src/main/java/org/apache/sis/util/iso/AbstractName.java?rev=1480602&r1=1480601&r2=1480602&view=diff
==============================================================================
--- sis/branches/Android/sis-utility/src/main/java/org/apache/sis/util/iso/AbstractName.java [iso-8859-1] (original)
+++ sis/branches/Android/sis-utility/src/main/java/org/apache/sis/util/iso/AbstractName.java [UTF-8] Thu May  9 12:24:13 2013
@@ -30,7 +30,7 @@ import org.opengis.util.InternationalStr
 import org.apache.sis.util.resources.Errors;
 
 // Related to JDK7
-import org.apache.sis.internal.util.Objects;
+import org.apache.sis.internal.jdk7.Objects;
 
 
 /**
@@ -61,7 +61,7 @@ public abstract class AbstractName imple
     /**
      * Serial number for inter-operability with different versions.
      */
-    private static final long serialVersionUID = 3362498790089164525L;
+    private static final long serialVersionUID = 667242702456713391L;
 
     /**
      * A view of this name as a fully-qualified one.
@@ -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();
     }
@@ -268,7 +268,7 @@ public abstract class AbstractName imple
         /**
          * Serial number for inter-operability with different versions.
          */
-        private static final long serialVersionUID = -6422809765366372062L;
+        private static final long serialVersionUID = -5259001179796274879L;
 
         /**
          * The sequence of {@linkplain DefaultLocalName local names} making this generic name.

Propchange: sis/branches/Android/sis-utility/src/main/java/org/apache/sis/util/iso/AbstractName.java
------------------------------------------------------------------------------
--- svn:mime-type (original)
+++ svn:mime-type Thu May  9 12:24:13 2013
@@ -1 +1 @@
-text/plain
+text/plain;charset=UTF-8

Propchange: sis/branches/Android/sis-utility/src/main/java/org/apache/sis/util/iso/CodeListFilter.java
------------------------------------------------------------------------------
--- svn:mime-type (original)
+++ svn:mime-type Thu May  9 12:24:13 2013
@@ -1 +1 @@
-text/plain
+text/plain;charset=UTF-8

Modified: sis/branches/Android/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultInternationalString.java
URL: http://svn.apache.org/viewvc/sis/branches/Android/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultInternationalString.java?rev=1480602&r1=1480601&r2=1480602&view=diff
==============================================================================
--- sis/branches/Android/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultInternationalString.java [iso-8859-1] (original)
+++ sis/branches/Android/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultInternationalString.java [UTF-8] Thu May  9 12:24:13 2013
@@ -29,12 +29,13 @@ 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.Collections.isNullOrEmpty;
+import static org.apache.sis.util.collection.Containers.isNullOrEmpty;
 
 // Related to JDK7
-import org.apache.sis.internal.util.Objects;
+import org.apache.sis.internal.jdk7.Objects;
 
 
 /**
@@ -54,7 +55,7 @@ public class DefaultInternationalString 
     /**
      * Serial number for inter-operability with different versions.
      */
-    private static final long serialVersionUID = 5760033376627376938L;
+    private static final long serialVersionUID = 3663160836923279819L;
 
     /**
      * The string values in different locales (never {@code null}).
@@ -69,7 +70,7 @@ public class DefaultInternationalString 
 
     /**
      * Creates an initially empty international string. Localized strings can been added
-     * using one of {@link #add add(…)} methods.
+     * using one of {@link #add add(…)} methods.
      */
     public DefaultInternationalString() {
         localeMap = Collections.emptyMap();
@@ -77,7 +78,7 @@ public class DefaultInternationalString 
 
     /**
      * Creates an international string initialized with the given string.
-     * Additional localized strings can been added using one of {@link #add add(…)} methods.
+     * Additional localized strings can been added using one of {@link #add add(…)} methods.
      * The string specified to this constructor is the one that will be returned if no localized
      * string is found for the {@code Locale} argument in a call to {@link #toString(Locale)}.
      *
@@ -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,85 +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.
         }
-    }
-
-    /**
-     * Adds a string for the given property key. This is a convenience method for constructing an
-     * {@code DefaultInternationalString} during iteration through the entries in a {@link Map}.
-     * It infers the {@code Locale} from the property {@code key}, using the following steps:
-     *
-     * <ul>
-     *   <li>If the {@code key} does not start with the specified {@code prefix}, then
-     *       this method does nothing and returns {@code false}.</li>
-     *   <li>Otherwise, the characters after the {@code prefix} are parsed as an ISO language
-     *       and country code, and the {@link #add(Locale, String)} method is invoked.</li>
-     * </ul>
-     *
-     * For example if the prefix is {@code "remarks"}, then the {@code "remarks_fr"} property key
-     * stands for remarks in {@linkplain Locale#FRENCH French} while the {@code "remarks_fr_CA"}
-     * property key stands for remarks in {@linkplain Locale#CANADA_FRENCH French Canadian}.
-     *
-     * @param  prefix The prefix to skip at the beginning of the {@code key}.
-     * @param  key    The property key which will determined the locale.
-     * @param  value  The localized string for the specified {@code key}.
-     * @return {@code true} if the key has been recognized, or {@code false} otherwise.
-     * @throws IllegalArgumentException if the locale after the prefix is an illegal code,
-     *         or a different string value was already set for the given locale.
-     */
-    public boolean add(final String prefix, final String key, final String value)
-            throws IllegalArgumentException
-    {
-        if (key.startsWith(prefix)) {
-            Locale locale = null;
-            final int offset = prefix.length();
-            if (key.length() != offset) {
-                if (key.charAt(offset) == '_') {
-                    locale = Locales.parse(key.substring(offset + 1));
-                } else {
-                    return false;
-                }
+        final String old = localeMap.put(locale, string);
+        if (old != null) {
+            localeMap.put(locale, old);
+            if (string.equals(old)) {
+                return;
             }
-            add(locale, value);
-            return true;
+            throw new IllegalArgumentException(Errors.format(
+                    Errors.Keys.ValueAlreadyDefined_1, locale));
         }
-        return false;
+        defaultValue = null; // Will be recomputed when first needed.
     }
 
     /**
@@ -250,60 +214,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;
                     }

Propchange: sis/branches/Android/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultInternationalString.java
------------------------------------------------------------------------------
--- svn:mime-type (original)
+++ svn:mime-type Thu May  9 12:24:13 2013
@@ -1 +1 @@
-text/plain
+text/plain;charset=UTF-8

Modified: sis/branches/Android/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultLocalName.java
URL: http://svn.apache.org/viewvc/sis/branches/Android/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultLocalName.java?rev=1480602&r1=1480601&r2=1480602&view=diff
==============================================================================
--- sis/branches/Android/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultLocalName.java [iso-8859-1] (original)
+++ sis/branches/Android/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultLocalName.java [UTF-8] Thu May  9 12:24:13 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;
@@ -32,7 +33,7 @@ import org.apache.sis.util.ArgumentCheck
 import org.apache.sis.internal.jaxb.gco.CharSequenceAdapter;
 
 // Related to JDK7
-import org.apache.sis.internal.util.Objects;
+import org.apache.sis.internal.jdk7.Objects;
 
 
 /**
@@ -59,7 +60,7 @@ public class DefaultLocalName extends Ab
     /**
      * Serial number for inter-operability with different versions.
      */
-    private static final long serialVersionUID = 8747478206456790138L;
+    private static final long serialVersionUID = -697839568997068872L;
 
     /**
      * The scope of this name, or {@code null} if the scope is the unique {@code GLOBAL} instance.
@@ -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();
     }

Propchange: sis/branches/Android/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultLocalName.java
------------------------------------------------------------------------------
--- svn:mime-type (original)
+++ svn:mime-type Thu May  9 12:24:13 2013
@@ -1 +1 @@
-text/plain
+text/plain;charset=UTF-8

Modified: sis/branches/Android/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultMemberName.java
URL: http://svn.apache.org/viewvc/sis/branches/Android/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultMemberName.java?rev=1480602&r1=1480601&r2=1480602&view=diff
==============================================================================
--- sis/branches/Android/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultMemberName.java [iso-8859-1] (original)
+++ sis/branches/Android/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultMemberName.java [UTF-8] Thu May  9 12:24:13 2013
@@ -45,7 +45,7 @@ public class DefaultMemberName extends D
     /**
      * Serial number for inter-operability with different versions.
      */
-    private static final long serialVersionUID = 6252686806895124457L;
+    private static final long serialVersionUID = 7307683415489715298L;
 
     /**
      * The type of the data associated with the record member.

Propchange: sis/branches/Android/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultMemberName.java
------------------------------------------------------------------------------
--- svn:mime-type (original)
+++ svn:mime-type Thu May  9 12:24:13 2013
@@ -1 +1 @@
-text/plain
+text/plain;charset=UTF-8

Propchange: sis/branches/Android/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultNameFactory.java
------------------------------------------------------------------------------
--- svn:mime-type (original)
+++ svn:mime-type Thu May  9 12:24:13 2013
@@ -1 +1 @@
-text/plain
+text/plain;charset=UTF-8

Modified: sis/branches/Android/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultNameSpace.java
URL: http://svn.apache.org/viewvc/sis/branches/Android/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultNameSpace.java?rev=1480602&r1=1480601&r2=1480602&view=diff
==============================================================================
--- sis/branches/Android/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultNameSpace.java [iso-8859-1] (original)
+++ sis/branches/Android/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultNameSpace.java [UTF-8] Thu May  9 12:24:13 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;
@@ -28,12 +29,12 @@ import org.opengis.util.ScopedName;
 import org.opengis.util.GenericName;
 import org.opengis.util.InternationalString;
 import org.apache.sis.util.collection.WeakValueHashMap;
-import org.apache.sis.util.collection.UnmodifiableArrayList;
+import org.apache.sis.internal.util.UnmodifiableArrayList;
 
 import static org.apache.sis.util.ArgumentChecks.ensureNonNull;
 
 // Related to JDK7
-import org.apache.sis.internal.util.Objects;
+import org.apache.sis.internal.jdk7.Objects;
 
 
 /**
@@ -56,7 +57,7 @@ public class DefaultNameSpace implements
     /**
      * For cross-version compatibility.
      */
-    private static final long serialVersionUID = -3064358267398624306L;
+    private static final long serialVersionUID = 8272640747799127007L;
 
     /**
      * The default separator, which is {@value}. The separator is inserted between the
@@ -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();
     }
 
     /**

Propchange: sis/branches/Android/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultNameSpace.java
------------------------------------------------------------------------------
--- svn:mime-type (original)
+++ svn:mime-type Thu May  9 12:24:13 2013
@@ -1 +1 @@
-text/plain
+text/plain;charset=UTF-8

Modified: sis/branches/Android/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultScopedName.java
URL: http://svn.apache.org/viewvc/sis/branches/Android/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultScopedName.java?rev=1480602&r1=1480601&r2=1480602&view=diff
==============================================================================
--- sis/branches/Android/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultScopedName.java [iso-8859-1] (original)
+++ sis/branches/Android/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultScopedName.java [UTF-8] Thu May  9 12:24:13 2013
@@ -29,7 +29,7 @@ import org.opengis.util.GenericName;
 import org.opengis.util.InternationalString;
 import org.apache.sis.util.ArgumentChecks;
 import org.apache.sis.util.resources.Errors;
-import org.apache.sis.util.collection.UnmodifiableArrayList;
+import org.apache.sis.internal.util.UnmodifiableArrayList;
 
 
 
@@ -55,7 +55,7 @@ public class DefaultScopedName extends A
     /**
      * Serial number for inter-operability with different versions.
      */
-    private static final long serialVersionUID = -5215955533541748481L;
+    private static final long serialVersionUID = 1363103337249930577L;
 
     /**
      * The immutable list of parsed names.
@@ -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.
@@ -146,6 +146,7 @@ public class DefaultScopedName extends A
         if (i != size) { // Paranoiac check.
             throw new ConcurrentModificationException(Errors.format(Errors.Keys.UnexpectedChange_1, "names"));
         }
+        // Following line is safe because 'parsedNames' type is <? extends LocalName>.
         parsedNames = UnmodifiableArrayList.wrap(locals);
     }
 
@@ -210,6 +211,7 @@ public class DefaultScopedName extends A
         if (index != locals.length) { // Paranoiac check.
             throw new ConcurrentModificationException(Errors.format(Errors.Keys.UnexpectedChange_1, "tail"));
         }
+        // Following line is safe because 'parsedNames' type is <? extends LocalName>.
         parsedNames = UnmodifiableArrayList.wrap(locals);
         if (tail instanceof LocalName) {
             this.path = path;

Propchange: sis/branches/Android/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultScopedName.java
------------------------------------------------------------------------------
--- svn:mime-type (original)
+++ svn:mime-type Thu May  9 12:24:13 2013
@@ -1 +1 @@
-text/plain
+text/plain;charset=UTF-8

Modified: sis/branches/Android/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultTypeName.java
URL: http://svn.apache.org/viewvc/sis/branches/Android/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultTypeName.java?rev=1480602&r1=1480601&r2=1480602&view=diff
==============================================================================
--- sis/branches/Android/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultTypeName.java [iso-8859-1] (original)
+++ sis/branches/Android/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultTypeName.java [UTF-8] Thu May  9 12:24:13 2013
@@ -31,7 +31,7 @@ import org.opengis.util.NameSpace;
  * </ul>
  *
  * @author  Guilhem Legal (Geomatys)
- * @author  Cédric Briançon (Geomatys)
+ * @author  Cédric Briançon (Geomatys)
  * @since   0.3 (derived from geotk-3.00)
  * @version 0.3
  * @module
@@ -42,7 +42,7 @@ public class DefaultTypeName extends Def
     /**
      * Serial number for inter-operability with different versions.
      */
-    private static final long serialVersionUID = -7985388992575173993L;
+    private static final long serialVersionUID = 7182126541436753582L;
 
     /**
      * Empty constructor to be used by JAXB only. Despite its "final" declaration,

Propchange: sis/branches/Android/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultTypeName.java
------------------------------------------------------------------------------
--- svn:mime-type (original)
+++ svn:mime-type Thu May  9 12:24:13 2013
@@ -1 +1 @@
-text/plain
+text/plain;charset=UTF-8

Modified: sis/branches/Android/sis-utility/src/main/java/org/apache/sis/util/iso/GlobalNameSpace.java
URL: http://svn.apache.org/viewvc/sis/branches/Android/sis-utility/src/main/java/org/apache/sis/util/iso/GlobalNameSpace.java?rev=1480602&r1=1480601&r2=1480602&view=diff
==============================================================================
--- sis/branches/Android/sis-utility/src/main/java/org/apache/sis/util/iso/GlobalNameSpace.java [iso-8859-1] (original)
+++ sis/branches/Android/sis-utility/src/main/java/org/apache/sis/util/iso/GlobalNameSpace.java [UTF-8] Thu May  9 12:24:13 2013
@@ -35,7 +35,7 @@ final class GlobalNameSpace extends Defa
     /**
      * For cross-version compatibility.
      */
-    private static final long serialVersionUID = 5276591595735817024L;
+    private static final long serialVersionUID = 4652341179694633152L;
 
     /**
      * The unique global namespace.

Propchange: sis/branches/Android/sis-utility/src/main/java/org/apache/sis/util/iso/GlobalNameSpace.java
------------------------------------------------------------------------------
--- svn:mime-type (original)
+++ svn:mime-type Thu May  9 12:24:13 2013
@@ -1 +1 @@
-text/plain
+text/plain;charset=UTF-8



Mime
View raw message