sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1584508 - in /sis/branches/JDK7: core/sis-utility/src/main/java/org/apache/sis/io/ core/sis-utility/src/main/java/org/apache/sis/math/ core/sis-utility/src/main/java/org/apache/sis/util/ core/sis-utility/src/test/java/org/apache/sis/util/ ...
Date Fri, 04 Apr 2014 02:56:13 GMT
Author: desruisseaux
Date: Fri Apr  4 02:56:12 2014
New Revision: 1584508

URL: http://svn.apache.org/r1584508
Log:
Cleaning for new development cycle: remove deprecated methods.

Modified:
    sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/io/TableAppender.java
    sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/math/MathFunctions.java
    sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/ArraysExt.java
    sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/Locales.java
    sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/util/LocalesTest.java
    sis/branches/JDK7/storage/sis-storage/src/main/java/org/apache/sis/storage/DataStoreProvider.java

Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/io/TableAppender.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/io/TableAppender.java?rev=1584508&r1=1584507&r2=1584508&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/io/TableAppender.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/io/TableAppender.java
[UTF-8] Fri Apr  4 02:56:12 2014
@@ -524,14 +524,6 @@ public class TableAppender extends Appen
      * Writes an horizontal separator.
      */
     public void appendHorizontalSeparator() {
-        writeHorizontalSeparator();
-    }
-
-    /**
-     * @deprecated Renamed {@link #appendHorizontalSeparator()}.
-     */
-    @Deprecated
-    public void writeHorizontalSeparator() {
         if (currentColumn != 0 || buffer.length() != 0) {
             nextLine();
         }

Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/math/MathFunctions.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/math/MathFunctions.java?rev=1584508&r1=1584507&r2=1584508&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/math/MathFunctions.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/math/MathFunctions.java
[UTF-8] Fri Apr  4 02:56:12 2014
@@ -208,23 +208,6 @@ public final class MathFunctions extends
     }
 
     /**
-     * @deprecated Moved to the {@link DecimalFunctions} class.
-     *
-     * @param  accuracy The desired accuracy of numbers to format in base 10.
-     * @param  strict {@code true} for checking the {@code 0.…95} special case.
-     *         If {@code false}, then the difference between adjacent formatted numbers is
not
-     *         guaranteed to be smaller than {@code accuracy} in every cases.
-     * @return Number of fraction digits needed for formatting numbers with the given accuracy.
-     *         May be negative.
-     *
-     * @see java.text.NumberFormat#setMaximumFractionDigits(int)
-     */
-    @Deprecated
-    public static int fractionDigitsForDelta(double accuracy, final boolean strict) {
-        return DecimalFunctions.fractionDigitsForDelta(accuracy, strict);
-    }
-
-    /**
      * Returns the unbiased exponent used in the representation of a {@code double}, with
correction for
      * sub-normal numbers. This method is related to {@link Math#getExponent(double)} in
the following ways:
      *
@@ -485,118 +468,6 @@ public final class MathFunctions extends
     }
 
     /**
-     * Returns the sign of <var>x</var>. This method returns
-     *    -1 if <var>x</var> is negative,
-     *     0 if <var>x</var> is zero or {@code NaN} and
-     *    +1 if <var>x</var> is positive.
-     *
-     * @param x The number from which to get the sign.
-     * @return {@code +1} if <var>x</var> is positive, {@code -1} if negative,
or 0 otherwise.
-     *
-     * @see Math#signum(double)
-     *
-     * @deprecated Something close is available in standard Java as {@link Math#signum(double)}.
-     */
-    @Deprecated
-    public static int sgn(final double x) {
-        if (x > 0) return +1;
-        if (x < 0) return -1;
-        else       return  0;
-    }
-
-    /**
-     * Returns the sign of <var>x</var>. This method returns
-     *    -1 if <var>x</var> is negative,
-     *     0 if <var>x</var> is zero or {@code NaN} and
-     *    +1 if <var>x</var> is positive.
-     *
-     * @param x The number from which to get the sign.
-     * @return {@code +1} if <var>x</var> is positive, {@code -1} if negative,
or 0 otherwise.
-     *
-     * @see Math#signum(float)
-     *
-     * @deprecated Something close is available in standard Java as {@link Math#signum(float)}.
-     */
-    @Deprecated
-    public static int sgn(final float x) {
-        if (x > 0) return +1;
-        if (x < 0) return -1;
-        else       return  0;
-    }
-
-    /**
-     * Returns the sign of <var>x</var>. This method returns
-     *    -1 if <var>x</var> is negative,
-     *     0 if <var>x</var> is zero and
-     *    +1 if <var>x</var> is positive.
-     *
-     * @param x The number from which to get the sign.
-     * @return {@code +1} if <var>x</var> is positive, {@code -1} if negative,
or 0 otherwise.
-     *
-     * @deprecated Available in standard Java as {@link Long#signum(long)}.
-     */
-    @Deprecated
-    public static int sgn(long x) {
-        if (x > 0) return +1;
-        if (x < 0) return -1;
-        else       return  0;
-    }
-
-    /**
-     * Returns the sign of <var>x</var>. This method returns
-     *    -1 if <var>x</var> is negative,
-     *     0 if <var>x</var> is zero and
-     *    +1 if <var>x</var> is positive.
-     *
-     * @param x The number from which to get the sign.
-     * @return {@code +1} if <var>x</var> is positive, {@code -1} if negative,
or 0 otherwise.
-     *
-     * @deprecated Available in standard Java as {@link Integer#signum(int)}.
-     */
-    @Deprecated
-    public static int sgn(int x) {
-        if (x > 0) return +1;
-        if (x < 0) return -1;
-        else       return  0;
-    }
-
-    /**
-     * Returns the sign of <var>x</var>. This method returns
-     *    -1 if <var>x</var> is negative,
-     *     0 if <var>x</var> is zero and
-     *    +1 if <var>x</var> is positive.
-     *
-     * @param x The number from which to get the sign.
-     * @return {@code +1} if <var>x</var> is positive, {@code -1} if negative,
or 0 otherwise.
-     *
-     * @deprecated Something close is available in standard Java as {@link Integer#signum(int)}.
-     */
-    @Deprecated
-    public static short sgn(short x) {
-        if (x > 0) return +1;
-        if (x < 0) return -1;
-        else       return  0;
-    }
-
-    /**
-     * Returns the sign of <var>x</var>. This method returns
-     *    -1 if <var>x</var> is negative,
-     *     0 if <var>x</var> is zero and
-     *    +1 if <var>x</var> is positive.
-     *
-     * @param x The number from which to get the sign.
-     * @return {@code +1} if <var>x</var> is positive, {@code -1} if negative,
or 0 otherwise.
-     *
-     * @deprecated Something close is available in standard Java as {@link Integer#signum(int)}.
-     */
-    @Deprecated
-    public static byte sgn(byte x) {
-        if (x > 0) return +1;
-        if (x < 0) return -1;
-        else       return  0;
-    }
-
-    /**
      * Returns {@code true} if the given values are {@linkplain Float#equals(Object) equal}
      * or if their difference is not greater than the given threshold. More specifically:
      *

Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/ArraysExt.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/ArraysExt.java?rev=1584508&r1=1584507&r2=1584508&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/ArraysExt.java [UTF-8]
(original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/ArraysExt.java [UTF-8]
Fri Apr  4 02:56:12 2014
@@ -1391,37 +1391,6 @@ public final class ArraysExt extends Sta
     }
 
     /**
-     * Returns a copy of the given array where each value has been casted to the {@code float}
type.
-     *
-     * @param  data The array to copy, or {@code null}.
-     * @return A copy of the given array with values casted to the {@code float} type, or
-     *         {@code null} if the given array was null.
-     *
-     * @deprecated Will be removed since we do not plan to provide static converter methods
for every possible
-     *             type combination, and user should probably control himself the rounding
behavior.
-     */
-    @Deprecated
-    public static float[] copyAsFloats(final double[] data) {
-        return org.apache.sis.internal.util.Numerics.copyAsFloats(data);
-    }
-
-    /**
-     * Returns a copy of the given array where each value has been
-     * {@linkplain Math#round(double) rounded} to the {@code int} type.
-     *
-     * @param  data The array to copy, or {@code null}.
-     * @return A copy of the given array with values rounded to the {@code int} type, or
-     *         {@code null} if the given array was null.
-     *
-     * @deprecated Will be removed since we do not plan to provide static converter methods
for every possible
-     *             type combination, and user should probably control himself the rounding
behavior.
-     */
-    @Deprecated
-    public static int[] copyAsInts(final double[] data) {
-        return org.apache.sis.internal.util.Numerics.copyAsInts(data);
-    }
-
-    /**
      * Returns {@code true} if all elements in the specified array are in increasing order.
      * Special cases:
      *

Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/Locales.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/Locales.java?rev=1584508&r1=1584507&r2=1584508&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/Locales.java [UTF-8]
(original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/Locales.java [UTF-8]
Fri Apr  4 02:56:12 2014
@@ -102,7 +102,7 @@ public final class Locales extends Stati
      */
     private static final short[] ISO3, ISO2;
     static {
-        final Short CONFLICT = (short) 0; // Sentinal value for conflicts (paranoiac safety).
+        final Short CONFLICT = 0; // Sentinal value for conflicts (paranoiac safety).
         final Map<Short,Short> map = new TreeMap<>();
         for (final Locale locale : POOL.values()) {
             short type = LANGUAGE; // 0 for language, or leftmost bit set for country.
@@ -202,37 +202,14 @@ filter: for (final Locale locale : local
     }
 
     /**
-     * Returns the list of {@linkplain #getAvailableLocales() available locales} formatted
-     * as strings in the specified locale.
-     *
-     * @param  locale The locale to use for formatting the strings to be returned.
-     * @return String descriptions of available locales.
-     *
-     * @deprecated Not useful in practice, since we typically also need the original Locale
object.
-     */
-    @Deprecated // Remove for simplifiying the API.
-    public String[] getAvailableLocales(final Locale locale) {
-        final Locale[] locales = getAvailableLocales();
-        final String[] display = new String[locales.length];
-        for (int i=0; i<locales.length; i++) {
-            display[i] = locales[i].getDisplayName(locale);
-        }
-        Arrays.sort(display);
-        return display;
-    }
-
-    /**
      * Returns the languages of the given locales, without duplicated values.
      * The instances returned by this method have no {@linkplain Locale#getCountry() country}
      * and no {@linkplain Locale#getVariant() variant} information.
      *
      * @param  locales The locales from which to get the languages.
      * @return The languages, without country or variant information.
-     *
-     * @deprecated Users can easily perform this operation themselves, thus avoiding this
class initialization.
      */
-    @Deprecated // Make this method private for simplifiying the API.
-    public static Locale[] getLanguages(final Locale... locales) {
+    private static Locale[] getLanguages(final Locale... locales) {
         final Set<String> codes = new LinkedHashSet<>(hashMapCapacity(locales.length));
         for (final Locale locale : locales) {
             codes.add(locale.getLanguage());
@@ -320,50 +297,6 @@ filter: for (final Locale locale : local
     }
 
     /**
-     * Parses the language encoded in the suffix of a property key. This convenience method
-     * is used when a property in a {@link java.util.Map} may have many localized variants.
-     * For example the {@code "remarks"} property may be defined by values associated to
the
-     * {@code "remarks_en"} and {@code "remarks_fr"} keys, for English and French locales
-     * respectively.
-     *
-     * <p>This method infers the {@code Locale} from the property {@code key} with
the following steps:</p>
-     *
-     * <ul>
-     *   <li>If the given {@code key} is exactly equals to {@code prefix},
-     *       then this method returns {@link Locale#ROOT}.</li>
-     *   <li>Otherwise if the given {@code key} does not start with the specified {@code
prefix}
-     *       followed by the {@code '_'} character, then this method returns {@code null}.</li>
-     *   <li>Otherwise, the characters after the {@code '_'} are parsed as an ISO language
-     *       and country code by the {@link #parse(String, int)} method.</li>
-     * </ul>
-     *
-     * @param  prefix The prefix to skip at the beginning of the {@code key}.
-     * @param  key    The property key from which to extract the locale, or {@code null}.
-     * @return The locale encoded in the given key name, or {@code null} if the key has not
been recognized.
-     * @throws IllformedLocaleException if the locale after the prefix is an illegal code.
-     *
-     * @see org.apache.sis.util.iso.Types#toInternationalString(Map, String)
-     *
-     * @deprecated Users can easily perform this operation themselves, thus avoiding this
class initialization.
-     */
-    @Deprecated
-    public static Locale parseSuffix(final String prefix, final String key) throws IllformedLocaleException
{
-        ArgumentChecks.ensureNonNull("prefix", prefix);
-        if (key != null) { // Tolerance for Map that accept null keys.
-            if (key.startsWith(prefix)) {
-                final int offset = prefix.length();
-                if (key.length() == offset) {
-                    return Locale.ROOT;
-                }
-                if (key.charAt(offset) == '_') {
-                    return parse(key, offset + 1);
-                }
-            }
-        }
-        return null;
-    }
-
-    /**
      * Converts a 3-letters ISO code to a 2-letters one. If the given code is not recognized,
      * then this method returns {@code code} unmodified.
      *

Modified: sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/util/LocalesTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/util/LocalesTest.java?rev=1584508&r1=1584507&r2=1584508&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/util/LocalesTest.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/util/LocalesTest.java
[UTF-8] Fri Apr  4 02:56:12 2014
@@ -112,19 +112,4 @@ public final strictfp class LocalesTest 
             assertTrue(message, message.contains("APPLE"));
         }
     }
-
-    /**
-     * Tests the {@link Locales#parseSuffix(String, String)} method.
-     */
-    @Test
-    @Deprecated
-    @DependsOnMethod("testParse")
-    public void testParseSuffix() {
-        assertSame(null,           Locales.parseSuffix("remarks", "remark"));
-        assertSame(Locale.ROOT,    Locales.parseSuffix("remarks", "remarks"));
-        assertSame(Locale.ENGLISH, Locales.parseSuffix("remarks", "remarks_en"));
-        assertSame(Locale.FRENCH,  Locales.parseSuffix("remarks", "remarks_fr"));
-        assertSame(Locale.FRENCH,  Locales.parseSuffix("remarks", "remarks_fra"));
-        assertSame(null,           Locales.parseSuffix("remarks", "remarks2_en"));
-    }
 }

Modified: sis/branches/JDK7/storage/sis-storage/src/main/java/org/apache/sis/storage/DataStoreProvider.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/storage/sis-storage/src/main/java/org/apache/sis/storage/DataStoreProvider.java?rev=1584508&r1=1584507&r2=1584508&view=diff
==============================================================================
--- sis/branches/JDK7/storage/sis-storage/src/main/java/org/apache/sis/storage/DataStoreProvider.java
[UTF-8] (original)
+++ sis/branches/JDK7/storage/sis-storage/src/main/java/org/apache/sis/storage/DataStoreProvider.java
[UTF-8] Fri Apr  4 02:56:12 2014
@@ -125,25 +125,4 @@ public abstract class DataStoreProvider 
      * @see DataStores#open(Object)
      */
     public abstract DataStore open(StorageConnector storage) throws DataStoreException;
-
-    /**
-     * Returns {@code TRUE} if the given storage appears to be supported by the {@code DataStore}.
-     *
-     * @param  storage Information about the storage (URL, stream, JDBC connection, <i>etc</i>).
-     * @return {@link Boolean#TRUE} if the given storage seems to be usable by the {@code
DataStore} instances
-     *         create by this provider, {@link Boolean#FALSE} if the {@code DataStore} will
not be able to use
-     *         the given storage, or {@code null} if this method does not have enough information.
-     * @throws DataStoreException if an I/O or SQL error occurred. The error shall be unrelated
to the logical
-     *         structure of the storage.
-     *
-     * @deprecated Replaced by {@link #probeContent(StorageConnector)}.
-     */
-    @Deprecated
-    public Boolean canOpen(final StorageConnector storage) throws DataStoreException {
-        final ProbeResult probe = probeContent(storage);
-        if (ProbeResult.INSUFFICIENT_BYTES.equals(probe) || ProbeResult.UNDETERMINED.equals(probe))
{
-            return null;
-        }
-        return probe.isSupported();
-    }
 }



Mime
View raw message