sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1411578 [1/2] - in /sis/trunk: ./ sis-build-helper/src/main/java/org/apache/sis/util/resources/ sis-utility/src/main/java/org/apache/sis/internal/util/ sis-utility/src/main/java/org/apache/sis/io/ sis-utility/src/main/java/org/apache/sis/m...
Date Tue, 20 Nov 2012 08:17:49 GMT
Author: desruisseaux
Date: Tue Nov 20 08:17:47 2012
New Revision: 1411578

URL: http://svn.apache.org/viewvc?rev=1411578&view=rev
Log:
Merge from the JDK6 branch.

Added:
    sis/trunk/sis-utility/src/main/java/org/apache/sis/internal/util/LocalizedException.java
      - copied unchanged from r1411577, sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/internal/util/LocalizedException.java
    sis/trunk/sis-utility/src/main/java/org/apache/sis/internal/util/LocalizedParseException.java
      - copied unchanged from r1411577, sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/internal/util/LocalizedParseException.java
    sis/trunk/sis-utility/src/main/java/org/apache/sis/io/CompoundFormat.java
      - copied unchanged from r1411577, sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/io/CompoundFormat.java
    sis/trunk/sis-utility/src/main/java/org/apache/sis/util/collection/ColumnConstant.java
      - copied unchanged from r1411577, sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/util/collection/ColumnConstant.java
    sis/trunk/sis-utility/src/main/java/org/apache/sis/util/collection/DefaultTreeTable.java
      - copied unchanged from r1411577, sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/util/collection/DefaultTreeTable.java
    sis/trunk/sis-utility/src/main/java/org/apache/sis/util/collection/TableColumn.java
      - copied unchanged from r1411577, sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/util/collection/TableColumn.java
    sis/trunk/sis-utility/src/main/java/org/apache/sis/util/collection/TreeNodeList.java
      - copied unchanged from r1411577, sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/util/collection/TreeNodeList.java
    sis/trunk/sis-utility/src/main/java/org/apache/sis/util/collection/TreeTable.java
      - copied unchanged from r1411577, sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/util/collection/TreeTable.java
    sis/trunk/sis-utility/src/main/java/org/apache/sis/util/collection/TreeTableFormat.java
      - copied unchanged from r1411577, sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/util/collection/TreeTableFormat.java
    sis/trunk/sis-utility/src/main/java/org/apache/sis/util/collection/TreeTables.java
      - copied unchanged from r1411577, sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/util/collection/TreeTables.java
    sis/trunk/sis-utility/src/main/java/org/apache/sis/util/collection/UnmodifiableArrayList.java
      - copied unchanged from r1411577, sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/util/collection/UnmodifiableArrayList.java
    sis/trunk/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary.java
      - copied unchanged from r1411577, sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary.java
    sis/trunk/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary.properties
      - copied unchanged from r1411577, sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary.properties
    sis/trunk/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary_fr.properties
      - copied unchanged from r1411577, sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary_fr.properties
    sis/trunk/sis-utility/src/test/java/org/apache/sis/internal/util/LocalizedParseExceptionTest.java
      - copied unchanged from r1411577, sis/branches/JDK6/sis-utility/src/test/java/org/apache/sis/internal/util/LocalizedParseExceptionTest.java
    sis/trunk/sis-utility/src/test/java/org/apache/sis/test/TestStep.java
      - copied unchanged from r1411577, sis/branches/JDK6/sis-utility/src/test/java/org/apache/sis/test/TestStep.java
    sis/trunk/sis-utility/src/test/java/org/apache/sis/util/collection/DefaultTreeTableTest.java
      - copied unchanged from r1411577, sis/branches/JDK6/sis-utility/src/test/java/org/apache/sis/util/collection/DefaultTreeTableTest.java
    sis/trunk/sis-utility/src/test/java/org/apache/sis/util/collection/StringColumn.java
      - copied unchanged from r1411577, sis/branches/JDK6/sis-utility/src/test/java/org/apache/sis/util/collection/StringColumn.java
    sis/trunk/sis-utility/src/test/java/org/apache/sis/util/collection/TreeTableFormatTest.java
      - copied unchanged from r1411577, sis/branches/JDK6/sis-utility/src/test/java/org/apache/sis/util/collection/TreeTableFormatTest.java
Removed:
    sis/trunk/sis-utility/src/main/java/org/apache/sis/util/LocalizedException.java
    sis/trunk/sis-utility/src/main/java/org/apache/sis/util/LocalizedParseException.java
Modified:
    sis/trunk/   (props changed)
    sis/trunk/pom.xml
    sis/trunk/sis-build-helper/src/main/java/org/apache/sis/util/resources/IndexedResourceCompiler.java
    sis/trunk/sis-utility/src/main/java/org/apache/sis/internal/util/package-info.java
    sis/trunk/sis-utility/src/main/java/org/apache/sis/io/LineFormatter.java
    sis/trunk/sis-utility/src/main/java/org/apache/sis/io/TableFormatter.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/util/CharSequences.java
    sis/trunk/sis-utility/src/main/java/org/apache/sis/util/Exceptions.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/collection/CheckedContainer.java
    sis/trunk/sis-utility/src/main/java/org/apache/sis/util/collection/Collections.java
    sis/trunk/sis-utility/src/main/java/org/apache/sis/util/collection/DerivedSet.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/type/AbstractInternationalString.java
    sis/trunk/sis-utility/src/main/java/org/apache/sis/util/type/DefaultInternationalString.java
    sis/trunk/sis-utility/src/test/java/org/apache/sis/measure/FormattedCharacterIteratorTest.java
    sis/trunk/sis-utility/src/test/java/org/apache/sis/test/Assert.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/resources/IndexedResourceBundleTest.java

Propchange: sis/trunk/
------------------------------------------------------------------------------
  Merged /sis/branches/JDK7:r1405500-1411573
  Merged /sis/branches/JDK6:r1405501-1411577

Modified: sis/trunk/pom.xml
URL: http://svn.apache.org/viewvc/sis/trunk/pom.xml?rev=1411578&r1=1411577&r2=1411578&view=diff
==============================================================================
--- sis/trunk/pom.xml (original)
+++ sis/trunk/pom.xml Tue Nov 20 08:17:47 2012
@@ -490,7 +490,7 @@ Apache SIS is a toolkit for describing l
           <tags>
             <tag><placement>t</placement> <name>goal</name>     <head>Maven goal:</head></tag>
             <tag><placement>t</placement> <name>phase</name>    <head>Maven phase:</head></tag>
-            <tag><placement>a</placement> <name>category</name> <head>Category:</head></tag>
+            <tag><placement>X</placement> <name>category</name> <head>Category:</head></tag>
             <tag><placement>a</placement> <name>todo</name>     <head>TODO:</head></tag>
           </tags>
           <taglets>

Modified: sis/trunk/sis-build-helper/src/main/java/org/apache/sis/util/resources/IndexedResourceCompiler.java
URL: http://svn.apache.org/viewvc/sis/trunk/sis-build-helper/src/main/java/org/apache/sis/util/resources/IndexedResourceCompiler.java?rev=1411578&r1=1411577&r2=1411578&view=diff
==============================================================================
--- sis/trunk/sis-build-helper/src/main/java/org/apache/sis/util/resources/IndexedResourceCompiler.java (original)
+++ sis/trunk/sis-build-helper/src/main/java/org/apache/sis/util/resources/IndexedResourceCompiler.java Tue Nov 20 08:17:47 2012
@@ -169,25 +169,28 @@ class IndexedResourceCompiler implements
      */
     private void loadKeyValues() throws IOException {
         final BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream(bundleClass), JAVA_ENCODING));
-        String line;
-        while ((line = in.readLine()) != null) {
-            if ((line = line.trim()).startsWith(KEY_MODIFIERS)) {
-                final int s = line.indexOf('=', KEY_MODIFIERS.length());
-                if (s >= 0) {
-                    final int c = line.indexOf(';', s);
-                    if (c >= 0) {
-                        final String key = line.substring(KEY_MODIFIERS.length(), s).trim();
-                        final Integer ID = Integer.valueOf(line.substring(s+1, c).trim());
-                        final String old = allocatedIDs.put(ID, key);
-                        if (old != null) {
-                            warning("Key " + ID + " is used by " + old + " and " + key);
-                            errors++;
+        try {
+            String line;
+            while ((line = in.readLine()) != null) {
+                if ((line = line.trim()).startsWith(KEY_MODIFIERS)) {
+                    final int s = line.indexOf('=', KEY_MODIFIERS.length());
+                    if (s >= 0) {
+                        final int c = line.indexOf(';', s);
+                        if (c >= 0) {
+                            final String key = line.substring(KEY_MODIFIERS.length(), s).trim();
+                            final Integer ID = Integer.valueOf(line.substring(s+1, c).trim());
+                            final String old = allocatedIDs.put(ID, key);
+                            if (old != null) {
+                                warning("Key " + ID + " is used by " + old + " and " + key);
+                                errors++;
+                            }
                         }
                     }
                 }
             }
+        } finally {
+            in.close();
         }
-        in.close();
     }
 
     /**
@@ -211,9 +214,9 @@ class IndexedResourceCompiler implements
      * The following methods are invoked by this method:
      *
      * <ul>
-     *   <li>{@link #loadProperties}</li>
-     *   <li>{@link #writeUTF}</li>
-     *   <li>{@link #writeJavaSource}</li>
+     *   <li>{@link #loadProperties(File)}</li>
+     *   <li>{@link #writeUTF(File)}</li>
+     *   <li>{@link #writeJavaSource()}</li>
      * </ul>
      *
      * @throws IOException if an input/output operation failed.
@@ -229,10 +232,8 @@ class IndexedResourceCompiler implements
         if (utfDir.exists() && !utfDir.isDirectory()) {
             throw new FileNotFoundException("\"" + utfDir + "\" is not a directory.");
         }
-        final File[] content = srcDir.listFiles(this);
         File defaultLanguage = null;
-        for (int i=0; i<content.length; i++) {
-            final File file = content[i];
+        for (final File file : srcDir.listFiles(this)) {
             final String filename = file.getName();
             if (filename.startsWith(classname)) {
                 loadProperties(file);
@@ -271,10 +272,14 @@ class IndexedResourceCompiler implements
      * @throws IOException if the file can not be read.
      */
     private static Properties loadRawProperties(final File file) throws IOException {
+        final Properties properties;
         final InputStream input = new FileInputStream(file);
-        final Properties properties = new Properties();
-        properties.load(input);
-        input.close();
+        try {
+            properties = new Properties();
+            properties.load(input);
+        } finally {
+            input.close();
+        }
         return properties;
     }
 
@@ -287,8 +292,7 @@ class IndexedResourceCompiler implements
      * <p>The following methods must be invoked before this one:</p>
      *
      * <ul>
-     *   <li>{@link #initialize}</li>
-     *   <li>{@link #setResourceBundle}</li>
+     *   <li>{@link #loadKeyValues()}</li>
      * </ul>
      *
      * @param  file The properties file to read.
@@ -303,11 +307,11 @@ class IndexedResourceCompiler implements
             /*
              * Checks key and value validity.
              */
-            if (key.trim().length() == 0) {
+            if (key.trim().isEmpty()) {
                 warning(file, key, "Empty key.", null);
                 continue;
             }
-            if (value.trim().length() == 0) {
+            if (value.trim().isEmpty()) {
                 warning(file, key, "Empty value.", null);
                 continue;
             }
@@ -351,8 +355,7 @@ class IndexedResourceCompiler implements
         final String[] keys = resources.keySet().toArray(new String[resources.size()]);
         Arrays.sort(keys, this);
         int freeID = 0;
-        for (int i=0; i<keys.length; i++) {
-            final String key = keys[i];
+        for (final String key : keys) {
             if (!allocatedIDs.containsValue(key)) {
                 Integer ID;
                 do {
@@ -424,9 +427,8 @@ search: for (int i=0; i<buffer.length();
      * Writes UTF file. The following methods must be invoked before this one:
      *
      * <ul>
-     *   <li>{@link #initialize}</li>
-     *   <li>{@link #setResourceBundle}</li>
-     *   <li>{@link #loadProperties}</li>
+     *   <li>{@link #loadKeyValues()}</li>
+     *   <li>{@link #loadProperties(File)}</li>
      * </ul>
      *
      * @param  file The destination file.
@@ -439,12 +441,15 @@ search: for (int i=0; i<buffer.length();
         }
         final int count = allocatedIDs.isEmpty() ? 0 : Collections.max(allocatedIDs.keySet()) + 1;
         final DataOutputStream out = new DataOutputStream(new BufferedOutputStream(new FileOutputStream(file)));
-        out.writeInt(count);
-        for (int i=0; i<count; i++) {
-            final String value = (String) resources.get(allocatedIDs.get(i));
-            out.writeUTF((value != null) ? value : "");
+        try {
+            out.writeInt(count);
+            for (int i=0; i<count; i++) {
+                final String value = (String) resources.get(allocatedIDs.get(i));
+                out.writeUTF((value != null) ? value : "");
+            }
+        } finally {
+            out.close();
         }
-        out.close();
     }
 
     /**
@@ -452,9 +457,8 @@ search: for (int i=0; i<buffer.length();
      * The following methods must be invoked before this one:
      *
      * <ul>
-     *   <li>{@link #initialize}</li>
-     *   <li>{@link #setResourceBundle}</li>
-     *   <li>{@link #loadProperties}</li>
+     *   <li>{@link #loadKeyValues()}</li>
+     *   <li>{@link #loadProperties(File)}</li>
      * </ul>
      *
      * @throws IOException if an input/output operation failed.
@@ -467,115 +471,130 @@ search: for (int i=0; i<buffer.length();
         if (!file.getParentFile().isDirectory()) {
             throw new FileNotFoundException("Parent directory not found for " + file);
         }
-        final BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream(file), JAVA_ENCODING));
         final String lineSeparator = System.getProperty("line.separator", "\n");
         final StringBuilder buffer = new StringBuilder(4096);
         /*
-         * Copies everything up to (including) the declaration of the Keys inner class.
+         * Copies everything up to (including) the constructor of the Keys inner class.
          * The declaration must follow Sun's convention on brace location (i.e. must be
          * on the same line than the class declaration).
          */
-        final Pattern classKeys = Pattern.compile("[\\s\\w]*class\\s+" + KEYS_INNER_CLASS + "\\s*\\{");
-        String line;
-        do {
-            line = in.readLine();
-            if (line == null) {
-                in.close();
-                throw new EOFException(file.toString());
-            }
-            buffer.append(line).append(lineSeparator);
-        } while (!classKeys.matcher(line).matches());
-        /*
-         * Starting from this point, the content that we are going to write in the buffer
-         * may be different than the file content.  Remember the buffer position in order
-         * to allow us to compare the buffer with the file content.
-         *
-         * We stop reading the file for now. We will continue reading the file after the
-         * 'for' loop below. Instead, we now write the constructor followed by keys values.
-         */
-        int startLineToCompare = buffer.length();
-        buffer.append(KEY_MARGIN).append("private ").append(KEYS_INNER_CLASS).append("() {").append(lineSeparator)
-              .append(KEY_MARGIN).append('}').append(lineSeparator);
-        final Map.Entry<?,?>[] entries = allocatedIDs.entrySet().toArray(new Map.Entry<?,?>[allocatedIDs.size()]);
-        Arrays.sort(entries, this);
-        for (int i=0; i<entries.length; i++) {
-            buffer.append(lineSeparator);
-            final String key = (String) entries[i].getValue();
-            final String ID  = entries[i].getKey().toString();
-            String message = (String) resources.get(key);
-            if (message != null) {
-                message = message.replace('\t', ' ');
-                buffer.append(KEY_MARGIN).append("/**").append(lineSeparator);
-                while (((message=message.trim()).length()) != 0) {
-                    buffer.append(KEY_MARGIN).append(" * ");
-                    int stop = message.indexOf('\n');
-                    if (stop < 0) {
-                        stop = message.length();
+        boolean modified;
+        final BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream(file), JAVA_ENCODING));
+        try {
+            for (int state=0; state<=2; state++) {
+                final String regex;
+                switch (state) {
+                    case 0: regex = "[\\s\\w]*class\\s+" + KEYS_INNER_CLASS + "\\s+[\\s\\w]*\\{";      break; // Class declaration
+                    case 1: regex = "[\\s\\w]*\\s+" + KEYS_INNER_CLASS + "\\s*\\([\\s\\w]*\\)\\s+\\{"; break; // Constructor declaration
+                    case 2: regex = "\\s*\\}"; break; // Constructor end.
+                    default: throw new AssertionError(state);
+                }
+                final Pattern pattern = Pattern.compile(regex);
+                String line;
+                do {
+                    line = in.readLine();
+                    if (line == null) {
+                        in.close();
+                        throw new EOFException(file.toString());
                     }
-                    if (stop > COMMENT_LENGTH) {
-                        stop = COMMENT_LENGTH;
-                        while (stop>20 && !Character.isWhitespace(message.charAt(stop))) {
-                            stop--;
+                    buffer.append(line).append(lineSeparator);
+                } while (!pattern.matcher(line).matches());
+            }
+            /*
+             * Starting from this point, the content that we are going to write in the buffer
+             * may be different than the file content.  Remember the buffer position in order
+             * to allow us to compare the buffer with the file content.
+             *
+             * We stop reading the file for now. We will continue reading the file after the
+             * 'for' loop below. Instead, we now write the constructor followed by keys values.
+             */
+            int startLineToCompare = buffer.length();
+            final Map.Entry<?,?>[] entries = allocatedIDs.entrySet().toArray(new Map.Entry<?,?>[allocatedIDs.size()]);
+            Arrays.sort(entries, this);
+            for (final Map.Entry<?,?> entry : entries) {
+                buffer.append(lineSeparator);
+                final String key = (String) entry.getValue();
+                final String ID  = entry.getKey().toString();
+                String message = (String) resources.get(key);
+                if (message != null) {
+                    message = message.replace('\t', ' ');
+                    buffer.append(KEY_MARGIN).append("/**").append(lineSeparator);
+                    while (((message=message.trim()).length()) != 0) {
+                        buffer.append(KEY_MARGIN).append(" * ");
+                        int stop = message.indexOf('\n');
+                        if (stop < 0) {
+                            stop = message.length();
                         }
+                        if (stop > COMMENT_LENGTH) {
+                            stop = COMMENT_LENGTH;
+                            while (stop>20 && !Character.isWhitespace(message.charAt(stop))) {
+                                stop--;
+                            }
+                        }
+                        buffer.append(message.substring(0, stop).trim()).append(lineSeparator);
+                        message = message.substring(stop);
                     }
-                    buffer.append(message.substring(0, stop).trim()).append(lineSeparator);
-                    message = message.substring(stop);
+                    buffer.append(KEY_MARGIN).append(" */").append(lineSeparator);
                 }
-                buffer.append(KEY_MARGIN).append(" */").append(lineSeparator);
+                buffer.append(KEY_MARGIN).append(KEY_MODIFIERS).append(key).append(" = ")
+                        .append(ID).append(';').append(lineSeparator);
             }
-            buffer.append(KEY_MARGIN).append(KEY_MODIFIERS).append(key).append(" = ")
-                    .append(ID).append(';').append(lineSeparator);
-        }
-        /*
-         * At this point, all key values have been written in the buffer. Skip the corresponding
-         * lines from the files without adding them to the buffer.  However we will compare them
-         * to the buffer content in order to detect if we really need to write the file.
-         *
-         * This operation will stop when we reach the closing bracket. Note that opening brackets
-         * may exist in the code that we are skipping, so we need to count them.
-         */
-        boolean modified = false;
-        int brackets = 1;
-        do {
-            line = in.readLine();
-            if (line == null) {
-                in.close();
-                throw new EOFException(file.toString());
-            }
-            for (int i=0; i<line.length(); i++) {
-                switch (line.charAt(i)) {
-                    case '{': brackets++; break;
-                    case '}': brackets--; break;
+            /*
+             * At this point, all key values have been written in the buffer. Skip the corresponding
+             * lines from the files without adding them to the buffer.  However we will compare them
+             * to the buffer content in order to detect if we really need to write the file.
+             *
+             * This operation will stop when we reach the closing bracket. Note that opening brackets
+             * may exist in the code that we are skipping, so we need to count them.
+             */
+            modified = false;
+            int brackets = 1;
+            String line;
+            do {
+                line = in.readLine();
+                if (line == null) {
+                    in.close();
+                    throw new EOFException(file.toString());
                 }
-            }
-            if (!modified) {
-                final int endOfLine = buffer.indexOf(lineSeparator, startLineToCompare);
-                if (endOfLine >= 0) {
-                    if (buffer.substring(startLineToCompare, endOfLine).equals(line)) {
-                        startLineToCompare = endOfLine + lineSeparator.length();
-                        continue; // Content is equals, do not set the 'modified' flag.
+                for (int i=0; i<line.length(); i++) {
+                    switch (line.charAt(i)) {
+                        case '{': brackets++; break;
+                        case '}': brackets--; break;
                     }
-                } else if (brackets == 0) {
-                    break; // Content finished in same time, do not set the 'modified' flag.
                 }
-                modified = true;
-            }
-        } while (brackets != 0);
-        /*
-         * Only if we detected some changes in the file content, read all remaining parts of
-         * the file then write the result to disk. Note that this overwite the original file.
-         */
-        if (modified) {
-            buffer.append(line).append(lineSeparator);
-            while ((line = in.readLine()) != null) {
+                if (!modified) {
+                    final int endOfLine = buffer.indexOf(lineSeparator, startLineToCompare);
+                    if (endOfLine >= 0) {
+                        if (buffer.substring(startLineToCompare, endOfLine).equals(line)) {
+                            startLineToCompare = endOfLine + lineSeparator.length();
+                            continue; // Content is equals, do not set the 'modified' flag.
+                        }
+                    } else if (brackets == 0) {
+                        break; // Content finished in same time, do not set the 'modified' flag.
+                    }
+                    modified = true;
+                }
+            } while (brackets != 0);
+            /*
+             * Only if we detected some changes in the file content, read all remaining parts of
+             * the file then write the result to disk. Note that this overwite the original file.
+             */
+            if (modified) {
                 buffer.append(line).append(lineSeparator);
+                while ((line = in.readLine()) != null) {
+                    buffer.append(line).append(lineSeparator);
+                }
             }
+        } finally {
+            in.close();
         }
-        in.close();
         if (modified) {
             final Writer out = new OutputStreamWriter(new FileOutputStream(file), JAVA_ENCODING);
-            out.write(buffer.toString());
-            out.close();
+            try {
+                out.write(buffer.toString());
+            } finally {
+                out.close();
+            }
         }
     }
 

Modified: sis/trunk/sis-utility/src/main/java/org/apache/sis/internal/util/package-info.java
URL: http://svn.apache.org/viewvc/sis/trunk/sis-utility/src/main/java/org/apache/sis/internal/util/package-info.java?rev=1411578&r1=1411577&r2=1411578&view=diff
==============================================================================
--- sis/trunk/sis-utility/src/main/java/org/apache/sis/internal/util/package-info.java (original)
+++ sis/trunk/sis-utility/src/main/java/org/apache/sis/internal/util/package-info.java Tue Nov 20 08:17:47 2012
@@ -23,6 +23,12 @@
  * This package is for internal use by SIS only. Classes in this package
  * may change in incompatible ways in any future version without notice.
  *
+ * {@section Note on serialization}
+ * Developers should avoid putting serializable classes in this package as much as possible,
+ * since the serialization forms may be considered as a kind of API contract (depending how
+ * much strict we want to be regarding compatibility). This is not always practical however,
+ * so some serialized classes still exist in this package.
+ *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.3 (derived from geotk-2.0)
  * @version 0.3

Modified: sis/trunk/sis-utility/src/main/java/org/apache/sis/io/LineFormatter.java
URL: http://svn.apache.org/viewvc/sis/trunk/sis-utility/src/main/java/org/apache/sis/io/LineFormatter.java?rev=1411578&r1=1411577&r2=1411578&view=diff
==============================================================================
--- sis/trunk/sis-utility/src/main/java/org/apache/sis/io/LineFormatter.java (original)
+++ sis/trunk/sis-utility/src/main/java/org/apache/sis/io/LineFormatter.java Tue Nov 20 08:17:47 2012
@@ -308,6 +308,22 @@ public class LineFormatter extends Filte
     }
 
     /**
+     * Writes pending non-white characters, discards trailing whitespaces, and resets column
+     * position to zero. This method does <strong>not</strong> write the line separator and
+     * does not modify the status of the {@link #skipLF} flag; those tasks are caller's
+     * responsibility.
+     */
+    private void endOfLine() throws IOException {
+        buffer.setLength(printableLength); // Reduce the amount of work for StringBuilder.deleteCharAt(int).
+        deleteSoftHyphen();
+        transfer(printableLength);
+        printableLength  = 0;
+        codePointCount   = 0;
+        isEscapeSequence = false; // Handle line-breaks as "end of escape sequence".
+        isNewLine        = true;
+    }
+
+    /**
      * Removes the soft hyphen characters from the given buffer. This is invoked
      * when the buffer is about to be written without being split on two lines.
      */
@@ -358,13 +374,7 @@ public class LineFormatter extends Filte
                 default:   skip = false;  skipLF = false; break;
             }
             if (!skip) {
-                buffer.setLength(printableLength); // Reduce the amount of work for StringBuilder.deleteCharAt(int).
-                deleteSoftHyphen();
-                transfer(printableLength);
-                printableLength  = 0;
-                codePointCount   = 0;
-                isEscapeSequence = false; // Handle line-breaks as "end of escape sequence".
-                isNewLine        = true;
+                endOfLine();
             }
             if (!isEndOfLineReplaced) {
                 appendCodePoint(c); // Forward EOL sequences "as-is".
@@ -519,15 +529,29 @@ searchHyp:  for (int i=buffer.length(); 
     }
 
     /**
-     * Sends pending characters to the underlying stream. Note that this method should
-     * preferably be invoked at the end of a word, sentence or line, since invoking it
-     * may prevent {@code LineFormatter} to properly wrap the current line if it is
-     * in the middle of a word.
-     *
-     * <p>Invoking this method also flushes the {@linkplain #out underlying stream}.
-     * A cheaper way to send pending characters is to make sure that the last character
-     * is a {@linkplain org.apache.sis.util.Characters#isLineOrParagraphSeparator(int)
-     * line or paragraph terminator}.</p>
+     * Resets the {@code LineFormatter} internal state as if a new line was beginning.
+     * Trailing whitespaces not yet sent to the {@linkplain #out underlying appendable}
+     * are discarded, and the column position (for tabulation expansion calculation) is
+     * reset to 0. This method does not write any line separator.
+     *
+     * @throws IOException If an error occurred while sending the trailing non-white
+     *         characters to the underlying stream.
+     */
+    public void clear() throws IOException {
+        endOfLine();
+        skipLF = false;
+    }
+
+    /**
+     * Sends all pending characters to the {@linkplain #out underlying appendable}, including
+     * trailing whitespaces. Note that this method should preferably be invoked at the end of
+     * a word, sentence or line, since invoking this method may prevent {@code LineFormatter}
+     * to properly wrap the current line if the current position is in the middle of a word.
+     *
+     * <p>Invoking this method also flushes the underlying stream, if {@linkplain Flushable flushable}.
+     * A cheaper way to send pending characters is to make sure that the last character is a
+     * {@linkplain Characters#isLineOrParagraphSeparator(int) line or paragraph terminator},
+     * or to invoke {@link #clear()}.</p>
      *
      * @throws IOException If an I/O error occurs.
      */

Modified: sis/trunk/sis-utility/src/main/java/org/apache/sis/io/TableFormatter.java
URL: http://svn.apache.org/viewvc/sis/trunk/sis-utility/src/main/java/org/apache/sis/io/TableFormatter.java?rev=1411578&r1=1411577&r2=1411578&view=diff
==============================================================================
--- sis/trunk/sis-utility/src/main/java/org/apache/sis/io/TableFormatter.java (original)
+++ sis/trunk/sis-utility/src/main/java/org/apache/sis/io/TableFormatter.java Tue Nov 20 08:17:47 2012
@@ -76,6 +76,8 @@ import org.apache.sis.internal.util.JDK7
  * @since   0.3 (derived from geotk-1.0)
  * @version 0.3
  * @module
+ *
+ * @see org.apache.sis.util.tree.TreeTableFormat
  */
 @Decorator(Appendable.class)
 public class TableFormatter extends FilteredAppendable implements Flushable {
@@ -286,7 +288,7 @@ public class TableFormatter extends Filt
      * @param  horizontalBorder -1 for left border, +1 for right border,  0 for center.
      * @param  verticalBorder   -1 for top  border, +1 for bottom border, 0 for center.
      * @param  horizontalChar   Character to use for horizontal line.
-     * @throws IOException     if the writing operation failed.
+     * @throws IOException      If the writing operation failed.
      */
     private void writeBorder(final int  horizontalBorder,
                              final int  verticalBorder,
@@ -733,13 +735,14 @@ public class TableFormatter extends Filt
                 for (int j=0; j<currentLine.length; j++) {
                     final boolean isFirstColumn = (j   == 0);
                     final boolean isLastColumn  = (j+1 == currentLine.length);
-                    final Cell cell = currentLine[j];
-                    final int cellWidth = maximalColumnWidths[j];
+                    final Cell    cell          = currentLine[j];
+                    final int     cellWidth     = maximalColumnWidths[j];
+                    final int     cellPadding   = isLastColumn && rightBorder.isEmpty() ? 0 : cellWidth;
                     if (cell == null) {
                         if (isFirstColumn) {
                             out.append(leftBorder);
                         }
-                        repeat(out, SPACE, cellWidth);
+                        repeat(out, SPACE, cellPadding);
                         out.append(isLastColumn ? rightBorder : columnSeparator);
                         continue;
                     }
@@ -793,7 +796,7 @@ public class TableFormatter extends Filt
                         if (isFirstColumn) {
                             writeBorder(-1, verticalBorder, cell.fill);
                         }
-                        repeat(out, cell.fill, cellWidth);
+                        repeat(out, cell.fill, Character.isSpaceChar(cell.fill) ? cellPadding : cellWidth);
                         writeBorder(isLastColumn ? +1 : 0, verticalBorder, cell.fill);
                         continue;
                     }
@@ -812,7 +815,7 @@ public class TableFormatter extends Filt
                         }
                         case ALIGN_LEFT: {
                             tabExpander.append(cellText);
-                            repeat(tabExpander, cell.fill, cellWidth - textLength);
+                            repeat(tabExpander, cell.fill, cellPadding - textLength);
                             break;
                         }
                         case ALIGN_RIGHT: {
@@ -821,10 +824,10 @@ public class TableFormatter extends Filt
                             break;
                         }
                         case ALIGN_CENTER: {
-                            final int rightMargin = (cellWidth - textLength) / 2;
-                            repeat(tabExpander, cell.fill, rightMargin);
+                            final int leftPadding = (cellWidth - textLength) / 2;
+                            repeat(tabExpander, cell.fill, leftPadding);
                             tabExpander.append(cellText);
-                            repeat(tabExpander, cell.fill, (cellWidth - rightMargin) - textLength);
+                            repeat(tabExpander, cell.fill, (cellPadding - leftPadding) - textLength);
                             break;
                         }
                     }
@@ -851,7 +854,8 @@ public class TableFormatter extends Filt
     }
 
     /**
-     * Repeats a character.
+     * Repeats a character. The {@code count} value may be negative,
+     * which is handled as if it was zero.
      *
      * @param out   The stream or buffer where to repeat the character.
      * @param car   Character to write (usually ' ').

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=1411578&r1=1411577&r2=1411578&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 Nov 20 08:17:47 2012
@@ -101,9 +101,9 @@ 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.CANADA in
-             * our 'getAngleFormat()' implementation. The getMessage() method uses the system
-             * locale, which is what we actually want.
+             * is formatted in the AngleFormat locale, which is hard-coded to Locale.US in our
+             * 'getAngleFormat()' implementation. The getMessage() method uses the system locale,
+             * which is what we actually want.
              */
             NumberFormatException e = new NumberFormatException(exception.getMessage());
             e.initCause(exception);
@@ -239,8 +239,7 @@ public class Angle implements Comparable
     private static Format getAngleFormat() {
         assert Thread.holdsLock(Angle.class);
         if (format == null) {
-            format = AngleFormat.getInstance(Locale.CANADA);
-            // Canada locale is closer to ISO standards than US locale.
+            format = AngleFormat.getInstance(Locale.US);
         }
         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=1411578&r1=1411577&r2=1411578&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 Nov 20 08:17:47 2012
@@ -29,9 +29,9 @@ import net.jcip.annotations.NotThreadSaf
 
 import org.apache.sis.util.Debug;
 import org.apache.sis.util.Localized;
-import org.apache.sis.util.Exceptions;
 import org.apache.sis.util.ArgumentChecks;
 import org.apache.sis.util.resources.Errors;
+import org.apache.sis.internal.util.LocalizedParseException;
 
 import static java.lang.Math.abs;
 import static java.lang.Math.rint;
@@ -917,7 +917,12 @@ scan:   for (int i=0; i<length;) {
                 if (suffix != null) {
                     toAppendTo.append(suffix);
                 }
-                it.addFieldLimit(Field.forCode(field), Integer.valueOf((int) value), startPosition);
+                it.addFieldLimit(Field.forCode(field), hasMore
+                        ? (Number) Integer.valueOf((int) Math.round(value))
+                        : (Number) Float.valueOf((float) value), startPosition);
+                // The 'valueOf(…)' was for information purpose only. We use Float instead of Double
+                // because we don't want to give a false impression of accuracy (when formatting the
+                // seconds field, at least the 10 last bits of the double value are non-significant).
             } else {
                 toAppendTo = numberFormat.format(value, toAppendTo, dummyFieldPosition());
                 if (suffix != null) {
@@ -1530,8 +1535,9 @@ BigBoss:    switch (skipSuffix(source, p
     public Angle parse(final String source) throws ParseException {
         final ParsePosition pos = new ParsePosition(0);
         final Angle angle = parse(source, pos, true);
-        if (skipSpaces(source, pos.getIndex()) != source.length()) {
-            throw Exceptions.createParseException(locale, Angle.class, source, pos);
+        final int offset = pos.getIndex();
+        if (skipSpaces(source, offset) != source.length()) {
+            throw new LocalizedParseException(locale, Angle.class, source, pos);
         }
         return angle;
     }

Modified: sis/trunk/sis-utility/src/main/java/org/apache/sis/util/CharSequences.java
URL: http://svn.apache.org/viewvc/sis/trunk/sis-utility/src/main/java/org/apache/sis/util/CharSequences.java?rev=1411578&r1=1411577&r2=1411578&view=diff
==============================================================================
--- sis/trunk/sis-utility/src/main/java/org/apache/sis/util/CharSequences.java (original)
+++ sis/trunk/sis-utility/src/main/java/org/apache/sis/util/CharSequences.java Tue Nov 20 08:17:47 2012
@@ -202,7 +202,7 @@ public final class CharSequences extends
         int n = 0;
         if (text != null) {
             int i = 0;
-            while ((i = indexOf(text, toSearch, i)) >= 0) {
+            while ((i = indexOf(text, toSearch, i, text.length())) >= 0) {
                 n++;
                 i += length;
             }
@@ -243,35 +243,40 @@ public final class CharSequences extends
      * not found, then this method returns -1.
      *
      * <p>There is no restriction on the value of {@code fromIndex}. If negative or greater
-     * than the length of the text, then the behavior of this method is the same than the
-     * one documented in {@link String#indexOf(int, int)}.</p>
+     * than {@code toIndex}, then the behavior of this method is as if the search started
+     * from 0 or {@code toIndex} respectively. This is consistent with the behavior documented
+     * in {@link String#indexOf(int, int)}.</p>
      *
      * @param  text      The character sequence in which to perform the search, or {@code null}.
      * @param  toSearch  The Unicode code point of the character to search.
      * @param  fromIndex The index to start the search from.
+     * @param  toIndex   The index after the last character where to perform the search.
      * @return The index of the first occurrence of the given character in the text, or -1
      *         if no occurrence has been found or if the {@code text} argument is null.
      *
      * @see String#indexOf(int, int)
      */
-    public static int indexOf(final CharSequence text, final int toSearch, int fromIndex) {
+    public static int indexOf(final CharSequence text, final int toSearch, int fromIndex, int toIndex) {
         if (text != null) {
-            if (text instanceof String) {
+            final int length = text.length();
+            if (toIndex > length) {
+                toIndex = length;
+            }
+            if (text instanceof String && toIndex == length) {
                 // String provides a faster implementation.
                 return ((String) text).indexOf(toSearch, fromIndex);
             }
             if (fromIndex < 0) {
                 fromIndex = 0;
             }
-            int length = text.length();
             char head  = (char) toSearch;
             char tail  = (char) 0;
             if (head != toSearch) { // Outside BMP plane?
                 head = highSurrogate(toSearch);
                 tail = lowSurrogate (toSearch);
-                length--;
+                toIndex--;
             }
-            while (fromIndex < length) {
+            while (fromIndex < toIndex) {
                 if (text.charAt(fromIndex) == head) {
                     if (tail == 0 || text.charAt(fromIndex+1) == tail) {
                         return fromIndex;
@@ -285,19 +290,24 @@ public final class CharSequences extends
 
     /**
      * Returns the index within the given strings of the first occurrence of the specified part,
-     * starting at the specified index. This method is equivalent to the following code:
+     * starting at the specified index. This method is equivalent to the following method call,
+     * except that this method works on arbitrary {@link CharSequence} objects instead than
+     * {@link String}s only, and that the upper limit can be specified:
      *
      * {@preformat java
-     *     return string.indexOf(part, fromIndex);
+     *     return text.indexOf(part, fromIndex);
      * }
      *
-     * Except that this method works on arbitrary {@link CharSequence} objects instead than
-     * {@link String}s only.
+     * There is no restriction on the value of {@code fromIndex}. If negative or greater
+     * than {@code toIndex}, then the behavior of this method is as if the search started
+     * from 0 or {@code toIndex} respectively. This is consistent with the
+     * {@link String#indexOf(String, int)} behavior.
      *
      * @param  text      The string in which to perform the search.
      * @param  toSearch  The substring for which to search.
      * @param  fromIndex The index from which to start the search.
-     * @return The index within the string of the first occurrence of the specified part,
+     * @param  toIndex   The index after the last character where to perform the search.
+     * @return The index within the text of the first occurrence of the specified part,
      *         starting at the specified index, or -1 if none.
      * @throws NullPointerException if any of the arguments is null.
      *
@@ -305,9 +315,13 @@ public final class CharSequences extends
      * @see StringBuilder#indexOf(String, int)
      * @see StringBuffer#indexOf(String, int)
      */
-    public static int indexOf(final CharSequence text, final CharSequence toSearch, int fromIndex) {
+    public static int indexOf(final CharSequence text, final CharSequence toSearch, int fromIndex, int toIndex) {
         if (text != null) {
-            if (toSearch instanceof String) {
+            int length = text.length();
+            if (toIndex > length) {
+                toIndex = length;
+            }
+            if (toSearch instanceof String && toIndex == length) {
                 if (text instanceof String) {
                     return ((String) text).indexOf((String) toSearch, fromIndex);
                 }
@@ -321,9 +335,9 @@ public final class CharSequences extends
             if (fromIndex < 0) {
                 fromIndex = 0;
             }
-            final int length = toSearch.length();
-            final int stopAt = text.length() - length;
-search:     for (; fromIndex <= stopAt; fromIndex++) {
+            length = toSearch.length();
+            toIndex -= length;
+search:     for (; fromIndex <= toIndex; fromIndex++) {
                 for (int i=0; i<length; i++) {
                     // No need to use the codePointAt API here, since we are looking for exact matches.
                     if (text.charAt(fromIndex + i) != toSearch.charAt(i)) {
@@ -355,7 +369,7 @@ search:     for (; fromIndex <= stopAt; 
      * @param  numLines  The number of lines to skip. Can be positive, zero or negative.
      * @param  fromIndex Index at which to start the search, from 0 to {@code text.length()} inclusive.
      * @return Index of the first character after the last skipped line.
-     * @throws NullPointerException If the {@code string} argument is null.
+     * @throws NullPointerException If the {@code text} argument is null.
      * @throws IndexOutOfBoundsException If {@code fromIndex} is out of bounds.
      */
     public static int indexOfLineStart(final CharSequence text, int numLines, int fromIndex) {
@@ -445,8 +459,9 @@ search:     for (; fromIndex <= stopAt; 
         // 'excludeEmpty' must use the same criterion than trimWhitespaces(...).
         final boolean excludeEmpty = isWhitespace(separator);
         CharSequence[] strings = new CharSequence[4];
+        final int length = text.length();
         int count = 0, last  = 0, i = 0;
-        while ((i = indexOf(text, separator, i)) >= 0) {
+        while ((i = indexOf(text, separator, i, length)) >= 0) {
             final CharSequence item = trimWhitespaces(text, last, i);
             if (!excludeEmpty || item.length() != 0) {
                 if (count == strings.length) {
@@ -457,7 +472,7 @@ search:     for (; fromIndex <= stopAt; 
             last = ++i;
         }
         // Add the last element.
-        final CharSequence item = trimWhitespaces(text, last, text.length());
+        final CharSequence item = trimWhitespaces(text, last, length);
         if (!excludeEmpty || item.length() != 0) {
             if (count == strings.length) {
                 strings = copyOf(strings, count + 1);
@@ -503,8 +518,9 @@ search:     for (; fromIndex <= stopAt; 
          * This method is implemented on top of String.indexOf(int,int),
          * assuming that it will be faster for String and StringBuilder.
          */
-        int lf = indexOf(text, '\n', 0);
-        int cr = indexOf(text, '\r', 0);
+        final int length = text.length();
+        int lf = indexOf(text, '\n', 0, length);
+        int cr = indexOf(text, '\r', 0, length);
         if (lf < 0 && cr < 0) {
             return new CharSequence[] {
                 text
@@ -520,27 +536,27 @@ search:     for (; fromIndex <= stopAt; 
             if (cr < 0) {
                 // There is no "\r" character in the whole text, only "\n".
                 splitAt = lf;
-                hasMore = (lf = indexOf(text, '\n', lf+1)) >= 0;
+                hasMore = (lf = indexOf(text, '\n', lf+1, length)) >= 0;
             } else if (lf < 0) {
                 // There is no "\n" character in the whole text, only "\r".
                 splitAt = cr;
-                hasMore = (cr = indexOf(text, '\r', cr+1)) >= 0;
+                hasMore = (cr = indexOf(text, '\r', cr+1, length)) >= 0;
             } else if (lf < cr) {
                 // There is both "\n" and "\r" characters with "\n" first.
                 splitAt = lf;
                 hasMore = true;
-                lf = indexOf(text, '\n', lf+1);
+                lf = indexOf(text, '\n', lf+1, length);
             } else {
                 // There is both "\r" and "\n" characters with "\r" first.
                 // We need special care for the "\r\n" sequence.
                 splitAt = cr;
                 if (lf == ++cr) {
-                    cr = indexOf(text, '\r', cr+1);
-                    lf = indexOf(text, '\n', lf+1);
+                    cr = indexOf(text, '\r', cr+1, length);
+                    lf = indexOf(text, '\n', lf+1, length);
                     hasMore = (cr >= 0 || lf >= 0);
                     skip = 2;
                 } else {
-                    cr = indexOf(text, '\r', cr+1);
+                    cr = indexOf(text, '\r', cr+1, length);
                     hasMore = true; // Because there is lf.
                 }
             }
@@ -567,7 +583,7 @@ search:     for (; fromIndex <= stopAt; 
      *
      * @param  values    The text containing the values to parse, or {@code null}.
      * @param  separator The delimiting character (typically the coma).
-     * @return The array of numbers parsed from the given string,
+     * @return The array of numbers parsed from the given text,
      *         or an empty array if {@code values} was null.
      * @throws NumberFormatException If at least one number can not be parsed.
      */
@@ -590,7 +606,7 @@ search:     for (; fromIndex <= stopAt; 
      *
      * @param  values    The text containing the values to parse, or {@code null}.
      * @param  separator The delimiting character (typically the coma).
-     * @return The array of numbers parsed from the given string,
+     * @return The array of numbers parsed from the given text,
      *         or an empty array if {@code values} was null.
      * @throws NumberFormatException If at least one number can not be parsed.
      */
@@ -613,7 +629,7 @@ search:     for (; fromIndex <= stopAt; 
      * @param  values    The text containing the values to parse, or {@code null}.
      * @param  separator The delimiting character (typically the coma).
      * @param  radix     The radix to be used for parsing. This is usually 10.
-     * @return The array of numbers parsed from the given string,
+     * @return The array of numbers parsed from the given text,
      *         or an empty array if {@code values} was null.
      * @throws NumberFormatException If at least one number can not be parsed.
      */
@@ -635,7 +651,7 @@ search:     for (; fromIndex <= stopAt; 
      * @param  values    The text containing the values to parse, or {@code null}.
      * @param  separator The delimiting character (typically the coma).
      * @param  radix     The radix to be used for parsing. This is usually 10.
-     * @return The array of numbers parsed from the given string,
+     * @return The array of numbers parsed from the given text,
      *         or an empty array if {@code values} was null.
      * @throws NumberFormatException If at least one number can not be parsed.
      */
@@ -657,7 +673,7 @@ search:     for (; fromIndex <= stopAt; 
      * @param  values    The text containing the values to parse, or {@code null}.
      * @param  separator The delimiting character (typically the coma).
      * @param  radix     The radix to be used for parsing. This is usually 10.
-     * @return The array of numbers parsed from the given string,
+     * @return The array of numbers parsed from the given text,
      *         or an empty array if {@code values} was null.
      * @throws NumberFormatException If at least one number can not be parsed.
      */
@@ -679,7 +695,7 @@ search:     for (; fromIndex <= stopAt; 
      * @param  values    The text containing the values to parse, or {@code null}.
      * @param  separator The delimiting character (typically the coma).
      * @param  radix     The radix to be used for parsing. This is usually 10.
-     * @return The array of numbers parsed from the given string,
+     * @return The array of numbers parsed from the given text,
      *         or an empty array if {@code values} was null.
      * @throws NumberFormatException If at least one number can not be parsed.
      */
@@ -773,7 +789,7 @@ search:     for (; fromIndex <= stopAt; 
      *
      * @param  text The text from which to remove leading and trailing white spaces, or {@code null}.
      * @return A characters sequence with leading and trailing white spaces removed,
-     *         or {@code null} is the given string was null.
+     *         or {@code null} is the given text was null.
      *
      * @see String#trim()
      */
@@ -821,7 +837,7 @@ search:     for (; fromIndex <= stopAt; 
      *
      * <p>More specifically if the given value ends with a {@code '.'} character followed by a
      * sequence of {@code '0'} characters, then those characters are omitted. Otherwise this
-     * method returns the string unchanged. This is a "<cite>all or nothing</cite>" method:
+     * method returns the text unchanged. This is a "<cite>all or nothing</cite>" method:
      * either the fractional part is completely removed, or either it is left unchanged.</p>
      *
      * {@section Examples}
@@ -836,7 +852,7 @@ search:     for (; fromIndex <= stopAt; 
      *
      * @param  value The value to trim if possible, or {@code null}.
      * @return The value without the trailing {@code ".0"} part (if any),
-     *         or {@code null} if the given string was null.
+     *         or {@code null} if the given text was null.
      *
      * @see StringBuilders#trimFractionalPart(StringBuilder)
      */
@@ -861,7 +877,7 @@ search:     for (; fromIndex <= stopAt; 
      * a copy of {@code text} with some characters substituted by the {@code "(…)"} string.
      *
      * <p>If the text needs to be shortened, then this method tries to apply the above-cited
-     * substitution between two words. For example, the following string:</p>
+     * substitution between two words. For example, the following text:</p>
      *
      * <blockquote>
      *   "This sentence given as an example is way too long to be included in a short name."
@@ -1392,20 +1408,23 @@ cmp:    while (ia < lga) {
     }
 
     /**
-     * Returns {@code true} if the given string at the given offset contains the given part,
-     * in a case-sensitive comparison. This method is equivalent to the following code:
+     * Returns {@code true} if the given text at the given offset contains the given part,
+     * in a case-sensitive comparison. This method is equivalent to the following code,
+     * except that this method works on arbitrary {@link CharSequence} objects instead than
+     * {@link String}s only:
      *
      * {@preformat java
-     *     return string.regionMatches(offset, part, 0, part.length());
+     *     return text.regionMatches(offset, part, 0, part.length());
      * }
      *
-     * Except that this method works on arbitrary {@link CharSequence} objects instead than
-     * {@link String}s only.
+     * This method does not thrown {@code IndexOutOfBoundsException}. Instead if
+     * {@code fromIndex < 0} or {@code fromIndex + part.length() > text.length()},
+     * then this method returns {@code false}.
      *
      * @param text      The character sequence for which to tests for the presence of {@code part}.
      * @param fromIndex The offset in {@code text} where to test for the presence of {@code part}.
-     * @param part      The part which may be present in {@code string}.
-     * @return {@code true} if {@code string} contains {@code part} at the given {@code offset}.
+     * @param part      The part which may be present in {@code text}.
+     * @return {@code true} if {@code text} contains {@code part} at the given {@code offset}.
      * @throws NullPointerException if any of the arguments is null.
      *
      * @see String#regionMatches(int, String, int, int)
@@ -1415,8 +1434,8 @@ cmp:    while (ia < lga) {
             // It is okay to delegate to String implementation since we do not ignore cases.
             return ((String) text).regionMatches(fromIndex, (String) part, 0, part.length());
         }
-        final int length = part.length();
-        if (fromIndex + length > text.length()) {
+        final int length;
+        if (fromIndex < 0 || fromIndex + (length = part.length()) > text.length()) {
             return false;
         }
         for (int i=0; i<length; i++) {

Modified: sis/trunk/sis-utility/src/main/java/org/apache/sis/util/Exceptions.java
URL: http://svn.apache.org/viewvc/sis/trunk/sis-utility/src/main/java/org/apache/sis/util/Exceptions.java?rev=1411578&r1=1411577&r2=1411578&view=diff
==============================================================================
--- sis/trunk/sis-utility/src/main/java/org/apache/sis/util/Exceptions.java (original)
+++ sis/trunk/sis-utility/src/main/java/org/apache/sis/util/Exceptions.java Tue Nov 20 08:17:47 2012
@@ -20,8 +20,7 @@ import java.util.Set;
 import java.util.HashSet;
 import java.util.Locale;
 import java.sql.SQLException;
-import java.text.ParsePosition;
-import java.text.ParseException;
+import org.apache.sis.internal.util.LocalizedException;
 
 // Related to JDK7
 import org.apache.sis.internal.util.JDK7;
@@ -43,34 +42,6 @@ public final class Exceptions extends St
     }
 
     /**
-     * Creates a {@link ParseException} with a localized message built from the given parsing
-     * information. The exception returned by this method contains the error message in two
-     * languages:
-     *
-     * <ul>
-     *   <li>{@link ParseException#getMessage()} returns the message in the default locale.</li>
-     *   <li>{@link ParseException#getLocalizedMessage()} returns the message in the locale given
-     *       in argument to this method. This is usually the {@link java.text.Format} locale,
-     *       which is presumed to be the end-user locale.</li>
-     * </ul>
-     *
-     * @param  locale The locale for {@link ParseException#getLocalizedMessage()}.
-     * @param  type   The type of objects parsed by the {@link java.text.Format}.
-     * @param  text   The text that {@code Format} failed to parse.
-     * @param  pos    Index of the {@linkplain ParsePosition#getIndex() first parsed character},
-     *                together with the {@linkplain ParsePosition#getErrorIndex() error index}.
-     * @return The localized exception.
-     */
-    public static ParseException createParseException(final Locale locale, final Class<?> type,
-            final String text, final ParsePosition pos)
-    {
-        final int offset = pos.getIndex();
-        final int errorOffset = Math.max(offset, pos.getErrorIndex());
-        return new LocalizedParseException(locale,
-                LocalizedParseException.arguments(type, text, offset, errorOffset), errorOffset);
-    }
-
-    /**
      * Returns the message of the given exception, localized in the given locale if possible.
      * Some exceptions created by SIS can format a message in different locales. This method
      * will return such localized message if possible, or fallback on the standard

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=1411578&r1=1411577&r2=1411578&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 Nov 20 08:17:47 2012
@@ -30,10 +30,18 @@ import java.util.Locale;
 public interface Localized {
     /**
      * Returns the locale of the implemented service. Some implementations may return
-     * {@code null} if no locale is explicitly defined. In such case, the locale to use
-     * is typically the {@linkplain Locale#getDefault() default} locale.
+     * {@code null} if no locale is explicitly defined. The meaning of null locale is
+     * implementation-dependent, but typical interpretations are:
+     *
+     * <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>
+     * </ul>
      *
      * @return The locale, or {@code null} if not explicitly defined.
+     *
+     * @see org.apache.sis.io.CompoundFormat#getLocale()
      */
     Locale getLocale();
 }

Modified: sis/trunk/sis-utility/src/main/java/org/apache/sis/util/collection/CheckedContainer.java
URL: http://svn.apache.org/viewvc/sis/trunk/sis-utility/src/main/java/org/apache/sis/util/collection/CheckedContainer.java?rev=1411578&r1=1411577&r2=1411578&view=diff
==============================================================================
--- sis/trunk/sis-utility/src/main/java/org/apache/sis/util/collection/CheckedContainer.java (original)
+++ sis/trunk/sis-utility/src/main/java/org/apache/sis/util/collection/CheckedContainer.java Tue Nov 20 08:17:47 2012
@@ -34,5 +34,5 @@ public interface CheckedContainer<E> {
      *
      * @return The element type.
      */
-    Class<? extends E> getElementType();
+    Class<E> getElementType();
 }

Modified: sis/trunk/sis-utility/src/main/java/org/apache/sis/util/collection/Collections.java
URL: http://svn.apache.org/viewvc/sis/trunk/sis-utility/src/main/java/org/apache/sis/util/collection/Collections.java?rev=1411578&r1=1411577&r2=1411578&view=diff
==============================================================================
--- sis/trunk/sis-utility/src/main/java/org/apache/sis/util/collection/Collections.java (original)
+++ sis/trunk/sis-utility/src/main/java/org/apache/sis/util/collection/Collections.java Tue Nov 20 08:17:47 2012
@@ -40,8 +40,9 @@ import static java.util.Collections.unmo
  * <ul>
  *   <li>Null-safe {@link #isNullOrEmpty(Collection) isNullOrEmpty} method,
  *       for the convenience of classes using the <cite>lazy instantiation</cite> pattern.</li>
- *   <li>{@link #asCollection(Object) asCollection} for wrapping arbitrary objects to list or collection.</li>
- *   <li>List and collection {@linkplain #listComparator() comparators}.</li>
+ *   <li>{@link #toCollection(Object) toCollection} for wrapping or copying arbitrary objects to
+ *       list or collection.</li>
+ *   <li>List and sorted set {@linkplain #listComparator() comparators}.</li>
  *   <li>{@link #modifiableCopy(Collection) modifiableCopy} method for taking a snapshot of an arbitrary
  *       implementation into an unsynchronized, modifiable, in-memory object.</li>
  *   <li>{@link #unmodifiableOrCopy(Set) unmodifiableOrCopy} methods, which may be slightly more
@@ -157,6 +158,8 @@ public final class Collections extends S
      *         converter, or {@code null} if {@code storage} was null.
      *
      * @see org.apache.sis.util.ObjectConverters#derivedSet(Set, ObjectConverter)
+     *
+     * @category converter
      */
     public static <S,E> Set<E> derivedSet(final Set<S> storage, final ObjectConverter<S,E> converter) {
         ArgumentChecks.ensureNonNull("converter", converter);
@@ -201,6 +204,8 @@ public final class Collections extends S
      * @see org.apache.sis.util.ObjectConverters#derivedMap(Map, ObjectConverter, ObjectConverter)
      * @see org.apache.sis.util.ObjectConverters#derivedKeys(Map, ObjectConverter, Class)
      * @see org.apache.sis.util.ObjectConverters#derivedValues(Map, Class, ObjectConverter)
+     *
+     * @category converter
      */
     public static <SK,SV,K,V> Map<K,V> derivedMap(final Map<SK,SV> storage,
                                                   final ObjectConverter<SK,K> keyConverter,
@@ -225,6 +230,8 @@ public final class Collections extends S
      * @return A set containing the array elements, or {@code null} if the given array was null.
      *
      * @see java.util.Collections#unmodifiableSet(Set)
+     *
+     * @category converter
      */
     public static <E> Set<E> immutableSet(final E... array) {
         if (array == null) {
@@ -252,6 +259,8 @@ public final class Collections extends S
      * @param  <E>  The type of elements in the set.
      * @param  set  The set to make unmodifiable, or {@code null}.
      * @return A unmodifiable version of the given set, or {@code null} if the given set was null.
+     *
+     * @category converter
      */
     public static <E> Set<E> unmodifiableOrCopy(Set<E> set) {
         if (set != null) {
@@ -288,6 +297,8 @@ public final class Collections extends S
      * @param  <V>  The type of values in the map.
      * @param  map  The map to make unmodifiable, or {@code null}.
      * @return A unmodifiable version of the given map, or {@code null} if the given map was null.
+     *
+     * @category converter
      */
     public static <K,V> Map<K,V> unmodifiableOrCopy(Map<K,V> map) {
         if (map != null) {
@@ -328,6 +339,8 @@ public final class Collections extends S
      * @param  <E> The type of elements in the collection.
      * @param  collection The collection to copy, or {@code null}.
      * @return A copy of the given collection, or {@code null} if the given collection was null.
+     *
+     * @category converter
      */
     @SuppressWarnings("unchecked")
     public static <E> Collection<E> modifiableCopy(final Collection<E> collection) {
@@ -379,6 +392,8 @@ public final class Collections extends S
      * @param  <V> The type of values in the map.
      * @param  map The map to copy, or {@code null}.
      * @return A copy of the given map, or {@code null} if the given map was null.
+     *
+     * @category converter
      */
     @SuppressWarnings("unchecked")
     public static <K,V> Map<K,V> modifiableCopy(final Map<K,V> map) {
@@ -417,16 +432,18 @@ public final class Collections extends S
      * is not valid anymore after this method call since it has been used for the iteration.</p>
      *
      * <p>If the returned object needs to be a list, then this method can be chained
-     * with {@link #asList(Collection)} as below:</p>
+     * with {@link #toList(Collection)} as below:</p>
      *
      * {@preformat java
-     *     List<?> list = asList(asCollection(object));
+     *     List<?> list = toList(toCollection(object));
      * }
      *
      * @param  value The value to return as a collection, or {@code null}.
      * @return The value as a collection, or wrapped in a collection (never {@code null}).
+     *
+     * @category converter
      */
-    public static Collection<?> asCollection(final Object value) {
+    public static Collection<?> toCollection(final Object value) {
         if (value == null) {
             return emptyList();
         }
@@ -466,18 +483,20 @@ public final class Collections extends S
      *   <li>Otherwise the elements are copied in a new list, which is returned.</li>
      * </ul>
      *
-     * This method can be chained with {@link #asCollection(Object)}
+     * This method can be chained with {@link #toCollection(Object)}
      * for handling a wider range of types:
      *
      * {@preformat java
-     *     List<?> list = asList(asCollection(object));
+     *     List<?> list = toList(toCollection(object));
      * }
      *
      * @param  <T> The type of elements in the given collection.
      * @param  collection The collection to cast or copy to a list.
      * @return The given collection as a list, or a copy of the given collection.
+     *
+     * @category converter
      */
-    public static <T> List<T> asList(final Collection<T> collection) {
+    public static <T> List<T> toList(final Collection<T> collection) {
         if (collection instanceof List<?>) {
             return (List<T>) collection;
         }
@@ -485,38 +504,45 @@ public final class Collections extends S
     }
 
     /**
-     * The comparator to be returned by {@code #listComparator} and similar methods. Can not be
-     * public because of parameterized types: we need a method for casting to the expected type.
-     * This is the same trick than {@link Collections#emptySet()} for example.
+     * The comparator to be returned by {@link Collections#listComparator()} and similar methods.
      */
-    @SuppressWarnings("rawtypes")
-    private static final class Compare implements Comparator<Collection<Comparable>>, Serializable {
+    private static final class Compare<T extends Comparable<T>>
+            implements Comparator<Collection<T>>, Serializable
+    {
+        /**
+         * For cross-version compatibility.
+         */
+        private static final long serialVersionUID = -8926770873102046405L;
+
         /**
-         * The unique instance.
+         * The unique instance. Can not be public because of parameterized types: we need a method
+         * for casting to the expected type. This is the same trick than the one used by the JDK
+         * in the {@link Collections#emptySet()} method for instance.
          */
-        static final Comparator<Collection<Comparable>> INSTANCE = new Compare();
+        @SuppressWarnings("rawtypes")
+        static final Comparator INSTANCE = new Compare();
 
         /**
-         * For cross-version compatibility.
+         * Do not allow instantiation other than the unique {@link #INSTANCE}.
          */
-        private static final long serialVersionUID = -8926770873102046405L;
+        private Compare() {
+        }
 
         /**
-         * Compares to collections of comparable objects.
+         * Compares two collections of comparable objects.
          */
         @Override
-        @SuppressWarnings("unchecked")
-        public int compare(final Collection<Comparable> c1, final Collection<Comparable> c2) {
-            final Iterator<Comparable> i1 = c1.iterator();
-            final Iterator<Comparable> i2 = c2.iterator();
+        public int compare(final Collection<T> c1, final Collection<T> c2) {
+            final Iterator<T> i1 = c1.iterator();
+            final Iterator<T> i2 = c2.iterator();
             int c;
             do {
                 final boolean h1 = i1.hasNext();
                 final boolean h2 = i2.hasNext();
                 if (!h1) return h2 ? -1 : 0;
                 if (!h2) return +1;
-                final Comparable e1 = i1.next();
-                final Comparable e2 = i2.next();
+                final T e1 = i1.next();
+                final T e2 = i2.next();
                 c = e1.compareTo(e2);
             } while (c == 0);
             return c;
@@ -524,8 +550,8 @@ public final class Collections extends S
     };
 
     /**
-     * Returns a comparator for lists of comparable elements. The first element of each list
-     * are {@linkplain Comparable#compareTo compared}. If one is <cite>greater than</cite> or
+     * Returns a comparator for lists of comparable elements. The first element of each list are
+     * {@linkplain Comparable#compareTo(Object) compared}. If one is <cite>greater than</cite> or
      * <cite>less than</cite> the other, the result of that comparison is returned. Otherwise
      * the second element are compared, and so on until either non-equal elements are found,
      * or end-of-list are reached. In the later case, the shortest list is considered
@@ -536,38 +562,91 @@ public final class Collections extends S
      *
      * @param  <T> The type of elements in both lists.
      * @return The ordering between two lists.
+     *
+     * @category comparator
      */
-    @SuppressWarnings({"unchecked","rawtypes"})
+    @SuppressWarnings("unchecked")
     public static <T extends Comparable<T>> Comparator<List<T>> listComparator() {
-        return (Comparator) Compare.INSTANCE;
+        return Compare.INSTANCE;
     }
 
     /**
-     * Returns a comparator for sorted sets of comparable elements. The elements are compared in
-     * iteration order as for the {@linkplain #listComparator list comparator}.
+     * Returns a comparator for sorted sets of comparable elements. The first element of each set
+     * are {@linkplain Comparable#compareTo(Object) compared}. If one is <cite>greater than</cite>
+     * or <cite>less than</cite> the other, the result of that comparison is returned. Otherwise
+     * the second element are compared, and so on until either non-equal elements are found,
+     * or end-of-set are reached. In the later case, the smallest set is considered
+     * <cite>less than</cite> the largest one.
+     *
+     * {@note There is no method accepting an arbitrary <code>Set</code> or <code>Collection</code>
+     *        argument because this comparator makes sense only for collections having determinist
+     *        iteration order.}
      *
      * @param <T> The type of elements in both sets.
      * @return The ordering between two sets.
+     *
+     * @category comparator
      */
-    @SuppressWarnings({"unchecked","rawtypes"})
+    @SuppressWarnings("unchecked")
     public static <T extends Comparable<T>> Comparator<SortedSet<T>> sortedSetComparator() {
-        return (Comparator) Compare.INSTANCE;
+        return Compare.INSTANCE;
     }
 
     /**
-     * Returns a comparator for arbitrary collections of comparable elements. The elements are
-     * compared in iteration order as for the {@linkplain #listComparator list comparator}.
+     * The comparator to be returned by {@link Collections#valueComparator()}.
+     */
+    private static final class ValueComparator<K,V extends Comparable<V>>
+            implements Comparator<Map.Entry<K,V>>, Serializable
+    {
+        /**
+         * For cross-version compatibility.
+         */
+        private static final long serialVersionUID = 3809610984070771228L;
+
+        /**
+         * The unique instance. Can not be public because of parameterized types: we need a method
+         * for casting to the expected type. This is the same trick than the one used by the JDK
+         * in the {@link Collections#emptySet()} method for instance.
+         */
+        @SuppressWarnings("rawtypes")
+        static final ValueComparator INSTANCE = new ValueComparator();
+
+        /**
+         * Do not allow instantiation other than the unique {@link #INSTANCE}.
+         */
+        private ValueComparator() {
+        }
+
+        /**
+         * Compares the values of two entries.
+         */
+        @Override
+        public int compare(final Map.Entry<K,V> e1, final Map.Entry<K,V> e2) {
+            return e1.getValue().compareTo(e2.getValue());
+        }
+    }
+
+    /**
+     * 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
+     *     return e1.getValue().compareTo(e2.getValue());
+     * }
      *
-     * <p><em>This comparator make sense only for collections having determinist order</em>
-     * like {@link java.util.TreeSet}, {@link java.util.LinkedHashSet} or queues.
-     * Do <strong>not</strong> use it with {@link java.util.HashSet}.</p>
+     * This comparator can be used as a complement to {@link SortedSet}. While {@code SortedSet}
+     * maintains keys ordering at all time, {@code valueComparator()} is typically used only at
+     * the end of a process in which the values are the numerical calculation results.
+     *
+     * @param <K> The type of keys in the map entries.
+     * @param <V> The type of values in the map entries.
+     * @return A comparator for the values of the given type.
      *
-     * @param <T> The type of elements in both collections.
-     * @return The ordering between two collections.
+     * @category comparator
      */
-    @SuppressWarnings({"unchecked","rawtypes"})
-    public static <T extends Comparable<T>> Comparator<Collection<T>> collectionComparator() {
-        return (Comparator) Compare.INSTANCE;
+    @SuppressWarnings("unchecked")
+    public static <K,V extends Comparable<V>> Comparator<Map.Entry<K,V>> valueComparator() {
+        return ValueComparator.INSTANCE;
     }
 
     /**

Modified: sis/trunk/sis-utility/src/main/java/org/apache/sis/util/collection/DerivedSet.java
URL: http://svn.apache.org/viewvc/sis/trunk/sis-utility/src/main/java/org/apache/sis/util/collection/DerivedSet.java?rev=1411578&r1=1411577&r2=1411578&view=diff
==============================================================================
--- sis/trunk/sis-utility/src/main/java/org/apache/sis/util/collection/DerivedSet.java (original)
+++ sis/trunk/sis-utility/src/main/java/org/apache/sis/util/collection/DerivedSet.java Tue Nov 20 08:17:47 2012
@@ -238,7 +238,7 @@ class DerivedSet<S,E> extends AbstractSe
          */
         @Override
         public final boolean contains(final Object element) {
-            final Class<? extends E> type = getElementType();
+            final Class<E> type = getElementType();
             return type.isInstance(element) && storage.contains(inverse.convert(type.cast(element)));
         }
 
@@ -258,7 +258,7 @@ class DerivedSet<S,E> extends AbstractSe
          */
         @Override
         public final boolean remove(final Object element) throws UnsupportedOperationException {
-            final Class<? extends E> type = getElementType();
+            final Class<E> type = getElementType();
             return type.isInstance(element) && storage.remove(inverse.convert(type.cast(element)));
         }
     }

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=1411578&r1=1411577&r2=1411578&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 Nov 20 08:17:47 2012
@@ -46,6 +46,16 @@ public final class Errors extends Indexe
         }
 
         /**
+         * Value “{0}” is duplicated.
+         */
+        public static final int DuplicatedValue_1 = 38;
+
+        /**
+         * Element “{0}” is already present.
+         */
+        public static final int ElementAlreadyPresent_1 = 36;
+
+        /**
          * Argument ‘{0}’ shall not be empty.
          */
         public static final int EmptyArgument_1 = 1;
@@ -107,6 +117,11 @@ public final class Errors extends Indexe
         public static final int InconsistentAttribute_2 = 27;
 
         /**
+         * Inconsistent table columns.
+         */
+        public static final int InconsistentTableColumns = 40;
+
+        /**
          * Index {0} is out of bounds.
          */
         public static final int IndexOutOfBounds_1 = 4;
@@ -127,6 +142,26 @@ public final class Errors extends Indexe
         public static final int NegativeArgument_2 = 8;
 
         /**
+         * Node “{0}” can not be a child of itself.
+         */
+        public static final int NodeChildOfItself_1 = 37;
+
+        /**
+         * Node “{0}” already has another parent.
+         */
+        public static final int NodeHasAnotherParent_1 = 35;
+
+        /**
+         * Node “{0}” has no parent.
+         */
+        public static final int NodeHasNoParent_1 = 34;
+
+        /**
+         * No “{0}” node found.
+         */
+        public static final int NodeNotFound_1 = 39;
+
+        /**
          * Argument ‘{0}’ shall not be NaN (Not-a-Number).
          */
         public static final int NotANumber_1 = 9;
@@ -192,6 +227,11 @@ public final class Errors extends Indexe
         public static final int UnparsableStringForClass_3 = 32;
 
         /**
+         * No format is specified for objects of class ‘{0}’.
+         */
+        public static final int UnspecifiedFormatForClass_1 = 41;
+
+        /**
          * Can not handle instances of ‘{0}’ because arbitrary implementations are not yet supported.
          */
         public static final int UnsupportedImplementation_1 = 28;

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=1411578&r1=1411577&r2=1411578&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 Nov 20 08:17:47 2012
@@ -14,6 +14,8 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 #
+DuplicatedValue_1               = Value \u201c{0}\u201d is duplicated.
+ElementAlreadyPresent_1         = Element \u201c{0}\u201d is already present.
 EmptyArgument_1                 = Argument \u2018{0}\u2019 shall not be empty.
 ForbiddenAttribute_2            = Attribute \u201c{0}\u201d is not allowed for an object of type \u2018{1}\u2019.
 IllegalArgument_1               = Illegal value for argument \u2018{0}\u2019.
@@ -26,10 +28,15 @@ IllegalFormatPatternForClass_2  = The \u
 IllegalLanguageCode_1           = The \u201c{0}\u201d language is not recognized.
 IllegalRange_2                  = Range [{0} \u2026 {1}] is not valid.
 InconsistentAttribute_2         = Value \u201c{1}\u201d of attribute \u2018{0}\u2019 is inconsistent with other attributes.
+InconsistentTableColumns        = Inconsistent table columns.
 IndexOutOfBounds_1              = Index {0} is out of bounds.
 KeyCollision_1                  = A different value is already associated to the \u201c{0}\u201d key.
 MandatoryAttribute_2            = Attribute \u201c{0}\u201d is mandatory for an object of type \u2018{1}\u2019.
 NegativeArgument_2              = Argument \u2018{0}\u2019 shall not be negative. The given value was {1}.
+NodeChildOfItself_1             = Node \u201c{0}\u201d can not be a child of itself.
+NodeHasAnotherParent_1          = Node \u201c{0}\u201d already has another parent.
+NodeHasNoParent_1               = Node \u201c{0}\u201d has no parent.
+NodeNotFound_1                  = No \u201c{0}\u201d node found.
 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.
 NullArgument_1                  = Argument \u2018{0}\u2019 shall not be null.
@@ -43,6 +50,7 @@ UnmodifiableMetadata            = This m
 UnmodifiableObject_1            = Object \u2018{0}\u2019 is unmodifiable.
 UnparsableStringForClass_2      = Text \u201c{1}\u201d can not be parsed as an object of type \u2018{0}\u2019.
 UnparsableStringForClass_3      = Text \u201c{1}\u201d can not be parsed as an object of type \u2018{0}\u2019, because of the \u201c{2}\u201d characters.
+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.
 ValueAlreadyDefined_1           = A value is already defined for \u201c{0}\u201d.



Mime
View raw message