sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1675087 - in /sis/branches/JDK7: ./ core/sis-metadata/src/main/java/org/apache/sis/metadata/ core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/ core/sis-referencing/src/main/java/org/apache/sis/parameter/ core/sis-refere...
Date Tue, 21 Apr 2015 10:54:41 GMT
Author: desruisseaux
Date: Tue Apr 21 10:54:40 2015
New Revision: 1675087

URL: http://svn.apache.org/r1675087
Log:
Merge removal of deprecated methods and workaround for JSR-275 bug.

Modified:
    sis/branches/JDK7/   (props changed)
    sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/MetadataStandard.java
    sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/Citations.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterDescriptor.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultCompoundCS.java
    sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/provider/CoordinateOperationMethodsHTML.java
    sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/AbstractCRSTest.java
    sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/DefaultSphericalCSTest.java
    sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gco/UnitAdapter.java
    sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/util/Utilities.java
    sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/CharSequences.java
    sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/iso/Types.java
    sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/util/CharSequencesTest.java

Propchange: sis/branches/JDK7/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Apr 21 10:54:40 2015
@@ -1,4 +1,4 @@
 /sis/branches/Android:1430670-1480699
 /sis/branches/JDK6:1394913-1508480
-/sis/branches/JDK8:1584960-1674930
+/sis/branches/JDK8:1584960-1675086
 /sis/trunk:1394364-1508466,1519089-1519674

Modified: sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/MetadataStandard.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/MetadataStandard.java?rev=1675087&r1=1675086&r2=1675087&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/MetadataStandard.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/MetadataStandard.java
[UTF-8] Tue Apr 21 10:54:40 2015
@@ -138,15 +138,6 @@ public class MetadataStandard implements
     public static final MetadataStandard ISO_19115;
 
     /**
-     * An instance working on ISO 19119 standard as defined by GeoAPI interfaces
-     * in the {@code org.opengis.service} package and sub-packages.
-     *
-     * @deprecated as of ISO 19115:2014 revision, merged with {@link #ISO_19115}.
-     */
-    @Deprecated
-    public static final MetadataStandard ISO_19119;
-
-    /**
      * An instance working on ISO 19123 standard as defined by GeoAPI interfaces
      * in the {@link org.opengis.coverage} package and sub-packages.
      */
@@ -157,12 +148,10 @@ public class MetadataStandard implements
         // If new StandardImplementation instances are added below, please update StandardImplementation.readResolve().
         ISO_19115 = new StandardImplementation("ISO 19115", "org.opengis.metadata.", "org.apache.sis.metadata.iso.",
null, null);
         ISO_19111 = new StandardImplementation("ISO 19111", "org.opengis.referencing.", "org.apache.sis.referencing.",
acronyms, new MetadataStandard[] {ISO_19115});
-        ISO_19119 = new MetadataStandard      ("ISO 19119", "org.opengis.service.", ISO_19111.dependencies);
         ISO_19123 = new MetadataStandard      ("ISO 19123", "org.opengis.coverage.", new
MetadataStandard[] {ISO_19111});
         INSTANCES = new MetadataStandard[] {
             ISO_19111,
             ISO_19115,
-            ISO_19119,
             ISO_19123
         };
         SystemListener.add(new SystemListener(Modules.METADATA) {

Modified: sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/Citations.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/Citations.java?rev=1675087&r1=1675086&r2=1675087&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/Citations.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/Citations.java
[UTF-8] Tue Apr 21 10:54:40 2015
@@ -72,7 +72,7 @@ public final class Citations extends Sta
      *
      * @since 0.4
      *
-     * @deprecated The OGP organization is now known as IOGP. This citation will be removed
in SIS 0.6
+     * @deprecated The OGP organization is now known as IOGP. This citation will be removed
in SIS 0.7
      *             because of this name change and for avoiding confusion with {@link #EPSG}
citation.
      */
     @Deprecated

Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterDescriptor.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterDescriptor.java?rev=1675087&r1=1675086&r2=1675087&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterDescriptor.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterDescriptor.java
[UTF-8] Tue Apr 21 10:54:40 2015
@@ -251,33 +251,6 @@ public class DefaultParameterDescriptor<
     }
 
     /**
-     * Creates an optional or mandatory parameter. As a consequence of the merge with ISO
19115 {@code SV_Parameter},
-     * {@code DefaultParameterDescriptor} has been generalized to accept an arbitrary amount
of occurrences.
-     *
-     * @param properties   The properties to be given to the identified object.
-     * @param valueClass   The class that describes the type of the parameter value.
-     * @param valueDomain  The minimum value, maximum value and unit of measurement, or {@code
null} if none.
-     * @param validValues  The list of valid values, or {@code null} if there is no restriction.
-     *                     This property is mostly for restricting values to a {@linkplain
CodeList code list}
-     *                     or enumeration subset. It is not necessary to provide this property
when all values
-     *                     from the code list or enumeration are valid.
-     * @param defaultValue The default value for the parameter, or {@code null} if none.
-     * @param required     {@code true} if this parameter is mandatory, or {@code false}
if it is optional.
-     *
-     * @deprecated Replaced by the constructor with explicit minimum and maximum number of
occurrences.
-     */
-    @Deprecated
-    public DefaultParameterDescriptor(final Map<String,?> properties,
-                                      final Class<T>      valueClass,
-                                      final Range<?>      valueDomain,
-                                      final T[]           validValues,
-                                      final T             defaultValue,
-                                      final boolean       required)
-    {
-        this(properties, required ? 1 : 0, 1, valueClass, valueDomain, validValues, defaultValue);
-    }
-
-    /**
      * Creates a new descriptor with the same values than the specified one.
      * This copy constructor provides a way to convert an arbitrary implementation into a
SIS one or a
      * user-defined one (as a subclass), usually in order to leverage some implementation-specific
API.

Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultCompoundCS.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultCompoundCS.java?rev=1675087&r1=1675086&r2=1675087&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultCompoundCS.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultCompoundCS.java
[UTF-8] Tue Apr 21 10:54:40 2015
@@ -18,10 +18,10 @@ package org.apache.sis.referencing.cs;
 
 import java.util.Map;
 import java.util.List;
-import javax.measure.unit.Unit;
 import org.opengis.referencing.cs.CoordinateSystem;
 import org.opengis.referencing.cs.CoordinateSystemAxis;
 import org.apache.sis.internal.util.UnmodifiableArrayList;
+import org.apache.sis.internal.util.Utilities;
 import org.apache.sis.util.ComparisonMode;
 import org.apache.sis.util.Workaround;
 import org.apache.sis.util.iso.Types;
@@ -150,12 +150,9 @@ public class DefaultCompoundCS extends A
         for (final CoordinateSystemAxis axis : axes) {
             buffer.append(separator).append(Types.getCodeLabel(axis.getDirection()));
             separator = ", ";
-            final Unit<?> unit = axis.getUnit();
-            if (unit != null) {
-                final String symbol = unit.toString();
-                if (!symbol.isEmpty()) {
-                    buffer.append(" (").append(symbol).append(')');
-                }
+            final String symbol = Utilities.toString(axis.getUnit());
+            if (symbol != null && !symbol.isEmpty()) {
+                buffer.append(" (").append(symbol).append(')');
             }
         }
         return buffer.append('.').toString();

Modified: sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/provider/CoordinateOperationMethodsHTML.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/provider/CoordinateOperationMethodsHTML.java?rev=1675087&r1=1675086&r2=1675087&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/provider/CoordinateOperationMethodsHTML.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/provider/CoordinateOperationMethodsHTML.java
[UTF-8] Tue Apr 21 10:54:40 2015
@@ -23,7 +23,6 @@ import java.util.List;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.io.IOException;
-import javax.measure.unit.Unit;
 import org.opengis.util.FactoryException;
 import org.opengis.util.GenericName;
 import org.opengis.metadata.Identifier;
@@ -35,6 +34,7 @@ import org.opengis.referencing.crs.Coord
 import org.opengis.referencing.crs.GeneralDerivedCRS;
 import org.apache.sis.internal.system.DefaultFactories;
 import org.apache.sis.internal.util.Constants;
+import org.apache.sis.internal.util.Utilities;
 import org.apache.sis.measure.Range;
 import org.apache.sis.measure.Latitude;
 import org.apache.sis.measure.Longitude;
@@ -46,7 +46,6 @@ import org.apache.sis.referencing.operat
 import org.apache.sis.util.ArraysExt;
 import org.apache.sis.util.Characters;
 import org.apache.sis.util.Numbers;
-import org.apache.sis.util.Workaround;
 import org.apache.sis.test.HTMLGenerator;
 
 // Branch-dependent imports
@@ -477,20 +476,10 @@ public final class CoordinateOperationMe
      * Returns the string representation of the given parameter unit,
      * or an empty string (never {@code null}) if none.
      */
-    @Workaround(library="JSR-275", version="0.9.3")
     private static String getUnit(final ParameterDescriptor<?> param) {
-        final Unit<?> unit = param.getUnit();
-        if (unit != null) {
-            final String text;
-            try {
-                text = unit.toString();
-                if (!text.isEmpty()) {
-                    return text.equals("deg") ? "°" : " " + text;
-                }
-            } catch (IllegalArgumentException e) {
-                // Workaround for JSR-275 implementation bug.
-                // Do nothing, we will returns the empty string below.
-            }
+        final String unit = Utilities.toString(param.getUnit());
+        if (unit != null && !unit.isEmpty()) {
+            return " " + unit;
         }
         return "";
     }

Modified: sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/AbstractCRSTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/AbstractCRSTest.java?rev=1675087&r1=1675086&r2=1675087&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/AbstractCRSTest.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/AbstractCRSTest.java
[UTF-8] Tue Apr 21 10:54:40 2015
@@ -48,7 +48,7 @@ public final strictfp class AbstractCRST
                     new AbstractCS (singletonMap(NAME_KEY, "My strange CS"),
                     HardCodedAxes.TIME, HardCodedAxes.ALTITUDE, HardCodedAxes.GEODETIC_LATITUDE,
HardCodedAxes.GEODETIC_LONGITUDE));
         expected =  new AbstractCRS(singletonMap(NAME_KEY, "My CRS"),
-                    new AbstractCS (singletonMap(NAME_KEY, "Coordinate system: East (deg),
North (deg), Up (m), Future (d)."),
+                    new AbstractCS (singletonMap(NAME_KEY, "Coordinate system: East (°),
North (°), Up (m), Future (d)."),
                     HardCodedAxes.GEODETIC_LONGITUDE, HardCodedAxes.GEODETIC_LATITUDE, HardCodedAxes.ALTITUDE,
HardCodedAxes.TIME));
         actual   =  toTest.forConvention(AxesConvention.RIGHT_HANDED);
 

Modified: sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/DefaultSphericalCSTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/DefaultSphericalCSTest.java?rev=1675087&r1=1675086&r2=1675087&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/DefaultSphericalCSTest.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/DefaultSphericalCSTest.java
[UTF-8] Tue Apr 21 10:54:40 2015
@@ -43,7 +43,7 @@ public final strictfp class DefaultSpher
         final AbstractCS normalized = SPHERICAL.forConvention(AxesConvention.CONVENTIONALLY_ORIENTED);
         assertNotSame(SPHERICAL, normalized);
         assertEquals(new DefaultSphericalCS(
-            Collections.singletonMap(AbstractCS.NAME_KEY, "Spherical CS: East (deg), North
(deg), Up (m)."),
+            Collections.singletonMap(AbstractCS.NAME_KEY, "Spherical CS: East (°), North
(°), Up (m)."),
             HardCodedAxes.SPHERICAL_LONGITUDE,
             HardCodedAxes.SPHERICAL_LATITUDE,
             HardCodedAxes.GEOCENTRIC_RADIUS

Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gco/UnitAdapter.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gco/UnitAdapter.java?rev=1675087&r1=1675086&r2=1675087&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gco/UnitAdapter.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gco/UnitAdapter.java
[UTF-8] Tue Apr 21 10:54:40 2015
@@ -19,6 +19,7 @@ package org.apache.sis.internal.jaxb.gco
 import javax.measure.unit.Unit;
 import javax.xml.bind.annotation.adapters.XmlAdapter;
 import org.apache.sis.internal.jaxb.Context;
+import org.apache.sis.internal.util.Utilities;
 
 
 /**
@@ -54,7 +55,7 @@ public class UnitAdapter extends XmlAdap
      */
     @Override
     public String marshal(final Unit<?> value) {
-        return (value != null) ? value.toString() : null;
+        return Utilities.toString(value);
     }
 
     /**

Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/util/Utilities.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/util/Utilities.java?rev=1675087&r1=1675086&r2=1675087&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/util/Utilities.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/util/Utilities.java
[UTF-8] Tue Apr 21 10:54:40 2015
@@ -18,9 +18,11 @@ package org.apache.sis.internal.util;
 
 import java.util.Formatter;
 import java.util.FormattableFlags;
+import javax.measure.unit.Unit;
 import org.apache.sis.util.Static;
 import org.apache.sis.util.Classes;
 import org.apache.sis.util.CharSequences;
+import org.apache.sis.util.Workaround;
 
 
 /**
@@ -28,7 +30,7 @@ import org.apache.sis.util.CharSequences
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.3
- * @version 0.4
+ * @version 0.6
  * @module
  */
 public final class Utilities extends Static {
@@ -39,6 +41,31 @@ public final class Utilities extends Sta
     }
 
     /**
+     * Returns the string representation of the given unit, or {@code null} if none.
+     * This method is used as a workaround for a bug in JSR-275, which sometime throws
+     * an exception in the {@link Unit#toString()} method.
+     *
+     * @param  unit The unit for which to get a string representation, or {@code null}.
+     * @return The string representation of the given string (may be an empty string), or
{@code null}.
+     *
+     * @since 0.6
+     */
+    @Workaround(library="JSR-275", version="0.9.3")
+    public static String toString(final Unit<?> unit) {
+        if (unit != null) try {
+            String text = unit.toString();
+            if (text.equals("deg")) {
+                text = "°";
+            }
+            return text;
+        } catch (IllegalArgumentException e) {
+            // Workaround for JSR-275 implementation bug.
+            // Do nothing, we will return null below.
+        }
+        return null;
+    }
+
+    /**
      * Appends to the given buffer only the characters that are valid for a Unicode identifier.
      * The given separator character is append before the given {@code text} only if the
buffer
      * is not empty and at least one {@code text} character is valid.

Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/CharSequences.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/CharSequences.java?rev=1675087&r1=1675086&r2=1675087&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/CharSequences.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/CharSequences.java
[UTF-8] Tue Apr 21 10:54:40 2015
@@ -918,61 +918,6 @@ search:     for (; fromIndex <= toIndex;
     }
 
     /**
-     * Formats the given elements as a (typically) comma-separated list. This method is similar
to
-     * {@link java.util.AbstractCollection#toString()} or {@link java.util.Arrays#toString(Object[])}
-     * except for the following:
-     *
-     * <ul>
-     *   <li>There is no leading {@code '['} or trailing {@code ']'} characters.</li>
-     *   <li>Null elements are ignored instead than formatted as {@code "null"}.</li>
-     *   <li>If the {@code collection} argument is null or contains only null elements,
-     *       then this method returns {@code null}.</li>
-     *   <li>In the common case where the collection contains a single {@link String}
element,
-     *       that string is returned directly (no object duplication).</li>
-     * </ul>
-     *
-     * @param  collection The elements to format in a (typically) comma-separated list, or
{@code null}.
-     * @param  separator  The element separator, which is usually {@code ", "}.
-     * @return The (typically) comma-separated list, or {@code null} if the given {@code
collection}
-     *         was null or contains only null elements.
-     *
-     * @see java.util.StringJoiner
-     * @see java.util.Arrays#toString(Object[])
-     *
-     * @deprecated As of JDK8, use {@code java.util.StringJoiner} instead.
-     */
-    @Deprecated
-    public static String toString(final Iterable<?> collection, final String separator)
{
-        ArgumentChecks.ensureNonNull("separator", separator);
-        String list = null;
-        if (collection != null) {
-            StringBuilder buffer = null;
-            for (final Object element : collection) {
-                if (element != null) {
-                    if (list == null) {
-                        list = element.toString();
-                    } else {
-                        if (buffer == null) {
-                            buffer = new StringBuilder(list);
-                        }
-                        buffer.append(separator);
-                        if (element instanceof CharSequence) {
-                            // StringBuilder has numerous optimizations for this case.
-                            buffer.append((CharSequence) element);
-                        } else {
-                            buffer.append(element);
-                        }
-                    }
-                }
-            }
-            if (buffer != null) {
-                list = buffer.toString();
-            }
-        }
-        return list;
-    }
-
-    /**
      * Replaces some Unicode characters by ASCII characters on a "best effort basis".
      * For example the {@code 'é'} character is replaced by {@code 'e'} (without accent).
      *

Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/iso/Types.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/iso/Types.java?rev=1675087&r1=1675086&r2=1675087&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/iso/Types.java [UTF-8]
(original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/iso/Types.java [UTF-8]
Tue Apr 21 10:54:40 2015
@@ -31,11 +31,8 @@ import java.lang.reflect.InvocationTarge
 import java.lang.reflect.UndeclaredThrowableException;
 import org.opengis.annotation.UML;
 import org.opengis.util.CodeList;
-import org.opengis.util.NameFactory;
-import org.opengis.util.GenericName;
 import org.opengis.util.InternationalString;
 import org.opengis.util.Enumerated;
-import org.opengis.metadata.Identifier;
 import org.apache.sis.util.Static;
 import org.apache.sis.util.Locales;
 import org.apache.sis.util.CharSequences;
@@ -43,7 +40,6 @@ import org.apache.sis.util.ArgumentCheck
 import org.apache.sis.util.logging.Logging;
 import org.apache.sis.util.resources.Errors;
 import org.apache.sis.util.collection.BackingStoreException;
-import org.apache.sis.internal.system.DefaultFactories;
 
 
 /**
@@ -751,41 +747,4 @@ public final class Types extends Static
         }
         return copy;
     }
-
-    /**
-     * Converts the given value to an array of generic names. If the given value is an instance
of
-     * {@link GenericName}, {@link String} or any other type enumerated below, then it is
converted
-     * and returned in an array of length 1. If the given value is an array or a collection,
then an
-     * array of same length is returned where each element has been converted.
-     *
-     * <p>Allowed types or element types are:</p>
-     * <ul>
-     *   <li>{@link GenericName}, to be casted and returned as-is.</li>
-     *   <li>{@link CharSequence} (usually a {@link String} or an {@link InternationalString}),
-     *       to be parsed as a generic name using the {@link DefaultNameSpace#DEFAULT_SEPARATOR
':'} separator.</li>
-     *   <li>{@link Identifier}, its {@linkplain Identifier#getCode() code} to be parsed
as a generic name
-     *       using the {@link DefaultNameSpace#DEFAULT_SEPARATOR ':'} separator.</li>
-     * </ul>
-     *
-     * If {@code value} is an array or a collection containing {@code null} elements,
-     * then the corresponding element in the returned array will also be {@code null}.
-     *
-     * @param  value The object to cast into an array of generic names, or {@code null}.
-     * @param  factory The factory to use for creating names, or {@code null} for the default.
-     * @return The generic names, or {@code null} if the given {@code value} was null.
-     *         Note that it may be the {@code value} reference itself casted to {@code GenericName[]}.
-     * @throws ClassCastException if {@code value} can't be casted.
-     *
-     * @deprecated Moved to {@link DefaultNameFactory#toGenericNames(Object)}.
-     */
-    @Deprecated
-    public static GenericName[] toGenericNames(Object value, NameFactory factory) throws
ClassCastException {
-        if (value == null) {
-            return null;
-        }
-        if (!(factory instanceof DefaultNameFactory)) {
-            factory = DefaultFactories.forBuildin(NameFactory.class);
-        }
-       return ((DefaultNameFactory) factory).toGenericNames(value);
-    }
 }

Modified: sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/util/CharSequencesTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/util/CharSequencesTest.java?rev=1675087&r1=1675086&r2=1675087&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/util/CharSequencesTest.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/util/CharSequencesTest.java
[UTF-8] Tue Apr 21 10:54:40 2015
@@ -232,17 +232,6 @@ public final strictfp class CharSequence
     }
 
     /**
-     * Tests the {@link CharSequences#toString(Iterable, String)} method.
-     */
-    @Test
-    @SuppressWarnings("deprecation")
-    public void testToString() {
-        assertEquals("4, 8, 12, 9", CharSequences.toString(Arrays.asList(4, 8, 12, 9), ",
"));
-        assertSame  ("singleton",   CharSequences.toString(Arrays.asList("singleton"), ",
"));
-        assertNull  (               CharSequences.toString(null, ", "));
-    }
-
-    /**
      * Tests the {@link CharSequences#toASCII(CharSequence)} method.
      */
     @Test



Mime
View raw message