sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1773266 [2/2] - in /sis/branches/JDK8: core/sis-metadata/src/main/java/org/apache/sis/io/wkt/ core/sis-metadata/src/main/java/org/apache/sis/metadata/ core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/ core/...
Date Thu, 08 Dec 2016 16:22:44 GMT
Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultNameSpace.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultNameSpace.java?rev=1773266&r1=1773265&r2=1773266&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultNameSpace.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultNameSpace.java
[UTF-8] Thu Dec  8 16:22:44 2016
@@ -20,7 +20,9 @@ import java.util.Map;
 import java.util.List;
 import java.util.ListIterator;
 import java.util.Locale;
+import java.util.Objects;
 import java.io.Serializable;
+import java.io.ObjectStreamException;
 import org.opengis.util.NameSpace;
 import org.opengis.util.LocalName;
 import org.opengis.util.ScopedName;
@@ -32,9 +34,6 @@ import org.apache.sis.internal.util.Unmo
 
 import static org.apache.sis.util.ArgumentChecks.ensureNonNull;
 
-// Branch-dependent imports
-import java.util.Objects;
-
 
 /**
  * A domain in which {@linkplain AbstractName names} given by character strings are defined.
@@ -144,15 +143,15 @@ public class DefaultNameSpace implements
      * Creates a new namespace with the given separator.
      *
      * @param parent
-     *          The parent namespace, or {@code null} if none.
+     *          the parent namespace, or {@code null} if none.
      * @param name
-     *          The name of the new namespace, usually as a {@link String}
+     *          the name of the new namespace, usually as a {@link String}
      *          or an {@link InternationalString}.
      * @param headSeparator
-     *          The separator to insert between the namespace and the
+     *          the separator to insert between the namespace and the
      *          {@linkplain AbstractName#head() head} of any name in that namespace.
      * @param separator
-     *          The separator to insert between the {@linkplain AbstractName#getParsedNames()
+     *          the separator to insert between the {@linkplain AbstractName#getParsedNames()
      *          parsed names} of any name in that namespace.
      */
     protected DefaultNameSpace(final DefaultNameSpace parent, CharSequence name,
@@ -182,8 +181,8 @@ public class DefaultNameSpace implements
      * Wraps the given namespace in a {@code DefaultNameSpace} implementation.
      * This method returns an existing instance when possible.
      *
-     * @param  ns The namespace to wrap, or {@code null} for the global one.
-     * @return The given namespace as a {@code DefaultNameSpace} implementation.
+     * @param  ns  the namespace to wrap, or {@code null} for the global one.
+     * @return the given namespace as a {@code DefaultNameSpace} implementation.
      */
     static DefaultNameSpace castOrCopy(final NameSpace ns) {
         if (ns == null) {
@@ -200,14 +199,14 @@ public class DefaultNameSpace implements
      * This method returns an existing instance when possible.
      *
      * @param name
-     *          The name for the namespace to obtain, or {@code null}.
+     *          the name for the namespace to obtain, or {@code null}.
      * @param headSeparator
-     *          The separator to insert between the namespace and the
+     *          the separator to insert between the namespace and the
      *          {@linkplain AbstractName#head() head} of any name in that namespace.
      * @param separator
-     *          The separator to insert between the {@linkplain AbstractName#getParsedNames()
+     *          the separator to insert between the {@linkplain AbstractName#getParsedNames()
      *          parsed names} of any name in that namespace.
-     * @return A namespace having the given name, or {@code null} if name was null.
+     * @return a namespace having the given name, or {@code null} if name was null.
      */
     static DefaultNameSpace forName(final GenericName name, final String headSeparator, final
String separator) {
         if (name == null) {
@@ -262,8 +261,8 @@ public class DefaultNameSpace implements
     /**
      * Returns the depth of the given namespace.
      *
-     * @param ns The namespace for which to get the depth, or {@code null}.
-     * @return The depth of the given namespace.
+     * @param  ns  the namespace for which to get the depth, or {@code null}.
+     * @return the depth of the given namespace.
      */
     private static int depth(DefaultNameSpace ns) {
         int depth = 0;
@@ -283,7 +282,7 @@ public class DefaultNameSpace implements
      *     assert name.scope().isGlobal() == true;
      * }
      *
-     * @return The identifier of this namespace.
+     * @return the identifier of this namespace.
      */
     @Override
     public GenericName name() {
@@ -344,8 +343,8 @@ public class DefaultNameSpace implements
      * the head separator is {@code "://"} for {@code "www"} (which is having this namespace),
      * but it is {@code "."} for all children ({@code "opengeospatial"} and {@code "org"}).</p>
      *
-     * @param  name The name of the child namespace.
-     * @return The child namespace. It may be an existing instance.
+     * @param  name  the name of the child namespace.
+     * @return the child namespace. It may be an existing instance.
      */
     final DefaultNameSpace child(final CharSequence name) {
         return child(key(name), name, separator, separator);
@@ -355,8 +354,8 @@ public class DefaultNameSpace implements
      * Returns a key to be used in the {@linkplain #childs} pool from the given name.
      * The key must be the unlocalized version of the given string.
      *
-     * @param name The name.
-     * @return A key from the given name.
+     * @param  name  the name.
+     * @return a key from the given name.
      */
     private static String key(final CharSequence name) {
         return (name instanceof InternationalString) ?
@@ -368,16 +367,16 @@ public class DefaultNameSpace implements
      * The returned namespace will have this namespace as its parent.
      *
      * @param key
-     *          The unlocalized name of the child namespace, to be used as a key in the cache.
+     *          the unlocalized name of the child namespace, to be used as a key in the cache.
      * @param name
-     *          The name of the child namespace, or {@code null} if same than key.
+     *          the name of the child namespace, or {@code null} if same than key.
      * @param headSeparator
-     *          The separator to insert between the namespace and the
+     *          the separator to insert between the namespace and the
      *          {@linkplain AbstractName#head() head} of any name in that namespace.
      * @param separator
-     *          The separator to insert between the {@linkplain AbstractName#getParsedNames()
+     *          the separator to insert between the {@linkplain AbstractName#getParsedNames()
      *          parsed names} of any name in that namespace.
-     * @return The child namespace. It may be an existing instance.
+     * @return the child namespace. It may be an existing instance.
      */
     private DefaultNameSpace child(final String key, CharSequence name,
             final String headSeparator, final String separator)
@@ -419,10 +418,9 @@ public class DefaultNameSpace implements
      * namespace as its {@linkplain DefaultLocalName#scope() scope}. This method may returns
      * an existing instance on a "best effort" basis, but this is not guaranteed.
      *
-     * @param  name      The name of the instance to create.
-     * @param  candidate The instance to cache if no instance was found for the given name,
-     *                   or {@code null} if none.
-     * @return A name which is local in this namespace.
+     * @param  name       the name of the instance to create.
+     * @param  candidate  the instance to cache if no instance was found for the given name,
or {@code null} if none.
+     * @return a name which is local in this namespace.
      */
     final DefaultLocalName local(final CharSequence name, final DefaultLocalName candidate)
{
         ensureNonNull("name", name);
@@ -474,7 +472,7 @@ public class DefaultNameSpace implements
      * {@link NameSpace} contract. This implementation follows the JCR convention for debugging
convenience,
      * but applications needing better guarantees should use {@link Names#toExpandedString(GenericName)}
instead.
      *
-     * @return A JCR-like lexical form of this namespace.
+     * @return a JCR-like lexical form of this namespace.
      *
      * @see Names#toExpandedString(GenericName)
      */
@@ -487,7 +485,7 @@ public class DefaultNameSpace implements
     /**
      * Returns {@code true} if this namespace is equal to the given object.
      *
-     * @param object The object to compare with this namespace.
+     * @param  object  the object to compare with this namespace.
      * @return {@code true} if the given object is equal to this namespace.
      */
     @Override
@@ -502,7 +500,7 @@ public class DefaultNameSpace implements
     /**
      * Returns {@code true} if the namespace is equal to the given one, ignoring the parent.
      *
-     * @param that The namespace to compare with this one.
+     * @param  that  the namespace to compare with this one.
      * @return {@code true} if both namespaces are equal, ignoring the parent.
      */
     private boolean equalsIgnoreParent(final DefaultNameSpace that) {
@@ -527,9 +525,9 @@ public class DefaultNameSpace implements
      * the deserialized class is a subclass defined in an other package. This is the intended
      * behavior since we don't want to replace an instance of a user-defined class.</p>
      *
-     * @return The unique instance.
+     * @return the unique instance.
      */
-    Object readResolve() {
+    Object readResolve() throws ObjectStreamException {
         final DefaultNameSpace p = parent();
         final String key = key(name);
         final WeakValueHashMap<String,Object> pool = p.childs;

Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/iso/GlobalNameSpace.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/iso/GlobalNameSpace.java?rev=1773266&r1=1773265&r2=1773266&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/iso/GlobalNameSpace.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/iso/GlobalNameSpace.java
[UTF-8] Thu Dec  8 16:22:44 2016
@@ -16,6 +16,8 @@
  */
 package org.apache.sis.util.iso;
 
+import java.io.ObjectStreamException;
+
 
 /**
  * The global namespace. Only one instance of this class is allowed to exists. We do not
expose
@@ -58,10 +60,10 @@ final class GlobalNameSpace extends Defa
     /**
      * Returns the unique instance of global name space on deserialization.
      *
-     * @return The unique instance.
+     * @return the unique instance.
      */
     @Override
-    Object readResolve() {
+    Object readResolve() throws ObjectStreamException {
         return GLOBAL;
     }
 }

Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/xml/NilInternationalString.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/xml/NilInternationalString.java?rev=1773266&r1=1773265&r2=1773266&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/xml/NilInternationalString.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/xml/NilInternationalString.java
[UTF-8] Thu Dec  8 16:22:44 2016
@@ -18,6 +18,7 @@ package org.apache.sis.xml;
 
 import java.util.Locale;
 import java.io.Serializable;
+import java.io.ObjectStreamException;
 import org.opengis.util.InternationalString;
 import org.apache.sis.util.resources.Errors;
 
@@ -116,7 +117,7 @@ final class NilInternationalString imple
     /**
      * Invoked on deserialization for replacing the deserialized instance by the unique instance.
      */
-    private Object readResolve() {
+    private Object readResolve() throws ObjectStreamException {
         return reason.createNilObject(InternationalString.class);
     }
 }

Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/xml/NilReason.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/xml/NilReason.java?rev=1773266&r1=1773265&r2=1773266&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/xml/NilReason.java [UTF-8]
(original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/xml/NilReason.java [UTF-8]
Thu Dec  8 16:22:44 2016
@@ -20,6 +20,7 @@ import java.util.Map;
 import java.net.URI;
 import java.net.URISyntaxException;
 import java.io.Serializable;
+import java.io.ObjectStreamException;
 import java.lang.reflect.Proxy;
 import java.lang.reflect.InvocationHandler;
 import org.opengis.util.InternationalString;
@@ -174,7 +175,7 @@ public final class NilReason implements
      * defined in this class, in declaration order. All other elements are the instances
      * created by the {@link #valueOf(String)} method, in no particular order.
      *
-     * @return An array containing the instances of {@code NilReason}.
+     * @return an array containing the instances of {@code NilReason}.
      */
     public static NilReason[] values() {
         final int predefinedCount = PREDEFINED.length;
@@ -219,9 +220,9 @@ public final class NilReason implements
      *
      * This method returns existing instances when possible.
      *
-     * @param  reason The reason why an element is not present.
-     * @return The reason as a {@code NilReason} object.
-     * @throws URISyntaxException If the given string is not one of the predefined enumeration
+     * @param  reason  the reason why an element is not present.
+     * @return the reason as a {@code NilReason} object.
+     * @throws URISyntaxException if the given string is not one of the predefined enumeration
      *         values and can not be parsed as a URI.
      */
     public static NilReason valueOf(String reason) throws URISyntaxException {
@@ -262,9 +263,9 @@ public final class NilReason implements
     /**
      * Invoked after deserialization in order to return a unique instance if possible.
      *
-     * @return A unique instance of the deserialized {@code NilReason}.
+     * @return a unique instance of the deserialized {@code NilReason}.
      */
-    private Object readResolve() {
+    private Object readResolve() throws ObjectStreamException {
         if (reason instanceof String) {
             for (final NilReason candidate : PREDEFINED) {
                 if (reason.equals(candidate.reason)) {
@@ -284,7 +285,7 @@ public final class NilReason implements
      * instance itself, then this method returns an empty string. For all other cases, the
      * string contains at least two characters.</p>
      *
-     * @return The explanation, or {@code null} if this {@code NilReason} is not of kind
{@link #OTHER}.
+     * @return the explanation, or {@code null} if this {@code NilReason} is not of kind
{@link #OTHER}.
      */
     public String getOtherExplanation() {
         if (reason instanceof String) {
@@ -305,8 +306,7 @@ public final class NilReason implements
      * Otherwise returns {@code null}. The URI and the {@linkplain #getOtherExplanation()
other
      * explanation} attributes are mutually exclusive.
      *
-     * @return The URI, or {@code null} if the explanation of this {@code NilReason}
-     *         is not referenced by a URI.
+     * @return the URI, or {@code null} if the explanation of this {@code NilReason} is not
referenced by a URI.
      */
     public URI getURI() {
         return (reason instanceof URI) ? (URI) reason : null;
@@ -318,7 +318,7 @@ public final class NilReason implements
      * is one of the predefined constants, or a string of the form {@code "other:explanation"},
      * or a URI.
      *
-     * @return The GML string representation of this {@code NilReason}.
+     * @return the GML string representation of this {@code NilReason}.
      */
     @Override
     public String toString() {
@@ -336,7 +336,7 @@ public final class NilReason implements
     /**
      * Compares this {@code NilReason} with the specified object for equality.
      *
-     * @param other The object to compare with this {@code NilReason}.
+     * @param  other  the object to compare with this {@code NilReason}.
      */
     @Override
     public boolean equals(final Object other) {
@@ -366,11 +366,11 @@ public final class NilReason implements
      *       will be recognized as "nil" by the XML marshaller.</li>
      * </ul>
      *
-     * @param  <T> The compile-time type of the {@code type} argument.
-     * @param  type The object type as an <strong>interface</strong>
+     * @param  <T>   the compile-time type of the {@code type} argument.
+     * @param  type  the object type as an <strong>interface</strong>
      *         (usually a <a href="http://www.geoapi.org">GeoAPI</a> one) or
one of the special types.
-     * @throws IllegalArgumentException If the given type is not a supported type.
-     * @return An {@link NilObject} of the given type.
+     * @throws IllegalArgumentException if the given type is not a supported type.
+     * @return an {@link NilObject} of the given type.
      */
     @SuppressWarnings("unchecked")
     public synchronized <T> T createNilObject(final Class<T> type) {
@@ -440,9 +440,9 @@ public final class NilReason implements
      * probably still use a {@link String} where the string contain 1 or 2 Java characters.
This may also facilitate the
      * encoding in the XML files, since many files use an other encoding than UTF-16 anyway.</div>
      *
-     * @throws IllegalArgumentException If the given type is not a supported type.
+     * @throws IllegalArgumentException if the given type is not a supported type.
      */
-    @SuppressWarnings({"RedundantStringConstructorCall", "BooleanConstructorCall"})
+    @SuppressWarnings({"RedundantStringConstructorCall", "BooleanConstructorCall", "UnnecessaryBoxing"})
     private static Object createNilPrimitive(final Class<?> type) {
         if (type == String .class) return new String("");         // REALLY need a new instance.
         if (type == Boolean.class) return new Boolean(false);     // REALLY need a new instance,
not Boolean.FALSE.
@@ -491,9 +491,8 @@ public final class NilReason implements
      *   <li>Otherwise this method returns {@code null}.</li>
      * </ul>
      *
-     * @param  object The object for which to get the {@code NilReason}, or {@code null}.
-     * @return The reason why the given object contains no information,
-     *         or {@code null} if the given object is not nil.
+     * @param  object  the object for which to get the {@code NilReason}, or {@code null}.
+     * @return the reason why the given object contains no information, or {@code null} if
the given object is not nil.
      *
      * @see NilObject#getNilReason()
      *

Modified: sis/branches/JDK8/core/sis-utility/src/test/java/org/apache/sis/test/foreigner/SerializableTableColumn.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/test/java/org/apache/sis/test/foreigner/SerializableTableColumn.java?rev=1773266&r1=1773265&r2=1773266&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/test/java/org/apache/sis/test/foreigner/SerializableTableColumn.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/test/java/org/apache/sis/test/foreigner/SerializableTableColumn.java
[UTF-8] Thu Dec  8 16:22:44 2016
@@ -17,6 +17,7 @@
 package org.apache.sis.test.foreigner;
 
 import java.io.Serializable;
+import java.io.ObjectStreamException;
 import java.io.InvalidObjectException;
 import org.apache.sis.util.collection.TableColumn;
 
@@ -67,7 +68,7 @@ public final strictfp class Serializable
      * @return One of the predefined constants.
      * @throws InvalidObjectException If this instance can not be resolved.
      */
-    private Object readResolve() throws InvalidObjectException {
+    private Object readResolve() throws ObjectStreamException {
         try {
             return SerializableTableColumn.class.getField(field).get(null);
         } catch (Exception cause) { // Many exceptions, including unchecked ones.

Modified: sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/storage/ProbeResult.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/storage/ProbeResult.java?rev=1773266&r1=1773265&r2=1773266&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/storage/ProbeResult.java
[UTF-8] (original)
+++ sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/storage/ProbeResult.java
[UTF-8] Thu Dec  8 16:22:44 2016
@@ -16,14 +16,13 @@
  */
 package org.apache.sis.storage;
 
+import java.util.Objects;
 import java.io.Serializable;
+import java.io.ObjectStreamException;
 import org.apache.sis.util.Debug;
 import org.apache.sis.util.Version;
 import org.apache.sis.internal.util.Utilities;
 
-// Branch-dependent imports
-import java.util.Objects;
-
 
 /**
  * Tells whether a storage (file, database) appears to be supported by a {@code DataStore}.
@@ -156,10 +155,10 @@ public class ProbeResult implements Seri
     /**
      * Creates a new {@code ProbeResult} with the given support status, MIME type and version
number.
      *
-     * @param isSupported {@code true} if the storage is supported by the {@link DataStoreProvider}.
-     * @param mimeType    The storage MIME type, or {@code null} if unknown or not applicable.
-     * @param version     The version of file format or database schema used by the storage,
-     *                    or {@code null} if unknown or not applicable.
+     * @param isSupported  {@code true} if the storage is supported by the {@link DataStoreProvider}.
+     * @param mimeType     the storage MIME type, or {@code null} if unknown or not applicable.
+     * @param version      the version of file format or database schema used by the storage,
+     *                     or {@code null} if unknown or not applicable.
      */
     public ProbeResult(final boolean isSupported, final String mimeType, final Version version)
{
         this.isSupported = isSupported;
@@ -203,7 +202,7 @@ public class ProbeResult implements Seri
      *   <tr><td>{@code "application/soap+xml"}</td>                  
            <td></td><td></td></tr>
      * </table>
      *
-     * @return The storage MIME type, or {@code null} if unknown or not applicable.
+     * @return the storage MIME type, or {@code null} if unknown or not applicable.
      */
     public String getMimeType() {
         return mimeType;
@@ -213,7 +212,7 @@ public class ProbeResult implements Seri
      * Returns the version of file format or database schema used by the storage,
      * or {@code null} if unknown or not applicable.
      *
-     * @return The version of file format or database schema used by the storage,
+     * @return the version of file format or database schema used by the storage,
      *         or {@code null} if unknown or not applicable.
      */
     public Version getVersion() {
@@ -233,7 +232,7 @@ public class ProbeResult implements Seri
      * Two {@code ProbeResult}s are equal if they are instances of the same class
      * and all their properties are equal.
      *
-     * @param  object The object to compare with this {@code ProbeResult}.
+     * @param  object  the object to compare with this {@code ProbeResult}.
      * @return {@code true} if the two objects are equal.
      */
     @Override
@@ -287,7 +286,7 @@ public class ProbeResult implements Seri
          * okay if all comparisons are performed by the {@code equals} method instead
          * than the {@code ==} operator.
          */
-        Object readResolve() {
+        Object readResolve() throws ObjectStreamException {
             try {
                 return ProbeResult.class.getField(name).get(null);
             } catch (ReflectiveOperationException e) {



Mime
View raw message