sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1457601 [2/2] - in /sis/trunk: ./ ide-project/NetBeans/ sis-metadata/src/main/java/org/apache/sis/metadata/ sis-metadata/src/main/java/org/apache/sis/metadata/iso/ sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/ sis-metada...
Date Sun, 17 Mar 2013 23:53:55 GMT
Modified: sis/trunk/sis-utility/src/main/java/org/apache/sis/util/Numbers.java
URL: http://svn.apache.org/viewvc/sis/trunk/sis-utility/src/main/java/org/apache/sis/util/Numbers.java?rev=1457601&r1=1457600&r2=1457601&view=diff
==============================================================================
--- sis/trunk/sis-utility/src/main/java/org/apache/sis/util/Numbers.java [UTF-8] (original)
+++ sis/trunk/sis-utility/src/main/java/org/apache/sis/util/Numbers.java [UTF-8] Sun Mar 17 23:53:53 2013
@@ -26,10 +26,11 @@ import java.util.Collections;
 import java.lang.reflect.Array;
 import java.math.BigDecimal;
 import java.math.BigInteger;
-
 import org.apache.sis.util.resources.Errors;
 import org.apache.sis.util.collection.CollectionsExt;
 
+import static java.lang.Double.doubleToLongBits;
+
 
 /**
  * Static methods working with {@link Number} objects, and a few primitive types by extension.
@@ -46,8 +47,8 @@ public final class Numbers extends Stati
      * Constant of value {@value} used in {@code switch} statements or as index in arrays.
      */
     public static final byte
+            BIG_DECIMAL=10, BIG_INTEGER=9,
             DOUBLE=8, FLOAT=7, LONG=6, INTEGER=5, SHORT=4, BYTE=3, CHARACTER=2, BOOLEAN=1, OTHER=0;
-    // Note: This class assumes that DOUBLE is the greatest public constant.
 
     /**
      * Mapping between a primitive type and its wrapper, if any.
@@ -62,8 +63,8 @@ public final class Numbers extends Stati
      */
     private static final Map<Class<?>,Numbers> MAPPING = new IdentityHashMap<Class<?>,Numbers>(16);
     static {
-        new Numbers(BigDecimal.class, true, false, (byte) (DOUBLE+2)); // Undocumented enum.
-        new Numbers(BigInteger.class, false, true, (byte) (DOUBLE+1)); // Undocumented enum.
+        new Numbers(BigDecimal.class, true, false, BIG_DECIMAL);
+        new Numbers(BigInteger.class, false, true, BIG_INTEGER);
         new Numbers(Double   .TYPE, Double   .class, true,  false, (byte) Double   .SIZE, DOUBLE,    'D', Double   .valueOf(Double.NaN));
         new Numbers(Float    .TYPE, Float    .class, true,  false, (byte) Float    .SIZE, FLOAT,     'F', Float    .valueOf(Float .NaN));
         new Numbers(Long     .TYPE, Long     .class, false, true,  (byte) Long     .SIZE, LONG,      'J', Long     .valueOf(        0L));
@@ -304,7 +305,7 @@ public final class Numbers extends Stati
             throws IllegalArgumentException
     {
         return narrowestClass((n1 != null) ? n1.getClass() : null,
-                           (n2 != null) ? n2.getClass() : null);
+                              (n2 != null) ? n2.getClass() : null);
     }
 
     /**
@@ -350,148 +351,116 @@ public final class Numbers extends Stati
     }
 
     /**
-     * Returns the smallest class capable to hold the specified value. If the given value is
-     * {@code null}, then this method returns {@code null}. Otherwise this method delegates
-     * to {@link #narrowestClass(double)} or {@link #narrowestClass(long)} depending on the value type.
-     *
-     * @param  value The value to be wrapped in a finer (if possible) {@link Number}.
-     * @return The narrowest type capable to hold the given value.
-     *
-     * @see #narrowestNumber(Number)
-     */
-    public static Class<? extends Number> narrowestClass(final Number value) {
-        if (value == null) {
-            return null;
-        }
-        if (isPrimitiveInteger(value.getClass())) {
-            return narrowestClass(value.longValue());
-        } else {
-            return narrowestClass(value.doubleValue());
-        }
-    }
-
-    /**
-     * Returns the smallest class capable to hold the specified value.
-     * This is similar to {@link #narrowestClass(long)}, but extended to floating point values.
-     *
-     * @param  value The value to be wrapped in a {@link Number}.
-     * @return The narrowest type capable to hold the given value.
-     *
-     * @see #narrowestNumber(double)
-     */
-    public static Class<? extends Number> narrowestClass(final double value) {
-        final long lg = (long) value;
-        if (value == lg) {
-            return narrowestClass(lg);
-        }
-        final float fv = (float) value;
-        if (Double.doubleToRawLongBits(value) == Double.doubleToRawLongBits(fv)) {
-            return Float.class;
-        }
-        return Double.class;
-    }
-
-    /**
      * Returns the smallest class capable to hold the specified value.
-     * This method makes the following choice:
+     * This method applies the following choices, in that order:
      *
      * <ul>
-     *   <li>If the given value is between {@value java.lang.Byte#MIN_VALUE} and
+     *   <li>If the given value is {@code null}, then this method returns {@code null}.</li>
+     *   <li>Otherwise if the given value can not be casted from {@code double} to an other type
+     *       without precision lost, return {@code Double.class}.</li>
+     *   <li>Otherwise if the given value can not be casted from {@code float} to an other type
+     *       without precision lost, return {@code Float.class}.</li>
+     *   <li>Otherwise if the given value is between {@value java.lang.Byte#MIN_VALUE} and
      *       {@value java.lang.Byte#MAX_VALUE}, then this method returns {@code Byte.class};</li>
-     *   <li>If the given value is between {@value java.lang.Short#MIN_VALUE} and
+     *   <li>Otherwise if the given value is between {@value java.lang.Short#MIN_VALUE} and
      *       {@value java.lang.Short#MAX_VALUE}, then this method returns {@code Short.class};</li>
-     *   <li>If the given value is between {@value java.lang.Integer#MIN_VALUE} and
+     *   <li>Otherwise if the given value is between {@value java.lang.Integer#MIN_VALUE} and
      *       {@value java.lang.Integer#MAX_VALUE}, then this method returns {@code Integer.class};</li>
      *   <li>Otherwise this method returns {@code Long.class};</li>
      * </ul>
      *
-     * @param  value The value to be wrapped in a {@link Number}.
+     * @param  value The value to be wrapped in a finer (if possible) {@link Number}.
      * @return The narrowest type capable to hold the given value.
      *
-     * @see #narrowestNumber(long)
+     * @see #narrowestNumber(Number)
      */
-    public static Class<? extends Number> narrowestClass(final long value) {
-        // Tests MAX_VALUE before MIN_VALUE because it is more likely to fail.
-        if (value <= Byte   .MAX_VALUE  &&  value >= Byte   .MIN_VALUE) return Byte.class;
-        if (value <= Short  .MAX_VALUE  &&  value >= Short  .MIN_VALUE) return Short.class;
-        if (value <= Integer.MAX_VALUE  &&  value >= Integer.MIN_VALUE) return Integer.class;
-        return Long.class;
+    @SuppressWarnings("fallthrough")
+    public static Class<? extends Number> narrowestClass(final Number value) {
+        if (value == null) {
+            return null;
+        }
+        boolean isFloat = false;
+        final long longValue = value.longValue();
+        switch (getEnumConstant(value.getClass())) {
+            default: {
+                final double doubleValue = value.doubleValue();
+                final float  floatValue  = (float) doubleValue;
+                isFloat = (doubleToLongBits(floatValue) == doubleToLongBits(doubleValue));
+                if (doubleValue != longValue) {
+                    return isFloat ? Float.class : Double.class;
+                }
+                // Fall through.
+            }
+            case LONG:    if (((int)   longValue) != longValue) return isFloat ? Float.class : Long.class;
+            case INTEGER: if (((short) longValue) != longValue) return Integer.class;
+            case SHORT:   if (((byte)  longValue) != longValue) return Short  .class;
+            case BYTE:    return Byte.class;
+        }
     }
 
     /**
-     * Returns the number of the smallest class capable to hold the specified value. If the
-     * given value is {@code null}, then this method returns {@code null}. Otherwise this
-     * method delegates to {@link #narrowestNumber(double)} or {@link #narrowestNumber(long)}
-     * depending on the value type.
+     * Returns the given number wrapped in the smallest class capable to hold the specified value.
+     * This method is equivalent to the following code, in a slightly more efficient way:
+     *
+     * {@preformat java
+     *     return cast(value, narrowestClass(value));
+     * }
      *
      * @param  value The value to be wrapped in a finer (if possible) {@link Number}.
      * @return The narrowest type capable to hold the given value.
      *
      * @see #narrowestClass(Number)
+     * @see #cast(Number, Class)
      */
+    @SuppressWarnings("fallthrough")
     public static Number narrowestNumber(final Number value) {
         if (value == null) {
             return null;
         }
         final Number candidate;
-        if (isPrimitiveInteger(value.getClass())) {
-            candidate = narrowestNumber(value.longValue());
-        } else {
-            candidate = narrowestNumber(value.doubleValue());
+        boolean isFloat = false;
+        final long longValue = value.longValue();
+        switch (getEnumConstant(value.getClass())) {
+            default: {
+                final double doubleValue = value.doubleValue();
+                final float  floatValue  = (float) doubleValue;
+                isFloat = (doubleToLongBits(floatValue) == doubleToLongBits(doubleValue));
+                if (doubleValue != longValue) {
+                    candidate = isFloat ? ((Number) Float .valueOf(floatValue))
+                                        : ((Number) Double.valueOf(doubleValue));
+                    break;
+                }
+                // Fall through everywhere.
+            }
+            case LONG: {
+                if (((int) longValue) != longValue) {
+                    candidate = isFloat ? ((Number) Float.valueOf((float) longValue))
+                                        : ((Number) Long.valueOf(longValue));
+                    break;
+                }
+            }
+            case INTEGER: {
+                if (((short) longValue) != longValue) {
+                    candidate = Integer.valueOf((int) longValue);
+                    break;
+                }
+            }
+            case SHORT: {
+                if (((byte) longValue) != longValue) {
+                    candidate = Short.valueOf((short) longValue);
+                    break;
+                }
+            }
+            case BYTE: {
+                candidate = Byte.valueOf((byte) longValue);
+                break;
+            }
         }
         // Keep the existing instance if possible.
         return value.equals(candidate) ? value : candidate;
     }
 
     /**
-     * Returns the number of the smallest class capable to hold the specified value.
-     * This is similar to {@link #narrowestNumber(long)}, but extended to floating point values.
-     *
-     * @param  value The value to be wrapped in a {@link Number}.
-     * @return The narrowest type capable to hold the given value.
-     *
-     * @see #narrowestClass(double)
-     */
-    public static Number narrowestNumber(final double value) {
-        final long lg = (long) value;
-        if (value == lg) {
-            return narrowestNumber(lg);
-        }
-        final float fv = (float) value;
-        if (Double.doubleToRawLongBits(value) == Double.doubleToRawLongBits(fv)) {
-            return Float.valueOf(fv);
-        }
-        return Double.valueOf(value);
-    }
-
-    /**
-     * Returns the number of the smallest type capable to hold the specified value.
-     * This method makes the following choice:
-     *
-     * <ul>
-     *   <li>If the given value is between {@value java.lang.Byte#MIN_VALUE} and
-     *       {@value java.lang.Byte#MAX_VALUE}, then it is wrapped in a {@link Byte} object.</li>
-     *   <li>If the given value is between {@value java.lang.Short#MIN_VALUE} and
-     *       {@value java.lang.Short#MAX_VALUE}, then it is wrapped in a {@link Short} object.</li>
-     *   <li>If the given value is between {@value java.lang.Integer#MIN_VALUE} and
-     *       {@value java.lang.Integer#MAX_VALUE}, then it is wrapped in an {@link Integer} object.</li>
-     *   <li>Otherwise the value is wrapped in a {@link Long} object.</li>
-     * </ul>
-     *
-     * @param  value The value to be wrapped in a {@link Number}.
-     * @return The given value as a number of the narrowest type capable to hold it.
-     *
-     * @see #narrowestClass(long)
-     */
-    public static Number narrowestNumber(final long value) {
-        // Tests MAX_VALUE before MIN_VALUE because it is more likely to fail.
-        if (value <= Byte   .MAX_VALUE  &&  value >= Byte   .MIN_VALUE) return Byte   .valueOf((byte)  value);
-        if (value <= Short  .MAX_VALUE  &&  value >= Short  .MIN_VALUE) return Short  .valueOf((short) value);
-        if (value <= Integer.MAX_VALUE  &&  value >= Integer.MIN_VALUE) return Integer.valueOf((int)   value);
-        return Long.valueOf(value);
-    }
-
-    /**
      * Returns the smallest number capable to hold the specified value.
      *
      * @param  value The value to be wrapped in a {@link Number}.
@@ -499,11 +468,10 @@ public final class Numbers extends Stati
      * @throws NumberFormatException if the given value can not be parsed as a number.
      *
      * @see #narrowestNumber(Number)
-     * @see #narrowestNumber(double)
-     * @see #narrowestNumber(long)
      */
-    public static Number narrowestNumber(String value) throws NumberFormatException {
-        value = CharSequences.trimWhitespaces(value);
+    public static Number narrowestNumber(final String value) throws NumberFormatException {
+        // Do not trim whitespaces. It is up to the caller to do that if he wants.
+        // For such low level function, we are better to avoid hidden initiative.
         final int length = value.length();
         for (int i=0; i<length; i++) {
             final char c = value.charAt(i);
@@ -516,7 +484,8 @@ public final class Numbers extends Stati
 
     /**
      * Casts a number to the specified class. The class must by one of {@link Byte},
-     * {@link Short}, {@link Integer}, {@link Long}, {@link Float} or {@link Double}.
+     * {@link Short}, {@link Integer}, {@link Long}, {@link Float}, {@link Double},
+     * {@link BigInteger} or {@link BigDecimal}.
      * This method makes the following choice:
      *
      * <ul>
@@ -527,10 +496,6 @@ public final class Numbers extends Stati
      *   <li>And likewise for all remaining known types.</li>
      * </ul>
      *
-     * {@note This method is intentionally restricted to primitive types. Other types
-     *        like <code>BigDecimal</code> are not the purpose of this method.
-     *        See <code>ObjectConverter</code> for more generic methods.}
-     *
      * This method does not verify if the given type is wide enough for the given value,
      * because the type has typically been calculated by {@link #widestClass(Class, Class)}
      * or {@link #narrowestClass(Number)}. If nevertheless the given type is not wide enough,
@@ -551,20 +516,51 @@ public final class Numbers extends Stati
         if (number == null || number.getClass() == type) {
             return (N) number;
         }
-        if (type == Double .class) return (N) Double .valueOf(number.doubleValue());
-        if (type == Float  .class) return (N) Float  .valueOf(number. floatValue());
-        if (type == Long   .class) return (N) Long   .valueOf(number.  longValue());
-        if (type == Integer.class) return (N) Integer.valueOf(number.   intValue());
-        if (type == Short  .class) return (N) Short  .valueOf(number. shortValue());
-        if (type == Byte   .class) return (N) Byte   .valueOf(number.  byteValue());
-        throw unknownType(type);
+        switch (getEnumConstant(type)) {
+            case BYTE:    return (N) Byte   .valueOf(number.  byteValue());
+            case SHORT:   return (N) Short  .valueOf(number. shortValue());
+            case INTEGER: return (N) Integer.valueOf(number.   intValue());
+            case LONG:    return (N) Long   .valueOf(number.  longValue());
+            case FLOAT:   return (N) Float  .valueOf(number. floatValue());
+            case DOUBLE:  return (N) Double .valueOf(number.doubleValue());
+            case BIG_INTEGER: {
+                final BigInteger c;
+                if (number instanceof BigInteger) {
+                    c = (BigInteger) number;
+                } else if (number instanceof BigDecimal) {
+                    c = ((BigDecimal) number).toBigInteger();
+                } else {
+                    c = BigInteger.valueOf(number.longValue());
+                }
+                return (N) c;
+            }
+            case BIG_DECIMAL: {
+                final BigDecimal c;
+                if (number instanceof BigDecimal) {
+                    c = (BigDecimal) number;
+                } else if (number instanceof BigInteger) {
+                    c = new BigDecimal((BigInteger) number);
+                } else if (isInteger(number.getClass())) {
+                    c = BigDecimal.valueOf(number.longValue());
+                } else {
+                    c = BigDecimal.valueOf(number.doubleValue());
+                }
+                return (N) c;
+            }
+            default: {
+                if (type.isInstance(number)) {
+                    return (N) number;
+                }
+                throw unknownType(type);
+            }
+        }
     }
 
     /**
      * Wraps the given value in a {@code Number} of the specified class.
-     * The given type shall be one of {@link Byte}, {@link Short}, {@link Integer},
-     * {@link Long}, {@link Float} or {@link Double} classes. Furthermore, the given
-     * value shall be convertible to the given class without precision lost,
+     * The given type shall be one of {@link Byte}, {@link Short}, {@link Integer}, {@link Long},
+     * {@link Float}, {@link Double}, {@link BigInteger} and {@link BigDecimal} classes.
+     * Furthermore, the given value shall be convertible to the given class without precision lost,
      * otherwise an {@link IllegalArgumentException} will be thrown.
      *
      * @param  <N> The wrapper class.
@@ -580,14 +576,18 @@ public final class Numbers extends Stati
             throws IllegalArgumentException
     {
         final N number;
-             if (type == Double .class) return   (N) Double .valueOf(value); // No need to verify.
-        else if (type == Float  .class) number = (N) Float  .valueOf((float) value);
-        else if (type == Long   .class) number = (N) Long   .valueOf((long)  value);
-        else if (type == Integer.class) number = (N) Integer.valueOf((int)   value);
-        else if (type == Short  .class) number = (N) Short  .valueOf((short) value);
-        else if (type == Byte   .class) number = (N) Byte   .valueOf((byte)  value);
-        else throw unknownType(type);
-        if (Double.doubleToLongBits(number.doubleValue()) != Double.doubleToLongBits(value)) {
+        switch (getEnumConstant(type)) {
+            case BYTE:        number = (N) Byte      .valueOf((byte)  value); break;
+            case SHORT:       number = (N) Short     .valueOf((short) value); break;
+            case INTEGER:     number = (N) Integer   .valueOf((int)   value); break;
+            case LONG:        number = (N) Long      .valueOf((long)  value); break;
+            case FLOAT:       number = (N) Float     .valueOf((float) value); break;
+            case DOUBLE:      return   (N) Double    .valueOf(value); // No need to verify.
+            case BIG_INTEGER: number = (N) BigInteger.valueOf((long) value); break;
+            case BIG_DECIMAL: return   (N) BigDecimal.valueOf(value); // No need to verify.
+            default: throw unknownType(type);
+        }
+        if (doubleToLongBits(number.doubleValue()) != doubleToLongBits(value)) {
             throw new IllegalArgumentException(Errors.format(Errors.Keys.CanNotConvertValue_2, value, type));
         }
         return number;
@@ -595,6 +595,7 @@ public final class Numbers extends Stati
 
     /**
      * Converts the specified string into a value object. The value object can be an instance of
+     * {@link BigDecimal}, {@link BigInteger},
      * {@link Double}, {@link Float}, {@link Long}, {@link Integer}, {@link Short}, {@link Byte},
      * {@link Boolean}, {@link Character} or {@link String} according the specified type. This
      * method makes the following choice:
@@ -607,11 +608,6 @@ public final class Numbers extends Stati
      *   <li>And likewise for all remaining known types.</li>
      * </ul>
      *
-     * {@note This method is intentionally restricted to primitive types, with the addition of
-     *        <code>String</code> which can be though as an identity operation. Other types
-     *        like <code>BigDecimal</code> are not the purpose of this method. See the
-     *        <code>ConverterRegistry</code> class for a more generic method.}
-     *
      * @param  <T> The requested type.
      * @param  value the value to parse.
      * @param  type The requested type.
@@ -621,31 +617,36 @@ public final class Numbers extends Stati
      *         string value is not parseable as a number of the specified type.
      */
     @SuppressWarnings("unchecked")
-    public static <T> T valueOf(String value, final Class<T> type)
+    public static <T> T valueOf(final String value, final Class<T> type)
             throws IllegalArgumentException, NumberFormatException
     {
         if (value == null || type == String.class) {
             return (T) value;
         }
-        if (type == Character.class) {
-            /*
-             * If the string is empty, returns 0 which means "end of string" in C/C++
-             * and NULL in Unicode standard. If non-empty, take only the first char.
-             * This is somewhat consistent with Boolean.valueOf(...) which is quite
-             * lenient about the parsing as well, and throwing a NumberFormatException
-             * for those would not be appropriate.
-             */
-            return (T) Character.valueOf(value.isEmpty() ? 0 : value.charAt(0));
-        }
-        value = CharSequences.trimWhitespaces(value);
-        if (type == Double .class) return (T) Double .valueOf(value);
-        if (type == Float  .class) return (T) Float  .valueOf(value);
-        if (type == Long   .class) return (T) Long   .valueOf(value);
-        if (type == Integer.class) return (T) Integer.valueOf(value);
-        if (type == Short  .class) return (T) Short  .valueOf(value);
-        if (type == Byte   .class) return (T) Byte   .valueOf(value);
-        if (type == Boolean.class) return (T) Boolean.valueOf(value);
-        throw unknownType(type);
+        switch (getEnumConstant(type)) {
+            case CHARACTER: {
+                /*
+                 * If the string is empty, returns 0 which means "end of string" in C/C++
+                 * and NULL in Unicode standard. If non-empty, take only the first char.
+                 * This is somewhat consistent with Boolean.valueOf(...) which is quite
+                 * lenient about the parsing as well, and throwing a NumberFormatException
+                 * for those would not be appropriate.
+                 */
+                return (T) Character.valueOf(value.isEmpty() ? 0 : value.charAt(0));
+            }
+            // Do not trim whitespaces. It is up to the caller to do that if he wants.
+            // For such low level function, we are better to avoid hidden initiative.
+            case BOOLEAN:     return (T) Boolean.valueOf(value);
+            case BYTE:        return (T) Byte   .valueOf(value);
+            case SHORT:       return (T) Short  .valueOf(value);
+            case INTEGER:     return (T) Integer.valueOf(value);
+            case LONG:        return (T) Long   .valueOf(value);
+            case FLOAT:       return (T) Float  .valueOf(value);
+            case DOUBLE:      return (T) Double .valueOf(value);
+            case BIG_INTEGER: return (T) new BigInteger(value);
+            case BIG_DECIMAL: return (T) new BigDecimal(value);
+            default: throw unknownType(type);
+        }
     }
 
     /**
@@ -706,8 +707,10 @@ public final class Numbers extends Stati
     }
 
     /**
-     * Returns one of {@link #DOUBLE}, {@link #FLOAT}, {@link #LONG}, {@link #INTEGER},
-     * {@link #SHORT}, {@link #BYTE}, {@link #CHARACTER}, {@link #BOOLEAN} or {@link #OTHER}
+     * Returns a numeric constant for the given type.
+     * The constants are {@link #BIG_DECIMAL}, {@link #BIG_INTEGER},
+     * {@link #DOUBLE}, {@link #FLOAT}, {@link #LONG}, {@link #INTEGER},
+     * {@link #SHORT}, {@link #BYTE}, {@link #CHARACTER}, {@link #BOOLEAN}, or {@link #OTHER}
      * constants for the given type. This is a commodity for usage in {@code switch} statements.
      *
      * @param type A type (usually either a primitive type or its wrapper).
@@ -715,13 +718,7 @@ public final class Numbers extends Stati
      */
     public static byte getEnumConstant(final Class<?> type) {
         final Numbers mapping = MAPPING.get(type);
-        if (mapping != null) {
-            // Filter out the non-public enum for BigDecimal and BigInteger.
-            if (mapping.size >= 0) {
-                return mapping.ordinal;
-            }
-        }
-        return OTHER;
+        return (mapping != null) ? mapping.ordinal : OTHER;
     }
 
     /**

Modified: sis/trunk/sis-utility/src/main/java/org/apache/sis/util/ObjectConverter.java
URL: http://svn.apache.org/viewvc/sis/trunk/sis-utility/src/main/java/org/apache/sis/util/ObjectConverter.java?rev=1457601&r1=1457600&r2=1457601&view=diff
==============================================================================
--- sis/trunk/sis-utility/src/main/java/org/apache/sis/util/ObjectConverter.java [UTF-8] (original)
+++ sis/trunk/sis-utility/src/main/java/org/apache/sis/util/ObjectConverter.java [UTF-8] Sun Mar 17 23:53:53 2013
@@ -25,23 +25,38 @@ import org.apache.sis.math.FunctionPrope
  * The source and target types may be the same, in which case the {@code ObjectConverter} actually converts
  * the values rather than the type.
  *
- * <p>The main method of this interface is {@link #convert(Object)}, which receive an object of type
- * <var>S</var> and returns an object of type <var>T</var>. Some characteristics about the <var>S</var>
- * to <var>T</var> mapping are given by the {@link #properties()} enumeration, together with the
- * {@link #getSourceClass()} and {@link #getTargetClass()} methods.</p>
- *
- * <p>The <cite>domain</cite> of this function is the set of all values of type <var>S</var> for
- * which the {@link #convert(Object)} method does not throw {@link UnconvertibleObjectException}.
- * Note that values for which {@code convert(S)} returns {@code null} are considered as part of
- * the domain, even if the {@code null} target value stands for unconvertible source values.</p>
+ * <p>The main method of this interface is {@link #convert(Object)}, which receives an object of type
+ * <var>S</var> and returns an object of type <var>T</var>. The set of all <var>S</var> values for which
+ * {@code convert(S)} does not throw {@link UnconvertibleObjectException} is called the <cite>domain</cite>
+ * of this function, regardless of whether the <var>T</var> result is {@code null} or not.</p>
+ *
+ * {@section Function properties}
+ * Some characteristics about the <var>S</var> to <var>T</var> mapping are given by the
+ * {@link #properties()} enumeration, together with the {@link #getSourceClass()} and
+ * {@link #getTargetClass()} methods. Some possible function properties are:
  *
- * <p>The above definition affects the function {@linkplain #properties() properties}
- * that this converter can declare:</p>
+ * <ul>
+ *   <li>{@linkplain FunctionProperty#INJECTIVE Injective} if no pair of <var>S</var> can produce
+ *       the same <var>T</var> value (e.g.: conversions from {@link Integer} to {@code String}).</li>
+ *   <li>{@linkplain FunctionProperty#SURJECTIVE Surjective} if every values of <var>T</var> can be
+ *       created from one or many values of <var>S</var> (e.g.: conversions from {@link String} to
+ *       {@link Integer}).</li>
+ *   <li>{@linkplain FunctionProperty#isBijective Bijective} if there is a one-to-one
+ *       relationship between the <var>S</var> and <var>T</var> values.</li>
+ *   <li>{@linkplain FunctionProperty#ORDER_PRESERVING Order preserving} if any sequence of
+ *       increasing <var>S</var> values (in the sense of {@link Comparable}) is mapped to a
+ *       sequence of increasing <var>T</var> values.</li>
+ *   <li>{@linkplain FunctionProperty#ORDER_REVERSING Order reversing} if any sequence of
+ *       increasing <var>S</var> values (in the sense of {@link Comparable}) is mapped to
+ *       a sequence of decreasing <var>T</var> values.</li>
+ * </ul>
+ *
+ * Below are some guidelines about the function properties that a converter can declare:
  *
  * <ul>
  *   <li>If {@code convert(S)} returns {@code null} for unconvertible objects, then this {@code ObjectConverter}
- *       can not declare {@link FunctionProperty#INJECTIVE} in its set of {@linkplain #properties() properties},
- *       because more than one source value can produce the same target value (namely {@code null}).</li>
+ *       can not be declared injective because more than one <var>S</var> value can produce the same
+ *       <var>T</var> value (namely {@code null}).</li>
  *   <li>If {@code convert(S)} throws an exception for unconvertible objects, then this {@code ObjectConverter}
  *       can be declared as an injective function if the other values meet the criteria.
  * </ul>

Modified: sis/trunk/sis-utility/src/main/java/org/apache/sis/util/ObjectConverters.java
URL: http://svn.apache.org/viewvc/sis/trunk/sis-utility/src/main/java/org/apache/sis/util/ObjectConverters.java?rev=1457601&r1=1457600&r2=1457601&view=diff
==============================================================================
--- sis/trunk/sis-utility/src/main/java/org/apache/sis/util/ObjectConverters.java [UTF-8] (original)
+++ sis/trunk/sis-utility/src/main/java/org/apache/sis/util/ObjectConverters.java [UTF-8] Sun Mar 17 23:53:53 2013
@@ -19,11 +19,43 @@ package org.apache.sis.util;
 import java.util.Map;
 import java.util.Set;
 import org.apache.sis.util.collection.CollectionsExt;
-import org.apache.sis.util.resources.Errors;
+import org.apache.sis.internal.converter.IdentityConverter;
+import org.apache.sis.internal.converter.SystemRegistry;
 
 
 /**
  * Creates {@link ObjectConverter} instances, or uses them for creating collection views.
+ * Converters are created by the following methods:
+ *
+ * <ul>
+ *   <li>{@link #identity(Class)}</li>
+ *   <li>{@link #find(Class, Class)}</li>
+ * </ul>
+ *
+ * Converters can be used for creating derived collections by the following methods:
+ *
+ * <ul>
+ *   <li>{@link #derivedSet(Set, ObjectConverter)}</li>
+ *   <li>{@link #derivedMap(Map, ObjectConverter, ObjectConverter)}</li>
+ *   <li>{@link #derivedKeys(Map, ObjectConverter, Class)}</li>
+ *   <li>{@link #derivedValues(Map, Class, ObjectConverter)}</li>
+ * </ul>
+ *
+ * {@section Example}
+ * The following code convert instances in a collection from type {@code S} to type {@code T},
+ * where the types are unknown at compile-time. Note that the converter is obtained only once
+ * before to be applied to every elements in the loop.
+ *
+ * {@preformat java
+ *     Class<S> sourceType = ...
+ *     Class<T> targetType = ...
+ *     Collection<S> sources = ...;
+ *     Collection<T> targets = ...;
+ *     ObjectConverter<S,T> converter = ObjectConverters.find(sourceType, targetType);
+ *     for (S source : sources) {
+ *         targets.add(converter.convert(source));
+ *     }
+ * }
  *
  * @author  Martin Desruisseaux (IRD, Geomatys)
  * @since   0.3 (derived from geotk-3.00)
@@ -46,7 +78,7 @@ public final class ObjectConverters exte
      */
     public static <T> ObjectConverter<T,T> identity(final Class<T> type) {
         ArgumentChecks.ensureNonNull("type", type);
-        return IdentityConverter.create(type);
+        return new IdentityConverter<T,T>(type, type, null).unique();
     }
 
     /**
@@ -59,11 +91,10 @@ public final class ObjectConverters exte
      * @return The converter from the specified source class to the target class.
      * @throws UnconvertibleObjectException if no converter is found.
      */
-    public static <S,T> ObjectConverter<S,T> find(final Class<S> source, final Class<T> target)
+    public static <S,T> ObjectConverter<? super S, ? extends T> find(final Class<S> source, final Class<T> target)
             throws UnconvertibleObjectException
     {
-        // TODO: port the implementation from Geotk
-        throw new UnconvertibleObjectException(Errors.format(Errors.Keys.CanNotConvertFromType_2, source, target));
+        return SystemRegistry.INSTANCE.find(source, target);
     }
 
     /**
@@ -142,7 +173,7 @@ public final class ObjectConverters exte
                                                 final Class<V> valueType)
     {
         ArgumentChecks.ensureNonNull("valueType", valueType);
-        return CollectionsExt.derivedMap(storage, keyConverter, IdentityConverter.create(valueType));
+        return CollectionsExt.derivedMap(storage, keyConverter, identity(valueType));
     }
 
     /**
@@ -170,6 +201,6 @@ public final class ObjectConverters exte
                                                   final ObjectConverter<SV,V> valueConverter)
     {
         ArgumentChecks.ensureNonNull("keyType", keyType);
-        return CollectionsExt.derivedMap(storage, IdentityConverter.create(keyType), valueConverter);
+        return CollectionsExt.derivedMap(storage, identity(keyType), valueConverter);
     }
 }

Modified: sis/trunk/sis-utility/src/main/java/org/apache/sis/util/Utilities.java
URL: http://svn.apache.org/viewvc/sis/trunk/sis-utility/src/main/java/org/apache/sis/util/Utilities.java?rev=1457601&r1=1457600&r2=1457601&view=diff
==============================================================================
--- sis/trunk/sis-utility/src/main/java/org/apache/sis/util/Utilities.java [UTF-8] (original)
+++ sis/trunk/sis-utility/src/main/java/org/apache/sis/util/Utilities.java [UTF-8] Sun Mar 17 23:53:53 2013
@@ -24,7 +24,7 @@ import java.util.Map;
 import java.util.Set;
 
 // Related to JDK7
-import org.apache.sis.internal.util.Objects;
+import org.apache.sis.internal.jdk7.Objects;
 
 
 /**

Modified: sis/trunk/sis-utility/src/main/java/org/apache/sis/util/collection/DefaultTreeTable.java
URL: http://svn.apache.org/viewvc/sis/trunk/sis-utility/src/main/java/org/apache/sis/util/collection/DefaultTreeTable.java?rev=1457601&r1=1457600&r2=1457601&view=diff
==============================================================================
--- sis/trunk/sis-utility/src/main/java/org/apache/sis/util/collection/DefaultTreeTable.java [UTF-8] (original)
+++ sis/trunk/sis-utility/src/main/java/org/apache/sis/util/collection/DefaultTreeTable.java [UTF-8] Sun Mar 17 23:53:53 2013
@@ -31,7 +31,7 @@ import static org.apache.sis.util.collec
 import static org.apache.sis.util.collection.CollectionsExt.hashMapCapacity;
 
 // Related to JDK7
-import org.apache.sis.internal.util.Objects;
+import org.apache.sis.internal.jdk7.Objects;
 
 
 /**
@@ -66,6 +66,9 @@ import org.apache.sis.internal.util.Obje
  * @since   0.3
  * @version 0.3
  * @module
+ *
+ * @see Node
+ * @see TableColumn
  */
 @NotThreadSafe
 public class DefaultTreeTable implements TreeTable, Cloneable, Serializable {
@@ -308,6 +311,9 @@ public class DefaultTreeTable implements
      * @since   0.3
      * @version 0.3
      * @module
+     *
+     * @see DefaultTreeTable
+     * @see TableColumn
      */
     @NotThreadSafe
     public static class Node implements TreeTable.Node, Cloneable, Serializable {
@@ -443,7 +449,7 @@ public class DefaultTreeTable implements
         }
 
         /**
-         * Creates a node with a single column for object names (c<cite>convenience constructor</cite>).
+         * Creates a node with a single column for object names (<cite>convenience constructor</cite>).
          * The node will have the following columns:
          *
          * <table class="sis">

Modified: sis/trunk/sis-utility/src/main/java/org/apache/sis/util/collection/TableColumn.java
URL: http://svn.apache.org/viewvc/sis/trunk/sis-utility/src/main/java/org/apache/sis/util/collection/TableColumn.java?rev=1457601&r1=1457600&r2=1457601&view=diff
==============================================================================
--- sis/trunk/sis-utility/src/main/java/org/apache/sis/util/collection/TableColumn.java [UTF-8] (original)
+++ sis/trunk/sis-utility/src/main/java/org/apache/sis/util/collection/TableColumn.java [UTF-8] Sun Mar 17 23:53:53 2013
@@ -121,7 +121,6 @@ public class TableColumn<V> implements C
      * the column elements are typically instances of {@link String} or {@link InternationalString},
      * depending on whether the data provide localization support or not.
      */
-    @SuppressWarnings("unchecked")
     public static final TableColumn<CharSequence> VALUE_AS_TEXT = new Constant<CharSequence>("VALUE_AS_TEXT",
             CharSequence.class, Vocabulary.Keys.Value);
 
@@ -129,13 +128,12 @@ public class TableColumn<V> implements C
      * Frequently-used constant for a column of object numerical values.
      * The column {@linkplain #getHeader() header} is "<cite>Value</cite>" (eventually localized).
      */
-    @SuppressWarnings("unchecked")
     public static final TableColumn<Number> VALUE_AS_NUMBER = new Constant<Number>("VALUE_AS_NUMBER",
             Number.class, Vocabulary.Keys.Value);
 
     /**
      * A map containing only the {@link #NAME} column.
-     * This is the default set of columns when parsing a table tree.
+     * This is the default set of columns when parsing a tree table.
      */
     static final Map<TableColumn<?>,Integer> NAME_MAP =
             Collections.<TableColumn<?>,Integer>singletonMap(NAME, 0);
@@ -249,7 +247,6 @@ public class TableColumn<V> implements C
     public TableColumn(final Class<V> type, final CharSequence header) {
         ArgumentChecks.ensureNonNull("type",   this.type   = type);
         ArgumentChecks.ensureNonNull("header", this.header = header);
-        this.header = Types.toInternationalString(header);
     }
 
     /**

Modified: sis/trunk/sis-utility/src/main/java/org/apache/sis/util/collection/TreeTable.java
URL: http://svn.apache.org/viewvc/sis/trunk/sis-utility/src/main/java/org/apache/sis/util/collection/TreeTable.java?rev=1457601&r1=1457600&r2=1457601&view=diff
==============================================================================
--- sis/trunk/sis-utility/src/main/java/org/apache/sis/util/collection/TreeTable.java [UTF-8] (original)
+++ sis/trunk/sis-utility/src/main/java/org/apache/sis/util/collection/TreeTable.java [UTF-8] Sun Mar 17 23:53:53 2013
@@ -30,17 +30,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.

Modified: sis/trunk/sis-utility/src/main/java/org/apache/sis/util/collection/TreeTableFormat.java
URL: http://svn.apache.org/viewvc/sis/trunk/sis-utility/src/main/java/org/apache/sis/util/collection/TreeTableFormat.java?rev=1457601&r1=1457600&r2=1457601&view=diff
==============================================================================
--- sis/trunk/sis-utility/src/main/java/org/apache/sis/util/collection/TreeTableFormat.java [UTF-8] (original)
+++ sis/trunk/sis-utility/src/main/java/org/apache/sis/util/collection/TreeTableFormat.java [UTF-8] Sun Mar 17 23:53:53 2013
@@ -40,7 +40,7 @@ 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;
 
 
 /**
@@ -52,9 +52,9 @@ import org.apache.sis.internal.util.JDK7
  *
  * {@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,
@@ -62,9 +62,9 @@ import org.apache.sis.internal.util.JDK7
  *
  * {@preformat text
  *   Node #1……………………… More #1
- *   ├───Node #2…………… More #2
- *   │   └───Node #4… More #4
- *   └───Node #3…………… More #3
+ *     ├─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}
@@ -118,7 +118,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()
@@ -132,9 +132,9 @@ public class TreeTableFormat extends Tab
      *
      * <ul>
      *   <li>{@code treeBlank} = {@code "    "}</li>
-     *   <li>{@code treeLine}  = {@code "│   "}</li>
-     *   <li>{@code treeCross} = {@code "├───"}</li>
-     *   <li>{@code treeEnd}   = {@code "└───"}</li>
+     *   <li>{@code treeLine}  = {@code "  │ "}</li>
+     *   <li>{@code treeCross} = {@code "  ├─"}</li>
+     *   <li>{@code treeEnd}   = {@code "  └─"}</li>
      * </ul>
      *
      * @see #clearTreeSymbols()
@@ -151,10 +151,11 @@ public class TreeTableFormat extends Tab
      */
     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;
     }
 
     /**
@@ -241,7 +242,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.

Modified: sis/trunk/sis-utility/src/main/java/org/apache/sis/util/collection/TreeTables.java
URL: http://svn.apache.org/viewvc/sis/trunk/sis-utility/src/main/java/org/apache/sis/util/collection/TreeTables.java?rev=1457601&r1=1457600&r2=1457601&view=diff
==============================================================================
--- sis/trunk/sis-utility/src/main/java/org/apache/sis/util/collection/TreeTables.java [UTF-8] (original)
+++ sis/trunk/sis-utility/src/main/java/org/apache/sis/util/collection/TreeTables.java [UTF-8] Sun Mar 17 23:53:53 2013
@@ -49,20 +49,20 @@ import org.apache.sis.util.ArgumentCheck
  * <table class="compact"><tr><td>
  * {@preformat text
  *   root
- *   ├───users
- *   │   └───alice
- *   │       ├───data
- *   │       │   └───mercator
- *   │       └───document
- *   └───lib
+ *     ├─users
+ *     │   └─alice
+ *     │       ├─data
+ *     │       │   └─mercator
+ *     │       └─document
+ *     └─lib
  * }
  * </td><td>
  * {@preformat text
  *   root
- *   ├───users/alice
- *   │   ├───data/mercator
- *   │   └───document
- *   └───lib
+ *     ├─users/alice
+ *     │   ├─data/mercator
+ *     │   └─document
+ *     └─lib
  * }
  * </td></tr></table>
  * {@preformat java
@@ -119,9 +119,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.

Modified: sis/trunk/sis-utility/src/main/java/org/apache/sis/util/collection/UnmodifiableArrayList.java
URL: http://svn.apache.org/viewvc/sis/trunk/sis-utility/src/main/java/org/apache/sis/util/collection/UnmodifiableArrayList.java?rev=1457601&r1=1457600&r2=1457601&view=diff
==============================================================================
--- sis/trunk/sis-utility/src/main/java/org/apache/sis/util/collection/UnmodifiableArrayList.java [UTF-8] (original)
+++ sis/trunk/sis-utility/src/main/java/org/apache/sis/util/collection/UnmodifiableArrayList.java [UTF-8] Sun Mar 17 23:53:53 2013
@@ -21,7 +21,7 @@ import java.util.AbstractList;
 import org.apache.sis.util.ArgumentChecks;
 
 // Related to JDK7
-import org.apache.sis.internal.util.Objects;
+import org.apache.sis.internal.jdk7.Objects;
 
 
 /**

Modified: sis/trunk/sis-utility/src/main/java/org/apache/sis/util/collection/WeakHashSet.java
URL: http://svn.apache.org/viewvc/sis/trunk/sis-utility/src/main/java/org/apache/sis/util/collection/WeakHashSet.java?rev=1457601&r1=1457600&r2=1457601&view=diff
==============================================================================
--- sis/trunk/sis-utility/src/main/java/org/apache/sis/util/collection/WeakHashSet.java [UTF-8] (original)
+++ sis/trunk/sis-utility/src/main/java/org/apache/sis/util/collection/WeakHashSet.java [UTF-8] Sun Mar 17 23:53:53 2013
@@ -32,7 +32,7 @@ import org.apache.sis.util.NullArgumentE
 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;
 
 
 /**

Modified: sis/trunk/sis-utility/src/main/java/org/apache/sis/util/collection/WeakValueHashMap.java
URL: http://svn.apache.org/viewvc/sis/trunk/sis-utility/src/main/java/org/apache/sis/util/collection/WeakValueHashMap.java?rev=1457601&r1=1457600&r2=1457601&view=diff
==============================================================================
--- sis/trunk/sis-utility/src/main/java/org/apache/sis/util/collection/WeakValueHashMap.java [UTF-8] (original)
+++ sis/trunk/sis-utility/src/main/java/org/apache/sis/util/collection/WeakValueHashMap.java [UTF-8] Sun Mar 17 23:53:53 2013
@@ -36,7 +36,7 @@ import org.apache.sis.util.resources.Err
 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;
 
 
 /**

Modified: sis/trunk/sis-utility/src/main/java/org/apache/sis/util/iso/AbstractName.java
URL: http://svn.apache.org/viewvc/sis/trunk/sis-utility/src/main/java/org/apache/sis/util/iso/AbstractName.java?rev=1457601&r1=1457600&r2=1457601&view=diff
==============================================================================
--- sis/trunk/sis-utility/src/main/java/org/apache/sis/util/iso/AbstractName.java [UTF-8] (original)
+++ sis/trunk/sis-utility/src/main/java/org/apache/sis/util/iso/AbstractName.java [UTF-8] Sun Mar 17 23:53:53 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;
 
 
 /**

Modified: sis/trunk/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultInternationalString.java
URL: http://svn.apache.org/viewvc/sis/trunk/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultInternationalString.java?rev=1457601&r1=1457600&r2=1457601&view=diff
==============================================================================
--- sis/trunk/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultInternationalString.java [UTF-8] (original)
+++ sis/trunk/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultInternationalString.java [UTF-8] Sun Mar 17 23:53:53 2013
@@ -35,7 +35,7 @@ import org.apache.sis.util.resources.Err
 import static org.apache.sis.util.collection.CollectionsExt.isNullOrEmpty;
 
 // Related to JDK7
-import org.apache.sis.internal.util.Objects;
+import org.apache.sis.internal.jdk7.Objects;
 
 
 /**

Modified: sis/trunk/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultLocalName.java
URL: http://svn.apache.org/viewvc/sis/trunk/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultLocalName.java?rev=1457601&r1=1457600&r2=1457601&view=diff
==============================================================================
--- sis/trunk/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultLocalName.java [UTF-8] (original)
+++ sis/trunk/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultLocalName.java [UTF-8] Sun Mar 17 23:53:53 2013
@@ -33,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;
 
 
 /**

Modified: sis/trunk/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultNameSpace.java
URL: http://svn.apache.org/viewvc/sis/trunk/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultNameSpace.java?rev=1457601&r1=1457600&r2=1457601&view=diff
==============================================================================
--- sis/trunk/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultNameSpace.java [UTF-8] (original)
+++ sis/trunk/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultNameSpace.java [UTF-8] Sun Mar 17 23:53:53 2013
@@ -34,7 +34,7 @@ import org.apache.sis.util.collection.Un
 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;
 
 
 /**

Modified: sis/trunk/sis-utility/src/main/java/org/apache/sis/util/iso/SimpleInternationalString.java
URL: http://svn.apache.org/viewvc/sis/trunk/sis-utility/src/main/java/org/apache/sis/util/iso/SimpleInternationalString.java?rev=1457601&r1=1457600&r2=1457601&view=diff
==============================================================================
--- sis/trunk/sis-utility/src/main/java/org/apache/sis/util/iso/SimpleInternationalString.java [UTF-8] (original)
+++ sis/trunk/sis-utility/src/main/java/org/apache/sis/util/iso/SimpleInternationalString.java [UTF-8] Sun Mar 17 23:53:53 2013
@@ -26,7 +26,7 @@ import net.jcip.annotations.Immutable;
 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;
 
 
 /**

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=1457601&r1=1457600&r2=1457601&view=diff
==============================================================================
--- sis/trunk/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.java [UTF-8] (original)
+++ sis/trunk/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.java [UTF-8] Sun Mar 17 23:53:53 2013
@@ -78,6 +78,11 @@ public final class Errors extends Indexe
         public static final int CanNotConvertValue_2 = 74;
 
         /**
+         * Can not instantiate an object of type ‘{0}’.
+         */
+        public static final int CanNotInstantiate_1 = 81;
+
+        /**
          * Can not set a value for property “{0}”.
          */
         public static final int CanNotSetPropertyValue_1 = 75;
@@ -103,6 +108,16 @@ public final class Errors extends Indexe
         public static final int DuplicatedValue_1 = 38;
 
         /**
+         * Found {0} duplicated values.
+         */
+        public static final int DuplicatedValuesCount_1 = 78;
+
+        /**
+         * Duplicated values for the “{0}” property.
+         */
+        public static final int DuplicatedValuesForProperty_1 = 79;
+
+        /**
          * Element “{0}” is already present.
          */
         public static final int ElementAlreadyPresent_1 = 36;
@@ -255,6 +270,11 @@ public final class Errors extends Indexe
         public static final int MismatchedDimension_3 = 58;
 
         /**
+         * Missing value in the “{0}” column.
+         */
+        public static final int MissingValueInColumn_1 = 77;
+
+        /**
          * Argument ‘{0}’ shall not be negative. The given value was {1}.
          */
         public static final int NegativeArgument_2 = 8;
@@ -300,6 +320,16 @@ public final class Errors extends Indexe
         public static final int NonEquilibratedParenthesis_2 = 59;
 
         /**
+         * Conversion is not invertible.
+         */
+        public static final int NonInvertibleConversion = 82;
+
+        /**
+         * Transform is not invertible.
+         */
+        public static final int NonInvertibleTransform = 83;
+
+        /**
          * “{0}” is not a linear unit.
          */
         public static final int NonLinearUnit_1 = 47;
@@ -380,6 +410,11 @@ public final class Errors extends Indexe
         public static final int UnexpectedEndOfString_1 = 30;
 
         /**
+         * Type of the “{0}” property is unknown.
+         */
+        public static final int UnknownTypeForProperty_1 = 80;
+
+        /**
          * Type ‘{0}’ is unknown in this context.
          */
         public static final int UnknownType_1 = 76;

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=1457601&r1=1457600&r2=1457601&view=diff
==============================================================================
--- sis/trunk/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.properties [ISO-8859-1] (original)
+++ sis/trunk/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.properties [ISO-8859-1] Sun Mar 17 23:53:53 2013
@@ -27,11 +27,14 @@
 CanNotConvertFromType_2         = Can not convert from type \u2018{0}\u2019 to type \u2018{1}\u2019.
 CanNotConvertValue_2            = Can not convert value \u201c{0}\u201d to type \u2018{1}\u2019.
 CanNotComputeDerivative         = Can not compute the derivative.
+CanNotInstantiate_1             = Can not instantiate an object of type \u2018{0}\u2019.
 CanNotSetPropertyValue_1        = Can not set a value for property \u201c{0}\u201d.
 ClassNotFinal_1                 = Class \u2018{0}\u2019 is not final.
 CloneNotSupported_1             = Can not clone an object of type \u2018{0}\u2019.
 DeadThread_1                    = Thread \u201c{0}\u201d is dead.
 DuplicatedValue_1               = Value \u201c{0}\u201d is duplicated.
+DuplicatedValuesForProperty_1   = Duplicated values for the \u201c{0}\u201d property.
+DuplicatedValuesCount_1         = Found {0} duplicated values.
 ElementAlreadyPresent_1         = Element \u201c{0}\u201d is already present.
 EmptyArgument_1                 = Argument \u2018{0}\u2019 shall not be empty.
 EmptyDictionary                 = The dictionary shall contains at least one entry.
@@ -62,12 +65,15 @@ MandatoryAttribute_2            = Attrib
 MismatchedCRS                   = The coordinate reference system must be the same for all objects.
 MismatchedDimension_2           = Mismatched object dimension: {0}D and {1}D.
 MismatchedDimension_3           = Argument \u2018{0}\u2019 has {2} dimension{2,choice,1#|2#s}, while {1} was expected.
+MissingValueInColumn_1          = Missing value in the \u201c{0}\u201d column.
 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.
 NonEquilibratedParenthesis_2    = Missing a \u2018{1}\u2019 parenthesis in \u201c{0}\u201d.
+NonInvertibleConversion         = Conversion is not invertible.
+NonInvertibleTransform          = Transform is not invertible.
 NonAngularUnit_1                = \u201c{0}\u201d is not an angular unit.
 NonLinearUnit_1                 = \u201c{0}\u201d is not a linear unit.
 NonScaleUnit_1                  = \u201c{0}\u201d is not a scale unit.
@@ -89,6 +95,7 @@ UndefinedOrderingForElements_2  = Orderi
 UnexpectedChange_1              = Unexpected change in \u2018{0}\u2019.
 UnexpectedEndOfString_1         = More characters were expected at the end of \u201c{0}\u201d.
 UnknownType_1                   = Type \u2018{0}\u2019 is unknown in this context.
+UnknownTypeForProperty_1        = Type of the \u201c{0}\u201d property is unknown.
 UnmodifiableAffineTransform     = This affine transform is unmodifiable.
 UnmodifiableGeometry            = This geometry is unmodifiable.
 UnmodifiableMetadata            = This metadata is unmodifiable.

Modified: sis/trunk/sis-utility/src/main/java/org/apache/sis/util/resources/Errors_fr.properties
URL: http://svn.apache.org/viewvc/sis/trunk/sis-utility/src/main/java/org/apache/sis/util/resources/Errors_fr.properties?rev=1457601&r1=1457600&r2=1457601&view=diff
==============================================================================
--- sis/trunk/sis-utility/src/main/java/org/apache/sis/util/resources/Errors_fr.properties [ISO-8859-1] (original)
+++ sis/trunk/sis-utility/src/main/java/org/apache/sis/util/resources/Errors_fr.properties [ISO-8859-1] Sun Mar 17 23:53:53 2013
@@ -17,11 +17,14 @@
 CanNotConvertFromType_2         = Ne peut pas convertir du type \u2018{0}\u2019 vers le type \u2018{1}\u2019.
 CanNotConvertValue_2            = La valeur \u201c{0}\u201d ne peut pas \u00eatre convertie vers le type \u2018{1}\u2019.
 CanNotComputeDerivative         = La d\u00e9riv\u00e9 ne peut pas \u00eatre calcul\u00e9e.
+CanNotInstantiate_1             = Ne peut pas cr\u00e9er un objet de type \u2018{0}\u2019.
 CanNotSetPropertyValue_1        = Ne peut pas d\u00e9finir une valeur pour la propri\u00e9t\u00e9 \u201c{0}\u201d.
 ClassNotFinal_1                 = La classe \u2018{0}\u2019 n\u2019est pas finale.
 CloneNotSupported_1             = Un objet de type \u2018{0}\u2019 ne peut pas \u00eatre clon\u00e9.
 DeadThread_1                    = La t\u00e2che \u201c{0}\u201d est morte.
 DuplicatedValue_1               = La valeur \u201c{0}\u201d est dupliqu\u00e9e.
+DuplicatedValuesForProperty_1   = Plusieurs valeurs ont \u00e9t\u00e9 sp\u00e9cifi\u00e9es pour la propri\u00e9t\u00e9 \u201c{0}\u201d.
+DuplicatedValuesCount_1         = {0} valeurs dupliqu\u00e9es ont \u00e9t\u00e9 trouv\u00e9es.
 ElementAlreadyPresent_1         = L\u2019\u00e9lement \u201c{0}\u201d est d\u00e9j\u00e0 pr\u00e9sent.
 EmptyArgument_1                 = L\u2019argument \u2018{0}\u2019 ne doit pas \u00eatre vide.
 EmptyDictionary                 = Le dictionnaire doit contenir au moins une entr\u00e9e.
@@ -52,12 +55,15 @@ MandatoryAttribute_2            = L\u201
 MismatchedCRS                   = Le syst\u00e8me de r\u00e9f\u00e9rence des coordonn\u00e9es doit \u00eatre le m\u00eame pour tous les objets.
 MismatchedDimension_2           = Les dimensions des objets ({0}D et {1}D) ne concordent pas.
 MismatchedDimension_3           = L\u2019argument \u2018{0}\u2019 a {2} dimension{2,choice,1#|2#s}, alors qu\u2019on en attendait {1}.
+MissingValueInColumn_1          = Il manque une valeur dans la colonne \u201c{0}\u201d.
 NegativeArgument_2              = L\u2019argument \u2018{0}\u2019 ne doit pas \u00eatre n\u00e9gatif. La valeur donn\u00e9e \u00e9tait {1}.
 NodeChildOfItself_1             = Le n\u0153ud \u201c{0}\u201d ne peut pas \u00eatre un enfant de lui-m\u00eame.
 NodeHasAnotherParent_1          = Le n\u0153ud \u201c{0}\u201d a d\u00e9j\u00e0 un autre parent.
 NodeHasNoParent_1               = Le n\u0153ud \u201c{0}\u201d n\u2019a pas de parent.
 NodeNotFound_1                  = Aucun n\u0153ud \u201c{0}\u201d n\u2019a \u00e9t\u00e9 trouv\u00e9.
 NonEquilibratedParenthesis_2    = Il manque une parenth\u00e8se \u2018{1}\u2019 dans \u201c{0}\u201d.
+NonInvertibleConversion         = La conversion n\u2019est pas inversible.
+NonInvertibleTransform          = La transformation n\u2019est pas inversible.
 NonAngularUnit_1                = \u201c{0}\u201d n\u2019est pas une unit\u00e9 d\u2019angles.
 NonLinearUnit_1                 = \u201c{0}\u201d n\u2019est pas une unit\u00e9 de longueurs.
 NonScaleUnit_1                  = \u201c{0}\u201d n\u2019est pas une unit\u00e9 d\u2019\u00e9chelles.
@@ -78,6 +84,7 @@ UndefinedOrderingForElements_2  = L\u201
 UnexpectedChange_1              = Changement inattendu dans \u2018{0}\u2019.
 UnexpectedEndOfString_1         = D\u2019autres caract\u00e8res \u00e9taient attendus \u00e0 la fin du texte \u201c{0}\u201d.
 UnknownType_1                   = Le type \u2018{0}\u2019 n\u2019est pas reconnu dans ce contexte.
+UnknownTypeForProperty_1        = Le type de la propri\u00e9t\u00e9 \u201c{0}\u201d est inconnu.
 UnmodifiableAffineTransform     = Cette transformation affine n\u2019est pas modifiable.
 UnmodifiableGeometry            = Cette g\u00e9om\u00e9trie n\u2019est pas modifiable.
 UnmodifiableMetadata            = Cette m\u00e9ta-donn\u00e9e n\u2019est pas modifiable.

Modified: sis/trunk/sis-utility/src/main/java/org/apache/sis/util/resources/IndexedResourceBundle.java
URL: http://svn.apache.org/viewvc/sis/trunk/sis-utility/src/main/java/org/apache/sis/util/resources/IndexedResourceBundle.java?rev=1457601&r1=1457600&r2=1457601&view=diff
==============================================================================
--- sis/trunk/sis-utility/src/main/java/org/apache/sis/util/resources/IndexedResourceBundle.java [UTF-8] (original)
+++ sis/trunk/sis-utility/src/main/java/org/apache/sis/util/resources/IndexedResourceBundle.java [UTF-8] Sun Mar 17 23:53:53 2013
@@ -40,7 +40,7 @@ import org.apache.sis.util.CharSequences
 import org.apache.sis.util.logging.Logging;
 
 // Related to JDK7
-import org.apache.sis.internal.util.JDK7;
+import org.apache.sis.internal.jdk7.JDK7;
 
 
 /**

Modified: sis/trunk/sis-utility/src/main/java/org/apache/sis/util/resources/ResourceInternationalString.java
URL: http://svn.apache.org/viewvc/sis/trunk/sis-utility/src/main/java/org/apache/sis/util/resources/ResourceInternationalString.java?rev=1457601&r1=1457600&r2=1457601&view=diff
==============================================================================
--- sis/trunk/sis-utility/src/main/java/org/apache/sis/util/resources/ResourceInternationalString.java [UTF-8] (original)
+++ sis/trunk/sis-utility/src/main/java/org/apache/sis/util/resources/ResourceInternationalString.java [UTF-8] Sun Mar 17 23:53:53 2013
@@ -29,7 +29,7 @@ import org.apache.sis.util.ArgumentCheck
 import org.apache.sis.util.iso.AbstractInternationalString;
 
 // Related to JDK7
-import org.apache.sis.internal.util.Objects;
+import org.apache.sis.internal.jdk7.Objects;
 
 
 /**

Modified: sis/trunk/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary.java
URL: http://svn.apache.org/viewvc/sis/trunk/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary.java?rev=1457601&r1=1457600&r2=1457601&view=diff
==============================================================================
--- sis/trunk/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary.java [UTF-8] (original)
+++ sis/trunk/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary.java [UTF-8] Sun Mar 17 23:53:53 2013
@@ -105,6 +105,11 @@ public final class Vocabulary extends In
         public static final int DaylightTime = 24;
 
         /**
+         * Destination
+         */
+        public static final int Destination = 38;
+
+        /**
          * Directory
          */
         public static final int Directory = 36;
@@ -205,6 +210,11 @@ public final class Vocabulary extends In
         public static final int Scale = 23;
 
         /**
+         * Source
+         */
+        public static final int Source = 39;
+
+        /**
          * Standard deviation
          */
         public static final int StandardDeviation = 8;

Modified: sis/trunk/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary.properties
URL: http://svn.apache.org/viewvc/sis/trunk/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary.properties?rev=1457601&r1=1457600&r2=1457601&view=diff
==============================================================================
--- sis/trunk/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary.properties [ISO-8859-1] (original)
+++ sis/trunk/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary.properties [ISO-8859-1] Sun Mar 17 23:53:53 2013
@@ -24,6 +24,7 @@ Code_1             = {0} code
 CurrentDateTime    = Current date and time
 CurrentDirectory   = Current directory
 DaylightTime       = Daylight time
+Destination        = Destination
 Directory          = Directory
 JavaExtensions     = Java extensions
 JavaHome           = Java home directory
@@ -44,6 +45,7 @@ Paths              = Paths
 Root               = Root
 RootMeanSquare     = Root Mean Square
 Scale              = Scale
+Source             = Source
 StandardDeviation  = Standard deviation
 TemporaryFiles     = Temporary files
 Timezone           = Timezone

Modified: sis/trunk/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary_fr.properties
URL: http://svn.apache.org/viewvc/sis/trunk/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary_fr.properties?rev=1457601&r1=1457600&r2=1457601&view=diff
==============================================================================
--- sis/trunk/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary_fr.properties [ISO-8859-1] (original)
+++ sis/trunk/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary_fr.properties [ISO-8859-1] Sun Mar 17 23:53:53 2013
@@ -24,6 +24,7 @@ Code_1             = Code {0}
 CurrentDateTime    = Date et heure courantes
 CurrentDirectory   = R\u00e9pertoire courant
 DaylightTime       = Heure normale
+Destination        = Destination
 Directory          = R\u00e9pertoire
 JavaExtensions     = Extensions du Java
 JavaHome           = R\u00e9pertoire du Java
@@ -44,6 +45,7 @@ Paths              = Chemins
 Root               = Racine
 RootMeanSquare     = Moyenne quadratique
 Scale              = \u00c9chelle
+Source             = Source
 StandardDeviation  = \u00c9cart type
 TemporaryFiles     = Fichiers temporaires
 Timezone           = Fuseau horaire

Modified: sis/trunk/sis-utility/src/main/java/org/apache/sis/xml/IdentifiedObject.java
URL: http://svn.apache.org/viewvc/sis/trunk/sis-utility/src/main/java/org/apache/sis/xml/IdentifiedObject.java?rev=1457601&r1=1457600&r2=1457601&view=diff
==============================================================================
--- sis/trunk/sis-utility/src/main/java/org/apache/sis/xml/IdentifiedObject.java [UTF-8] (original)
+++ sis/trunk/sis-utility/src/main/java/org/apache/sis/xml/IdentifiedObject.java [UTF-8] Sun Mar 17 23:53:53 2013
@@ -64,7 +64,7 @@ import org.opengis.metadata.citation.Cit
  * @module
  *
  * @see IdentifierSpace
- * @see org.apache.sis.metadata.iso.MetadataEntity
+ * @see org.apache.sis.metadata.iso.ISOMetadata
  * @see ReferenceResolver#newIdentifiedObject(MarshalContext, Class, Identifier[])
  */
 public interface IdentifiedObject {

Modified: sis/trunk/sis-utility/src/main/java/org/apache/sis/xml/NilObjectHandler.java
URL: http://svn.apache.org/viewvc/sis/trunk/sis-utility/src/main/java/org/apache/sis/xml/NilObjectHandler.java?rev=1457601&r1=1457600&r2=1457601&view=diff
==============================================================================
--- sis/trunk/sis-utility/src/main/java/org/apache/sis/xml/NilObjectHandler.java [UTF-8] (original)
+++ sis/trunk/sis-utility/src/main/java/org/apache/sis/xml/NilObjectHandler.java [UTF-8] Sun Mar 17 23:53:53 2013
@@ -34,7 +34,7 @@ import org.apache.sis.internal.jaxb.Iden
 import org.apache.sis.internal.jaxb.IdentifierMapWithSpecialCases;
 
 // Related to JDK7
-import org.apache.sis.internal.util.Objects;
+import org.apache.sis.internal.jdk7.Objects;
 
 
 /**

Modified: sis/trunk/sis-utility/src/main/java/org/apache/sis/xml/XLink.java
URL: http://svn.apache.org/viewvc/sis/trunk/sis-utility/src/main/java/org/apache/sis/xml/XLink.java?rev=1457601&r1=1457600&r2=1457601&view=diff
==============================================================================
--- sis/trunk/sis-utility/src/main/java/org/apache/sis/xml/XLink.java [UTF-8] (original)
+++ sis/trunk/sis-utility/src/main/java/org/apache/sis/xml/XLink.java [UTF-8] Sun Mar 17 23:53:53 2013
@@ -31,7 +31,7 @@ import org.apache.sis.util.logging.Loggi
 import org.apache.sis.util.resources.Errors;
 
 // Related to JDK7
-import org.apache.sis.internal.util.Objects;
+import org.apache.sis.internal.jdk7.Objects;
 
 
 /**

Modified: sis/trunk/sis-utility/src/test/java/org/apache/sis/io/TableAppenderTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/sis-utility/src/test/java/org/apache/sis/io/TableAppenderTest.java?rev=1457601&r1=1457600&r2=1457601&view=diff
==============================================================================
--- sis/trunk/sis-utility/src/test/java/org/apache/sis/io/TableAppenderTest.java [UTF-8] (original)
+++ sis/trunk/sis-utility/src/test/java/org/apache/sis/io/TableAppenderTest.java [UTF-8] Sun Mar 17 23:53:53 2013
@@ -23,7 +23,7 @@ import org.junit.Test;
 import static org.junit.Assert.*;
 
 // Related to JK7
-import org.apache.sis.internal.util.JDK7;
+import org.apache.sis.internal.jdk7.JDK7;
 
 
 /**

Modified: sis/trunk/sis-utility/src/test/java/org/apache/sis/io/WordWrapTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/sis-utility/src/test/java/org/apache/sis/io/WordWrapTest.java?rev=1457601&r1=1457600&r2=1457601&view=diff
==============================================================================
--- sis/trunk/sis-utility/src/test/java/org/apache/sis/io/WordWrapTest.java [UTF-8] (original)
+++ sis/trunk/sis-utility/src/test/java/org/apache/sis/io/WordWrapTest.java [UTF-8] Sun Mar 17 23:53:53 2013
@@ -25,7 +25,7 @@ import static org.junit.Assert.*;
 import static org.apache.sis.util.Characters.SOFT_HYPHEN;
 
 // Related to JK7
-import org.apache.sis.internal.util.JDK7;
+import org.apache.sis.internal.jdk7.JDK7;
 
 
 /**

Modified: sis/trunk/sis-utility/src/test/java/org/apache/sis/test/Assert.java
URL: http://svn.apache.org/viewvc/sis/trunk/sis-utility/src/test/java/org/apache/sis/test/Assert.java?rev=1457601&r1=1457600&r2=1457601&view=diff
==============================================================================
--- sis/trunk/sis-utility/src/test/java/org/apache/sis/test/Assert.java [UTF-8] (original)
+++ sis/trunk/sis-utility/src/test/java/org/apache/sis/test/Assert.java [UTF-8] Sun Mar 17 23:53:53 2013
@@ -35,7 +35,7 @@ import org.apache.sis.util.CharSequences
 import org.apache.sis.util.ComparisonMode;
 
 // Related to JDK7
-import org.apache.sis.internal.util.Objects;
+import org.apache.sis.internal.jdk7.Objects;
 
 
 /**

Modified: sis/trunk/sis-utility/src/test/java/org/apache/sis/test/XMLComparator.java
URL: http://svn.apache.org/viewvc/sis/trunk/sis-utility/src/test/java/org/apache/sis/test/XMLComparator.java?rev=1457601&r1=1457600&r2=1457601&view=diff
==============================================================================
--- sis/trunk/sis-utility/src/test/java/org/apache/sis/test/XMLComparator.java [UTF-8] (original)
+++ sis/trunk/sis-utility/src/test/java/org/apache/sis/test/XMLComparator.java [UTF-8] Sun Mar 17 23:53:53 2013
@@ -50,7 +50,7 @@ import static org.apache.sis.util.Charac
 import static org.apache.sis.util.CharSequences.trimWhitespaces;
 
 // Related to JDK7
-import org.apache.sis.internal.util.JDK7;
+import org.apache.sis.internal.jdk7.JDK7;
 
 
 /**

Modified: sis/trunk/sis-utility/src/test/java/org/apache/sis/test/suite/UtilityTestSuite.java
URL: http://svn.apache.org/viewvc/sis/trunk/sis-utility/src/test/java/org/apache/sis/test/suite/UtilityTestSuite.java?rev=1457601&r1=1457600&r2=1457601&view=diff
==============================================================================
--- sis/trunk/sis-utility/src/test/java/org/apache/sis/test/suite/UtilityTestSuite.java [UTF-8] (original)
+++ sis/trunk/sis-utility/src/test/java/org/apache/sis/test/suite/UtilityTestSuite.java [UTF-8] Sun Mar 17 23:53:53 2013
@@ -90,6 +90,15 @@ import org.junit.runners.Suite;
     org.apache.sis.util.collection.TreeTableFormatTest.class,
     org.apache.sis.util.collection.RangeSetTest.class,
 
+    // Converters
+    org.apache.sis.internal.converter.AngleConverterTest.class,
+    org.apache.sis.internal.converter.PathConverterTest.class,
+    org.apache.sis.internal.converter.StringConverterTest.class,
+    org.apache.sis.internal.converter.FallbackConverterTest.class,
+    org.apache.sis.internal.converter.ConverterRegistryTest.class,
+    org.apache.sis.internal.converter.SystemRegistryTest.class,
+    org.apache.sis.internal.converter.NumberConverterTest.class, // Shall be after SystemRegistryTest.
+
     // XML most basic types.
     org.apache.sis.xml.XLinkTest.class,
     org.apache.sis.xml.NilReasonTest.class,

Modified: sis/trunk/sis-utility/src/test/java/org/apache/sis/util/ClassesTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/sis-utility/src/test/java/org/apache/sis/util/ClassesTest.java?rev=1457601&r1=1457600&r2=1457601&view=diff
==============================================================================
--- sis/trunk/sis-utility/src/test/java/org/apache/sis/util/ClassesTest.java [UTF-8] (original)
+++ sis/trunk/sis-utility/src/test/java/org/apache/sis/util/ClassesTest.java [UTF-8] Sun Mar 17 23:53:53 2013
@@ -88,7 +88,7 @@ public final strictfp class ClassesTest 
      */
     @Test
     public void testGetAllInterfaces() {
-        final Set<Class<?>> interfaces = getAllInterfaces(ArrayList.class);
+        final Set<Class<?>> interfaces = getInterfaceSet(ArrayList.class);
         assertTrue(interfaces.contains(List        .class));
         assertTrue(interfaces.contains(Collection  .class));
         assertTrue(interfaces.contains(Iterable    .class));

Modified: sis/trunk/sis-utility/src/test/java/org/apache/sis/util/NumbersTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/sis-utility/src/test/java/org/apache/sis/util/NumbersTest.java?rev=1457601&r1=1457600&r2=1457601&view=diff
==============================================================================
--- sis/trunk/sis-utility/src/test/java/org/apache/sis/util/NumbersTest.java [UTF-8] (original)
+++ sis/trunk/sis-utility/src/test/java/org/apache/sis/util/NumbersTest.java [UTF-8] Sun Mar 17 23:53:53 2013
@@ -148,25 +148,37 @@ public final class NumbersTest extends T
     }
 
     /**
-     * Tests {@link Numbers#narrowestClass(double)}.
+     * Tests {@link Numbers#narrowestClass(Number)}.
      */
     @Test
     public void testNarrowestClassForValue() {
-        assertEquals(Byte   .class, narrowestClass(    10.0));
-        assertEquals(Short  .class, narrowestClass(  1000.0));
-        assertEquals(Integer.class, narrowestClass(100000.0));
-        assertEquals(Float  .class, narrowestClass(    10.5));
+        assertEquals(Byte   .class, narrowestClass(    127.0));
+        assertEquals(Short  .class, narrowestClass(    128.0));
+        assertEquals(Integer.class, narrowestClass( 100000.0));
+        assertEquals(Float  .class, narrowestClass(     10.5));
+        assertEquals(Byte   .class, narrowestClass(   -128  ));
+        assertEquals(Short  .class, narrowestClass(   -129  ));
+        assertEquals(Integer.class, narrowestClass(-100000  ));
+        assertEquals(Integer.class, narrowestClass((double) (1L << 30)));
+        assertEquals(Float  .class, narrowestClass((double) (1L << 40)));
+        assertEquals(Double .class, narrowestClass(Math.PI));
     }
 
     /**
-     * Tests {@link Numbers#narrowestNumber(double)}.
+     * Tests {@link Numbers#narrowestNumber(Number)}.
      */
     @Test
     public void testNarrowestNumber() {
-        assertEquals(Byte   .valueOf((byte)    10), narrowestNumber(    10.0));
-        assertEquals(Short  .valueOf((short) 1000), narrowestNumber(  1000.0));
-        assertEquals(Integer.valueOf(      100000), narrowestNumber(100000.0));
-        assertEquals(Float  .valueOf(       10.5f), narrowestNumber(    10.5));
+        assertEquals(Byte   .valueOf((byte)   127), narrowestNumber(    127.0));
+        assertEquals(Short  .valueOf((short)  128), narrowestNumber(    128.0));
+        assertEquals(Integer.valueOf(      100000), narrowestNumber( 100000.0));
+        assertEquals(Float  .valueOf(       10.5f), narrowestNumber(     10.5));
+        assertEquals(Byte   .valueOf((byte)  -128), narrowestNumber(   -128  ));
+        assertEquals(Short  .valueOf((short) -129), narrowestNumber(   -129  ));
+        assertEquals(Integer.valueOf(     -100000), narrowestNumber(-100000  ));
+        assertEquals(Integer.valueOf(1  << 30),     narrowestNumber((double) (1L << 30)));
+        assertEquals(Float  .valueOf(1L << 40),     narrowestNumber((double) (1L << 40)));
+        assertEquals(Double .valueOf(Math.PI),      narrowestNumber(Math.PI));
     }
 
     /**

Modified: sis/trunk/sis-utility/src/test/java/org/apache/sis/util/collection/TreeTablesTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/sis-utility/src/test/java/org/apache/sis/util/collection/TreeTablesTest.java?rev=1457601&r1=1457600&r2=1457601&view=diff
==============================================================================
--- sis/trunk/sis-utility/src/test/java/org/apache/sis/util/collection/TreeTablesTest.java [UTF-8] (original)
+++ sis/trunk/sis-utility/src/test/java/org/apache/sis/util/collection/TreeTablesTest.java [UTF-8] Sun Mar 17 23:53:53 2013
@@ -73,19 +73,19 @@ public final strictfp class TreeTablesTe
     public void testConcatenateSingletons() throws ParseException {
         final TreeTable table = TreeTables.parse(
                 "root\n" +
-                "├───users\n" +
-                "│   └───alice\n" +
-                "│       ├───data\n" +
-                "│       │   └───mercator\n" +
-                "│       └───document\n" +
-                "└───lib\n", NAME);
+                "  ├─users\n" +
+                "  │   └─alice\n" +
+                "  │       ├─data\n" +
+                "  │       │   └─mercator\n" +
+                "  │       └─document\n" +
+                "  └─lib\n", NAME);
         ((DefaultTreeTable) table).setRoot(concatenateSingletons(table.getRoot()));
         assertMultilinesEquals(
                 "root\n" +
-                "├───users/alice\n" +
-                "│   ├───data/mercator\n" +
-                "│   └───document\n" +
-                "└───lib\n".replace("/", File.separator), table.toString());
+                "  ├─users/alice\n" +
+                "  │   ├─data/mercator\n" +
+                "  │   └─document\n" +
+                "  └─lib\n".replace("/", File.separator), table.toString());
     }
 
     /**
@@ -104,14 +104,14 @@ public final strictfp class TreeTablesTe
         nodeForPath(files, NAME, new File("users/Alice/data/mercator")).setValue(VALUE_AS_NUMBER, 60);
         assertMultilinesEquals(
                 "Root\n" +
-                "├───users\n" +
-                "│   ├───Alice\n" +
-                "│   │   ├───data………………………… 10\n" +
-                "│   │   │   └───mercator…… 60\n" +
-                "│   │   └───document……………… 50\n" +
-                "│   └───Bob……………………………………… 30\n" +
-                "│       └───data………………………… 20\n" +
-                "└───lib………………………………………………… 40\n", table.toString());
+                "  ├─users\n" +
+                "  │   ├─Alice\n" +
+                "  │   │   ├─data………………………… 10\n" +
+                "  │   │   │   └─mercator…… 60\n" +
+                "  │   │   └─document……………… 50\n" +
+                "  │   └─Bob……………………………………… 30\n" +
+                "  │       └─data………………………… 20\n" +
+                "  └─lib………………………………………………… 40\n", table.toString());
     }
 
     /**

Modified: sis/trunk/sis-webapp/pom.xml
URL: http://svn.apache.org/viewvc/sis/trunk/sis-webapp/pom.xml?rev=1457601&r1=1457600&r2=1457601&view=diff
==============================================================================
--- sis/trunk/sis-webapp/pom.xml (original)
+++ sis/trunk/sis-webapp/pom.xml Sun Mar 17 23:53:53 2013
@@ -54,11 +54,10 @@
 
   <build>
     <plugins>
-    <plugin>
-    <groupId>org.codehaus.mojo</groupId>
+      <plugin>
+        <groupId>org.codehaus.mojo</groupId>
         <artifactId>build-helper-maven-plugin</artifactId>
         <executions>
-
           <execution>
             <id>reserve-ports</id>
             <phase>initialize</phase>

Modified: sis/trunk/src/site/apt/index.apt
URL: http://svn.apache.org/viewvc/sis/trunk/src/site/apt/index.apt?rev=1457601&r1=1457600&r2=1457601&view=diff
==============================================================================
--- sis/trunk/src/site/apt/index.apt [UTF-8] (original)
+++ sis/trunk/src/site/apt/index.apt [UTF-8] Sun Mar 17 23:53:53 2013
@@ -28,6 +28,8 @@ The Apache SIS™ library
 
     * Developer Guide (English - translation to be provided later) ({{{./book/fr.xhtml}Français}})
 
+    * {{{http://cwiki.apache.org/confluence/display/SIS}SIS Wiki}}
+
 
 ** SIS developer documentation
 



Mime
View raw message