sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1754982 - in /sis/branches/JDK8/core: sis-feature/src/main/java/org/apache/sis/feature/builder/ sis-feature/src/test/java/org/apache/sis/feature/builder/ sis-referencing/src/main/java/org/apache/sis/referencing/factory/ sis-referencing/src...
Date Tue, 02 Aug 2016 17:12:56 GMT
Author: desruisseaux
Date: Tue Aug  2 17:12:56 2016
New Revision: 1754982

URL: http://svn.apache.org/viewvc?rev=1754982&view=rev
Log:
Implement AttributeTypeBuilder.roles() method.
Opportunistic reformatting of javadoc of other classes built on top of SetOfUnknownSize.

Modified:
    sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/builder/AttributeTypeBuilder.java
    sis/branches/JDK8/core/sis-feature/src/test/java/org/apache/sis/feature/builder/AttributeTypeBuilderTest.java
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/MultiAuthoritiesFactory.java
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/OperationMethodSet.java
    sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/IdentifierMapAdapter.java
    sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/util/AbstractIterator.java
    sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/util/AbstractMap.java
    sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/util/LazySet.java
    sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/util/SetOfUnknownSize.java
    sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/collection/DerivedSet.java

Modified: sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/builder/AttributeTypeBuilder.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/builder/AttributeTypeBuilder.java?rev=1754982&r1=1754981&r2=1754982&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/builder/AttributeTypeBuilder.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/builder/AttributeTypeBuilder.java [UTF-8] Tue Aug  2 17:12:56 2016
@@ -18,6 +18,7 @@ package org.apache.sis.feature.builder;
 
 import java.util.ArrayList;
 import java.util.Collection;
+import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
@@ -27,6 +28,8 @@ import org.opengis.referencing.crs.Coord
 import org.apache.sis.feature.DefaultAttributeType;
 import org.apache.sis.feature.FeatureOperations;
 import org.apache.sis.internal.util.CollectionsExt;
+import org.apache.sis.internal.util.SetOfUnknownSize;
+import org.apache.sis.internal.util.AbstractIterator;
 import org.apache.sis.internal.feature.AttributeConvention;
 import org.apache.sis.internal.feature.Geometries;
 import org.apache.sis.util.resources.Errors;
@@ -440,11 +443,99 @@ public final class AttributeTypeBuilder<
     }
 
     /**
-     * Flags this attribute as an input of one of the pre-defined operations managed by {@code FeatureTypeBuilder}.
+     * Returns a view of all characteristics added to the {@code AttributeType} to build.
+     * The returned list is <cite>live</cite>: changes in this builder are reflected in that list and conversely.
+     * However the returned list allows only {@linkplain List#remove(Object) remove} operations;
+     * new characteristics can be added only by calls to one of the {@code set/addCharacteristic(…)} methods.
      *
-     * @param role the role to add to this attribute (shall not be null).
+     * @return a live list over the characteristics declared to this builder.
+     *
+     * @see #getCharacteristic(String)
+     * @see #addCharacteristic(Class)
+     * @see #addCharacteristic(AttributeType)
+     * @see #setValidValues(Object...)
+     * @see #setCRS(CoordinateReferenceSystem)
      */
-    public void addRole(final AttributeRole role) {
+    public List<CharacteristicTypeBuilder<?>> characteristics() {
+        return new RemoveOnlyList<>(characteristics);
+    }
+
+    /**
+     * Returns the roles that the attribute play in the pre-defined operations managed by {@code AttributeTypeBuilder}.
+     * The set returned by this method is <cite>live</cite>: additions or removal on that set are reflected back on
+     * this builder, and conversely.
+     *
+     * @return the roles that the attribute play in the pre-defined operations managed by {@code AttributeTypeBuilder}.
+     */
+    public Set<AttributeRole> roles() {
+        return new SetOfUnknownSize<AttributeRole>() {
+            @Override public Iterator<AttributeRole> iterator() {return new RoleIter();}
+            @Override public boolean add(AttributeRole role)    {return addRole(role);}
+        };
+    }
+
+    /**
+     * The iterator returned by the {@link AttributeTypeBuilder#roles()} set.
+     */
+    private final class RoleIter extends AbstractIterator<AttributeRole> {
+        /**
+         * Index of the next {@code AttributeRole} to return.
+         */
+        private int index;
+
+        /**
+         * Prepares the next {@code AttributeRole} on which to iterate and returns
+         * {@code true} if such {@code AttributeRole} has been found.
+         */
+        @Override
+        @SuppressWarnings("fallthrough")
+        public boolean hasNext() {
+            if (next == null) {
+                switch (index) {
+                    case 0: {
+                        if (isIdentifier) {
+                            next = AttributeRole.IDENTIFIER_COMPONENT;
+                            break;
+                        }
+                        index++;        // Fall through for testing the case for next 'index' value.
+                    }
+                    case 1: {
+                        if (owner().defaultGeometry == AttributeTypeBuilder.this) {
+                            next = AttributeRole.DEFAULT_GEOMETRY;
+                            break;
+                        }
+                        index++;        // Fall through for testing the case for next 'index' value.
+                    }
+                    default: {
+                        return false;
+                    }
+                }
+                index++;
+            }
+            return true;
+        }
+
+        /**
+         * Removes the element returned by the last {@link #next()} method.
+         */
+        @Override
+        public void remove() {
+            switch (index) {
+                case 1: isIdentifier = false; break;
+                case 2: owner().defaultGeometry = null; break;
+                default: throw new IllegalStateException();
+            }
+        }
+    }
+
+    /**
+     * Flags this attribute as an input of one of the pre-defined operations managed by {@code AttributeTypeBuilder}.
+     * Invoking this method is equivalent to invoking <code>{@linkplain #roles()}.add(role)</code>.
+     *
+     * @param  role the role to add to the attribute (shall not be null).
+     * @return {@code true} if the given role has been added to the attribute.
+     */
+    public boolean addRole(final AttributeRole role) {
         final FeatureTypeBuilder owner = owner();
         ensureNonNull("role", role);
         switch (role) {
@@ -453,6 +544,7 @@ public final class AttributeTypeBuilder<
                     isIdentifier = true;
                     owner.identifierCount++;
                     owner.clearCache();         // The change does not impact this attribute itself.
+                    return true;
                 }
                 break;
             }
@@ -467,10 +559,12 @@ public final class AttributeTypeBuilder<
                     }
                     owner.defaultGeometry = this;
                     owner.clearCache();         // The change does not impact this attribute itself.
+                    return true;
                 }
                 break;
             }
         }
+        return false;
     }
 
     /**
@@ -482,24 +576,6 @@ public final class AttributeTypeBuilder<
     }
 
     /**
-     * Returns a view of all characteristics added to the {@code AttributeType} to build.
-     * The returned list is <cite>live</cite>: changes in this builder are reflected in that list and conversely.
-     * However the returned list allows only {@linkplain List#remove(Object) remove} operations;
-     * new characteristics can be added only by calls to one of the {@code set/addCharacteristic(…)} methods.
-     *
-     * @return a live list over the characteristics declared to this builder.
-     *
-     * @see #getCharacteristic(String)
-     * @see #addCharacteristic(Class)
-     * @see #addCharacteristic(AttributeType)
-     * @see #setValidValues(Object...)
-     * @see #setCRS(CoordinateReferenceSystem)
-     */
-    public List<CharacteristicTypeBuilder<?>> characteristics() {
-        return new RemoveOnlyList<>(characteristics);
-    }
-
-    /**
      * {@inheritDoc}
      */
     @Override

Modified: sis/branches/JDK8/core/sis-feature/src/test/java/org/apache/sis/feature/builder/AttributeTypeBuilderTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-feature/src/test/java/org/apache/sis/feature/builder/AttributeTypeBuilderTest.java?rev=1754982&r1=1754981&r2=1754982&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-feature/src/test/java/org/apache/sis/feature/builder/AttributeTypeBuilderTest.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-feature/src/test/java/org/apache/sis/feature/builder/AttributeTypeBuilderTest.java [UTF-8] Tue Aug  2 17:12:56 2016
@@ -16,7 +16,10 @@
  */
 package org.apache.sis.feature.builder;
 
+import java.util.Arrays;
+import java.util.Set;
 import java.util.Collections;
+import com.esri.core.geometry.Geometry;
 import org.apache.sis.referencing.CommonCRS;
 import org.apache.sis.internal.feature.AttributeConvention;
 import org.apache.sis.test.DependsOnMethod;
@@ -210,4 +213,31 @@ public final strictfp class AttributeTyp
             assertTrue(message, message.contains("b:temp"));
         }
     }
+
+    /**
+     * Tests {@link AttributeTypeBuilder#roles()}.
+     */
+    @Test
+    @DependsOnMethod("testOtherCharacteristics")
+    public void testRoles() {
+        final AttributeTypeBuilder<Geometry> builder = new FeatureTypeBuilder().addAttribute(Geometry.class);
+        final Set<AttributeRole> roles = builder.roles();
+        assertTrue("isEmpty", roles.isEmpty());
+
+        assertTrue("add(DEFAULT_GEOMETRY)", builder.addRole(AttributeRole.DEFAULT_GEOMETRY));
+        assertSetEquals(Collections.singleton(AttributeRole.DEFAULT_GEOMETRY), roles);
+        assertFalse("add(DEFAULT_GEOMETRY)", builder.addRole(AttributeRole.DEFAULT_GEOMETRY));
+
+        assertTrue("add(IDENTIFIER_COMPONENT)", roles.add(AttributeRole.IDENTIFIER_COMPONENT));
+        assertSetEquals(Arrays.asList(AttributeRole.DEFAULT_GEOMETRY, AttributeRole.IDENTIFIER_COMPONENT), roles);
+        assertFalse("add(IDENTIFIER_COMPONENT)", roles.add(AttributeRole.IDENTIFIER_COMPONENT));
+
+        assertTrue("remove(DEFAULT_GEOMETRY)", roles.remove(AttributeRole.DEFAULT_GEOMETRY));
+        assertSetEquals(Collections.singleton(AttributeRole.IDENTIFIER_COMPONENT), roles);
+        assertFalse("remove(DEFAULT_GEOMETRY)", roles.remove(AttributeRole.DEFAULT_GEOMETRY));
+
+        assertTrue("remove(IDENTIFIER_COMPONENT)", roles.remove(AttributeRole.IDENTIFIER_COMPONENT));
+        assertTrue("isEmpty", roles.isEmpty());
+        assertFalse("remove(IDENTIFIER_COMPONENT)", roles.remove(AttributeRole.IDENTIFIER_COMPONENT));
+    }
 }

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/MultiAuthoritiesFactory.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/MultiAuthoritiesFactory.java?rev=1754982&r1=1754981&r2=1754982&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/MultiAuthoritiesFactory.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/MultiAuthoritiesFactory.java [UTF-8] Tue Aug  2 17:12:56 2016
@@ -199,10 +199,10 @@ public class MultiAuthoritiesFactory ext
      * but does not cache the objects created by those factories.
      * This constructor assumes that the given factories already do their own caching.
      *
-     * @param crsFactories   The factories for creating {@link CoordinateReferenceSystem} objects, or null if none.
-     * @param csFactories    The factories for creating {@link CoordinateSystem} objects, or null if none.
-     * @param datumFactories The factories for creating {@link Datum} objects, or null if none.
-     * @param copFactories   The factories for creating {@link CoordinateOperation} objects, or null if none.
+     * @param crsFactories    the factories for creating {@link CoordinateReferenceSystem} objects, or null if none.
+     * @param csFactories     the factories for creating {@link CoordinateSystem} objects, or null if none.
+     * @param datumFactories  the factories for creating {@link Datum} objects, or null if none.
+     * @param copFactories    the factories for creating {@link CoordinateOperation} objects, or null if none.
      */
     @SuppressWarnings({"unchecked", "rawtypes", "empty-statement"})    // Generic array creation.
     public MultiAuthoritiesFactory(final Iterable<? extends CRSAuthorityFactory> crsFactories,
@@ -244,7 +244,7 @@ public class MultiAuthoritiesFactory ext
      * The default value is {@code false}, which means that an exception will be thrown
      * if there is no factory specifically for the requested version.
      *
-     * @return Whether this factory should relax some rules when processing a given authority code.
+     * @return whether this factory should relax some rules when processing a given authority code.
      */
     public boolean isLenient() {
         return isLenient;
@@ -253,7 +253,7 @@ public class MultiAuthoritiesFactory ext
     /**
      * Sets whether this factory should relax some rules when processing a given code.
      *
-     * @param lenient Whether this factory should relax some rules when processing a given authority code.
+     * @param lenient whether this factory should relax some rules when processing a given authority code.
      */
     public void setLenient(final boolean lenient) {
         isLenient = lenient;
@@ -289,8 +289,8 @@ public class MultiAuthoritiesFactory ext
      *       since it may be costly.</li>
      * </ul>
      *
-     * @param  type The spatial reference objects type.
-     * @return The set of authority codes for spatial reference objects of the given type.
+     * @param  type  the spatial reference objects type.
+     * @return the set of authority codes for spatial reference objects of the given type.
      * @throws FactoryException if access to an underlying factory failed.
      */
     @Override
@@ -465,7 +465,7 @@ public class MultiAuthoritiesFactory ext
      * the current implementation may be relatively costly since it implies instantiation of all factories.
      * </div>
      *
-     * @return The code spaces of all factories.
+     * @return the code spaces of all factories.
      */
     @Override
     @SuppressWarnings("ReturnOfCollectionOrArrayField")
@@ -509,9 +509,9 @@ public class MultiAuthoritiesFactory ext
      * Caches the given factory, but without replacing existing instance if any.
      * This method returns the factory that we should use, either the given instance of the cached one.
      *
-     * @param  identifier The type, authority and version of the factory to cache.
-     * @param  factory The factory to cache.
-     * @return The given {@code factory} if no previous instance was cached, or the existing instance otherwise.
+     * @param  identifier  the type, authority and version of the factory to cache.
+     * @param  factory     the factory to cache.
+     * @return the given {@code factory} if no previous instance was cached, or the existing instance otherwise.
      */
     private AuthorityFactory cache(final AuthorityFactoryIdentifier identifier, final AuthorityFactory factory) {
         final AuthorityFactory existing = factories.putIfAbsent(identifier.intern(), factory);
@@ -536,13 +536,13 @@ public class MultiAuthoritiesFactory ext
     /**
      * Returns the factory identified by the given type, authority and version.
      *
-     * @param  <T>        The compile-time value of {@code type}.
-     * @param  type       The type of the desired factory as one of the {@link CRSAuthorityFactory}, {@link CSAuthorityFactory},
+     * @param  <T>        the compile-time value of {@code type}.
+     * @param  type       the type of the desired factory as one of the {@link CRSAuthorityFactory}, {@link CSAuthorityFactory},
      *                    {@link DatumAuthorityFactory} or {@link CoordinateOperationFactory} interfaces.
-     * @param  authority  The namespace or authority identifier of the desired factory.
+     * @param  authority  the namespace or authority identifier of the desired factory.
      *                    Examples: {@code "EPSG"}, {@code "CRS"} or {@code "AUTO2"}.
-     * @param  version    The version of the desired factory, or {@code null} for the default version.
-     * @return The factory for the given type, authority and version.
+     * @param  version    the version of the desired factory, or {@code null} for the default version.
+     * @return the factory for the given type, authority and version.
      * @throws NoSuchAuthorityFactoryException if no suitable factory has been found.
      */
     /*
@@ -562,8 +562,8 @@ public class MultiAuthoritiesFactory ext
      * Returns the factory identified by the given type, authority and version. If no such factory is found in
      * the cache, then this method iterates over the factories created by the providers given at construction time.
      *
-     * @param  request The type, authority and version of the desired factory.
-     * @return The factory for the given type, authority and version.
+     * @param  request  the type, authority and version of the desired factory.
+     * @return the factory for the given type, authority and version.
      * @throws NoSuchAuthorityFactoryException if no suitable factory has been found.
      */
     private AuthorityFactory getAuthorityFactory(final AuthorityFactoryIdentifier request)
@@ -721,10 +721,10 @@ public class MultiAuthoritiesFactory ext
     /**
      * Creates an object from a code using the given proxy.
      *
-     * @param  <T>   The type of the object to be returned.
-     * @param  proxy The proxy to use for creating the object.
-     * @param  code  The code of the object to create.
-     * @return The object from one of the authority factory specified at construction time.
+     * @param  <T>    the type of the object to be returned.
+     * @param  proxy  the proxy to use for creating the object.
+     * @param  code   the code of the object to create.
+     * @return the object from one of the authority factory specified at construction time.
      * @throws FactoryException If an error occurred while creating the object.
      */
     final <T> T create(AuthorityFactoryProxy<? extends T> proxy, String code) throws FactoryException {
@@ -814,7 +814,7 @@ public class MultiAuthoritiesFactory ext
      *   <li>{@code http://www.opengis.net/gml/srs/}<var>authority</var>{@code .xml#}<var>code</var></li>
      * </ul>
      *
-     * @return A description of the object, or {@code null} if the object
+     * @return a description of the object, or {@code null} if the object
      *         corresponding to the specified {@code code} has no description.
      * @throws FactoryException if an error occurred while fetching the description.
      */
@@ -837,7 +837,7 @@ public class MultiAuthoritiesFactory ext
      * The two first formats are ambiguous when used with this {@code createObject(String)} method
      * because different kinds of objects can have the same code.
      *
-     * @return The object for the given code.
+     * @return the object for the given code.
      * @throws FactoryException if the object creation failed.
      */
     @Override
@@ -856,7 +856,7 @@ public class MultiAuthoritiesFactory ext
      *   <li>{@code http://www.opengis.net/gml/srs/}<var>authority</var>{@code .xml#}<var>code</var></li>
      * </ul>
      *
-     * @return The coordinate reference system for the given code.
+     * @return the coordinate reference system for the given code.
      * @throws FactoryException if the object creation failed.
      */
     @Override
@@ -875,7 +875,7 @@ public class MultiAuthoritiesFactory ext
      *   <li>{@code http://www.opengis.net/gml/srs/}<var>authority</var>{@code .xml#}<var>code</var></li>
      * </ul>
      *
-     * @return The coordinate reference system for the given code.
+     * @return the coordinate reference system for the given code.
      * @throws FactoryException if the object creation failed.
      */
     @Override
@@ -894,7 +894,7 @@ public class MultiAuthoritiesFactory ext
      *   <li>{@code http://www.opengis.net/gml/srs/}<var>authority</var>{@code .xml#}<var>code</var></li>
      * </ul>
      *
-     * @return The coordinate reference system for the given code.
+     * @return the coordinate reference system for the given code.
      * @throws FactoryException if the object creation failed.
      */
     @Override
@@ -913,7 +913,7 @@ public class MultiAuthoritiesFactory ext
      *   <li>{@code http://www.opengis.net/gml/srs/}<var>authority</var>{@code .xml#}<var>code</var></li>
      * </ul>
      *
-     * @return The coordinate reference system for the given code.
+     * @return the coordinate reference system for the given code.
      * @throws FactoryException if the object creation failed.
      */
     @Override
@@ -932,7 +932,7 @@ public class MultiAuthoritiesFactory ext
      *   <li>{@code http://www.opengis.net/gml/srs/}<var>authority</var>{@code .xml#}<var>code</var></li>
      * </ul>
      *
-     * @return The coordinate reference system for the given code.
+     * @return the coordinate reference system for the given code.
      * @throws FactoryException if the object creation failed.
      */
     @Override
@@ -951,7 +951,7 @@ public class MultiAuthoritiesFactory ext
      *   <li>{@code http://www.opengis.net/gml/srs/}<var>authority</var>{@code .xml#}<var>code</var></li>
      * </ul>
      *
-     * @return The coordinate reference system for the given code.
+     * @return the coordinate reference system for the given code.
      * @throws FactoryException if the object creation failed.
      */
     @Override
@@ -970,7 +970,7 @@ public class MultiAuthoritiesFactory ext
      *   <li>{@code http://www.opengis.net/gml/srs/}<var>authority</var>{@code .xml#}<var>code</var></li>
      * </ul>
      *
-     * @return The coordinate reference system for the given code.
+     * @return the coordinate reference system for the given code.
      * @throws FactoryException if the object creation failed.
      */
     @Override
@@ -989,7 +989,7 @@ public class MultiAuthoritiesFactory ext
      *   <li>{@code http://www.opengis.net/gml/srs/}<var>authority</var>{@code .xml#}<var>code</var></li>
      * </ul>
      *
-     * @return The coordinate reference system for the given code.
+     * @return the coordinate reference system for the given code.
      * @throws FactoryException if the object creation failed.
      */
     @Override
@@ -1008,7 +1008,7 @@ public class MultiAuthoritiesFactory ext
      *   <li>{@code http://www.opengis.net/gml/srs/}<var>authority</var>{@code .xml#}<var>code</var></li>
      * </ul>
      *
-     * @return The coordinate reference system for the given code.
+     * @return the coordinate reference system for the given code.
      * @throws FactoryException if the object creation failed.
      */
     @Override
@@ -1027,7 +1027,7 @@ public class MultiAuthoritiesFactory ext
      *   <li>{@code http://www.opengis.net/gml/srs/}<var>authority</var>{@code .xml#}<var>code</var></li>
      * </ul>
      *
-     * @return The coordinate reference system for the given code.
+     * @return the coordinate reference system for the given code.
      * @throws FactoryException if the object creation failed.
      */
     @Override
@@ -1045,7 +1045,7 @@ public class MultiAuthoritiesFactory ext
      *   <li><code>http://www.opengis.net/def/<b>datum</b>/</code><var>authority</var>{@code /}<var>version</var>{@code /}<var>code</var></li>
      * </ul>
      *
-     * @return The datum for the given code.
+     * @return the datum for the given code.
      * @throws FactoryException if the object creation failed.
      */
     @Override
@@ -1063,7 +1063,7 @@ public class MultiAuthoritiesFactory ext
      *   <li><code>http://www.opengis.net/def/<b>datum</b>/</code><var>authority</var>{@code /}<var>version</var>{@code /}<var>code</var></li>
      * </ul>
      *
-     * @return The datum for the given code.
+     * @return the datum for the given code.
      * @throws FactoryException if the object creation failed.
      */
     @Override
@@ -1081,7 +1081,7 @@ public class MultiAuthoritiesFactory ext
      *   <li><code>http://www.opengis.net/def/<b>datum</b>/</code><var>authority</var>{@code /}<var>version</var>{@code /}<var>code</var></li>
      * </ul>
      *
-     * @return The datum for the given code.
+     * @return the datum for the given code.
      * @throws FactoryException if the object creation failed.
      */
     @Override
@@ -1099,7 +1099,7 @@ public class MultiAuthoritiesFactory ext
      *   <li><code>http://www.opengis.net/def/<b>datum</b>/</code><var>authority</var>{@code /}<var>version</var>{@code /}<var>code</var></li>
      * </ul>
      *
-     * @return The datum for the given code.
+     * @return the datum for the given code.
      * @throws FactoryException if the object creation failed.
      */
     @Override
@@ -1117,7 +1117,7 @@ public class MultiAuthoritiesFactory ext
      *   <li><code>http://www.opengis.net/def/<b>datum</b>/</code><var>authority</var>{@code /}<var>version</var>{@code /}<var>code</var></li>
      * </ul>
      *
-     * @return The datum for the given code.
+     * @return the datum for the given code.
      * @throws FactoryException if the object creation failed.
      */
     @Override
@@ -1135,7 +1135,7 @@ public class MultiAuthoritiesFactory ext
      *   <li><code>http://www.opengis.net/def/<b>datum</b>/</code><var>authority</var>{@code /}<var>version</var>{@code /}<var>code</var></li>
      * </ul>
      *
-     * @return The datum for the given code.
+     * @return the datum for the given code.
      * @throws FactoryException if the object creation failed.
      */
     @Override
@@ -1153,7 +1153,7 @@ public class MultiAuthoritiesFactory ext
      *   <li><code>http://www.opengis.net/def/<b>ellipsoid</b>/</code><var>authority</var>{@code /}<var>version</var>{@code /}<var>code</var></li>
      * </ul>
      *
-     * @return The ellipsoid for the given code.
+     * @return the ellipsoid for the given code.
      * @throws FactoryException if the object creation failed.
      */
     @Override
@@ -1171,7 +1171,7 @@ public class MultiAuthoritiesFactory ext
      *   <li><code>http://www.opengis.net/def/<b>meridian</b>/</code><var>authority</var>{@code /}<var>version</var>{@code /}<var>code</var></li>
      * </ul>
      *
-     * @return The prime meridian for the given code.
+     * @return the prime meridian for the given code.
      * @throws FactoryException if the object creation failed.
      */
     @Override
@@ -1187,7 +1187,7 @@ public class MultiAuthoritiesFactory ext
      *   <li><var>authority</var>{@code :}<var>version</var>{@code :}<var>code</var></li>
      * </ul>
      *
-     * @return The extent for the given code.
+     * @return the extent for the given code.
      * @throws FactoryException if the object creation failed.
      */
     @Override
@@ -1205,7 +1205,7 @@ public class MultiAuthoritiesFactory ext
      *   <li><code>http://www.opengis.net/def/<b>cs</b>/</code><var>authority</var>{@code /}<var>version</var>{@code /}<var>code</var></li>
      * </ul>
      *
-     * @return The coordinate system for the given code.
+     * @return the coordinate system for the given code.
      * @throws FactoryException if the object creation failed.
      */
     @Override
@@ -1223,7 +1223,7 @@ public class MultiAuthoritiesFactory ext
      *   <li><code>http://www.opengis.net/def/<b>cs</b>/</code><var>authority</var>{@code /}<var>version</var>{@code /}<var>code</var></li>
      * </ul>
      *
-     * @return The coordinate system for the given code.
+     * @return the coordinate system for the given code.
      * @throws FactoryException if the object creation failed.
      */
     @Override
@@ -1241,7 +1241,7 @@ public class MultiAuthoritiesFactory ext
      *   <li><code>http://www.opengis.net/def/<b>cs</b>/</code><var>authority</var>{@code /}<var>version</var>{@code /}<var>code</var></li>
      * </ul>
      *
-     * @return The coordinate system for the given code.
+     * @return the coordinate system for the given code.
      * @throws FactoryException if the object creation failed.
      */
     @Override
@@ -1259,7 +1259,7 @@ public class MultiAuthoritiesFactory ext
      *   <li><code>http://www.opengis.net/def/<b>cs</b>/</code><var>authority</var>{@code /}<var>version</var>{@code /}<var>code</var></li>
      * </ul>
      *
-     * @return The coordinate system for the given code.
+     * @return the coordinate system for the given code.
      * @throws FactoryException if the object creation failed.
      */
     @Override
@@ -1277,7 +1277,7 @@ public class MultiAuthoritiesFactory ext
      *   <li><code>http://www.opengis.net/def/<b>cs</b>/</code><var>authority</var>{@code /}<var>version</var>{@code /}<var>code</var></li>
      * </ul>
      *
-     * @return The coordinate system for the given code.
+     * @return the coordinate system for the given code.
      * @throws FactoryException if the object creation failed.
      */
     @Override
@@ -1295,7 +1295,7 @@ public class MultiAuthoritiesFactory ext
      *   <li><code>http://www.opengis.net/def/<b>cs</b>/</code><var>authority</var>{@code /}<var>version</var>{@code /}<var>code</var></li>
      * </ul>
      *
-     * @return The coordinate system for the given code.
+     * @return the coordinate system for the given code.
      * @throws FactoryException if the object creation failed.
      */
     @Override
@@ -1314,7 +1314,7 @@ public class MultiAuthoritiesFactory ext
      *   <li><code>http://www.opengis.net/def/<b>cs</b>/</code><var>authority</var>{@code /}<var>version</var>{@code /}<var>code</var></li>
      * </ul>
      *
-     * @return The coordinate system for the given code.
+     * @return the coordinate system for the given code.
      * @throws FactoryException if the object creation failed.
      */
     @Override
@@ -1333,7 +1333,7 @@ public class MultiAuthoritiesFactory ext
      *   <li><code>http://www.opengis.net/def/<b>cs</b>/</code><var>authority</var>{@code /}<var>version</var>{@code /}<var>code</var></li>
      * </ul>
      *
-     * @return The coordinate system for the given code.
+     * @return the coordinate system for the given code.
      * @throws FactoryException if the object creation failed.
      */
     @Override
@@ -1351,7 +1351,7 @@ public class MultiAuthoritiesFactory ext
      *   <li><code>http://www.opengis.net/def/<b>axis</b>/</code><var>authority</var>{@code /}<var>version</var>{@code /}<var>code</var></li>
      * </ul>
      *
-     * @return The axis for the given code.
+     * @return the axis for the given code.
      * @throws FactoryException if the object creation failed.
      */
     @Override
@@ -1369,7 +1369,7 @@ public class MultiAuthoritiesFactory ext
      *   <li><code>http://www.opengis.net/def/<b>uom</b>/</code><var>authority</var>{@code /}<var>version</var>{@code /}<var>code</var></li>
      * </ul>
      *
-     * @return The unit of measurement for the given code.
+     * @return the unit of measurement for the given code.
      * @throws FactoryException if the object creation failed.
      */
     @Override
@@ -1387,7 +1387,7 @@ public class MultiAuthoritiesFactory ext
      *   <li><code>http://www.opengis.net/def/<b>parameter</b>/</code><var>authority</var>{@code /}<var>version</var>{@code /}<var>code</var></li>
      * </ul>
      *
-     * @return The parameter descriptor for the given code.
+     * @return the parameter descriptor for the given code.
      * @throws FactoryException if the object creation failed.
      */
     @Override
@@ -1405,7 +1405,7 @@ public class MultiAuthoritiesFactory ext
      *   <li><code>http://www.opengis.net/def/<b>method</b>/</code><var>authority</var>{@code /}<var>version</var>{@code /}<var>code</var></li>
      * </ul>
      *
-     * @return The operation method for the given code.
+     * @return the operation method for the given code.
      * @throws FactoryException if the object creation failed.
      */
     @Override
@@ -1423,7 +1423,7 @@ public class MultiAuthoritiesFactory ext
      *   <li><code>http://www.opengis.net/def/<b>coordinateOperation</b>/</code><var>authority</var>{@code /}<var>version</var>{@code /}<var>code</var></li>
      * </ul>
      *
-     * @return The operation for the given code.
+     * @return the operation for the given code.
      * @throws FactoryException if the object creation failed.
      */
     @Override
@@ -1486,7 +1486,7 @@ public class MultiAuthoritiesFactory ext
      * Creates a finder which can be used for looking up unidentified objects.
      * The default implementation delegates the lookups to the underlying factories.
      *
-     * @return A finder to use for looking up unidentified objects.
+     * @return a finder to use for looking up unidentified objects.
      * @throws FactoryException if the finder can not be created.
      */
     @Override

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/OperationMethodSet.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/OperationMethodSet.java?rev=1754982&r1=1754981&r2=1754982&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/OperationMethodSet.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/OperationMethodSet.java [UTF-8] Tue Aug  2 17:12:56 2016
@@ -73,8 +73,8 @@ final class OperationMethodSet extends S
      * Constructs a set wrapping the given iterable.
      * The caller musts holds the lock on {@code methods} when invoking this constructor.
      *
-     * @param type The type of coordinate operation for which to retain methods.
-     * @param methods The {@link DefaultMathTransformFactory#methods} used for fetching the initial methods.
+     * @param  type     the type of coordinate operation for which to retain methods.
+     * @param  methods  the {@link DefaultMathTransformFactory#methods} used for fetching the initial methods.
      */
     OperationMethodSet(final Class<? extends SingleOperation> type,
             final Iterable<? extends OperationMethod> methods)

Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/IdentifierMapAdapter.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/IdentifierMapAdapter.java?rev=1754982&r1=1754981&r2=1754982&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/IdentifierMapAdapter.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/IdentifierMapAdapter.java [UTF-8] Tue Aug  2 17:12:56 2016
@@ -108,7 +108,7 @@ public class IdentifierMapAdapter extend
     /**
      * Creates a new map which will be a view over the given identifiers.
      *
-     * @param identifiers The identifiers to wrap in a map view.
+     * @param  identifiers  the identifiers to wrap in a map view.
      */
     public IdentifierMapAdapter(final Collection<Identifier> identifiers) {
         this.identifiers = identifiers;
@@ -118,8 +118,8 @@ public class IdentifierMapAdapter extend
      * If the given authority is a special case, returns its {@link NonMarshalledAuthority} integer enum.
      * Otherwise returns -1. See javadoc for more information about special cases.
      *
-     * @param authority A {@link Citation} constant. The type is relaxed to {@code Object}
-     *        because the signature of some {@code Map} methods are that way.
+     * @param  authority  a {@link Citation} constant. The type is relaxed to {@code Object}
+     *         because the signature of some {@code Map} methods are that way.
      */
     static int specialCase(final Object authority) {
         if (authority == IdentifierSpace.HREF) return NonMarshalledAuthority.HREF;
@@ -148,7 +148,7 @@ public class IdentifierMapAdapter extend
     /**
      * Returns the string representation of the given value, or {@code null} if none.
      *
-     * @param value The value returned be one of the above {@code getFoo()} methods.
+     * @param  value  the value returned be one of the above {@code getFoo()} methods.
      */
     private static String toString(final Object value) {
         return (value != null) ? value.toString() : null;
@@ -204,7 +204,7 @@ public class IdentifierMapAdapter extend
     /**
      * Returns {@code true} if at least one identifier declares the given {@linkplain Identifier#getCode() code}.
      *
-     * @param  code The code to search, which should be an instance of {@link String}.
+     * @param  code  the code to search, which should be an instance of {@link String}.
      * @return {@code true} if at least one identifier uses the given code.
      */
     @Override
@@ -225,7 +225,7 @@ public class IdentifierMapAdapter extend
      * Returns {@code true} if at least one identifier declares the given
      * {@linkplain Identifier#getAuthority() authority}.
      *
-     * @param  authority The authority to search, which should be an instance of {@link Citation}.
+     * @param  authority  the authority to search, which should be an instance of {@link Citation}.
      * @return {@code true} if at least one identifier uses the given authority.
      */
     @Override
@@ -276,8 +276,8 @@ public class IdentifierMapAdapter extend
      * Returns the code of the first identifier associated with the given
      * {@linkplain Identifier#getAuthority() authority}, or {@code null} if no identifier was found.
      *
-     * @param  authority The authority to search, which should be an instance of {@link Citation}.
-     * @return The code of the identifier for the given authority, or {@code null} if none.
+     * @param  authority  the authority to search, which should be an instance of {@link Citation}.
+     * @return the code of the identifier for the given authority, or {@code null} if none.
      */
     @Override
     public final String get(final Object authority) {
@@ -297,8 +297,8 @@ public class IdentifierMapAdapter extend
     /**
      * Removes all identifiers associated with the given {@linkplain Identifier#getAuthority() authority}.
      *
-     * @param  authority The authority to search, which should be an instance of {@link Citation}.
-     * @return The code of the identifier for the given authority, or {@code null} if none.
+     * @param  authority  the authority to search, which should be an instance of {@link Citation}.
+     * @return the code of the identifier for the given authority, or {@code null} if none.
      * @throws UnsupportedOperationException if the collection of identifiers is unmodifiable.
      */
     @Override
@@ -322,9 +322,9 @@ public class IdentifierMapAdapter extend
      * If more than one identifier is found for the given authority, then all previous identifiers may be removed
      * in order to ensure that the new entry will be the first entry, so it can be find by the {@code get} method.
      *
-     * @param  authority The authority for which to set the code.
-     * @param  code The new code for the given authority, or {@code null} for removing the entry.
-     * @return The previous code for the given authority, or {@code null} if none.
+     * @param  authority  the authority for which to set the code.
+     * @param  code  the new code for the given authority, or {@code null} for removing the entry.
+     * @return the previous code for the given authority, or {@code null} if none.
      * @throws UnsupportedOperationException if the collection of identifiers is unmodifiable.
      */
     @Override
@@ -348,7 +348,7 @@ public class IdentifierMapAdapter extend
      * If the backing collection contains many entries for the same authority, then only the first
      * occurrence is included.</p>
      *
-     * @return A view over the collection of identifiers.
+     * @return a view over the collection of identifiers.
      */
     @Override
     public Set<Entry<Citation,String>> entrySet() {

Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/util/AbstractIterator.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/util/AbstractIterator.java?rev=1754982&r1=1754981&r2=1754982&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/util/AbstractIterator.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/util/AbstractIterator.java [UTF-8] Tue Aug  2 17:12:56 2016
@@ -26,7 +26,7 @@ import java.util.NoSuchElementException;
  * The {@link #hasNext()} method shall set the {@code #next} field to a non-null value if there is more elements to
  * return.
  *
- * @param <E> The type of elements to be returned by the iterator.
+ * @param <E> the type of elements to be returned by the iterator.
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.7
@@ -49,7 +49,7 @@ public abstract class AbstractIterator<E
     /**
      * Returns the next element in this iteration.
      *
-     * @return The next element.
+     * @return the next element.
      */
     @Override
     public E next() {

Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/util/AbstractMap.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/util/AbstractMap.java?rev=1754982&r1=1754981&r2=1754982&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/util/AbstractMap.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/util/AbstractMap.java [UTF-8] Tue Aug  2 17:12:56 2016
@@ -63,8 +63,8 @@ import java.util.Objects;
  *   <li>{@link #addValue(Object)} (non-standard, optional method)</li>
  * </ul>
  *
- * @param <K> The type of keys maintained by the map.
- * @param <V> The type of mapped values.
+ * @param <K> the type of keys maintained by the map.
+ * @param <V> the type of mapped values.
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.5
@@ -82,8 +82,8 @@ public abstract class AbstractMap<K,V> i
      *       instead than creating new {@code Map.Element} on each iterator.</li>
      * </ul>
      *
-     * @param <K> The type of keys maintained by the map.
-     * @param <V> The type of mapped values.
+     * @param <K> the type of keys maintained by the map.
+     * @param <V> the type of mapped values.
      *
      * @see AbstractMap#entryIterator()
      */
@@ -99,7 +99,7 @@ public abstract class AbstractMap<K,V> i
          * Returns the key at the current iterator position.
          * This method is invoked only after {@link #next()}.
          *
-         * @return The key at the current iterator position.
+         * @return the key at the current iterator position.
          */
         protected abstract K getKey();
 
@@ -107,7 +107,7 @@ public abstract class AbstractMap<K,V> i
          * Returns the value at the current iterator position.
          * This method is invoked only after {@link #next()}.
          *
-         * @return The value at the current iterator position.
+         * @return the value at the current iterator position.
          */
         protected abstract V getValue();
 
@@ -116,7 +116,7 @@ public abstract class AbstractMap<K,V> i
          * This method is invoked only after {@link #next()}.
          * The default implementation creates an immutable entry with {@link #getKey()} and {@link #getValue()}.
          *
-         * @return The entry at the current iterator position.
+         * @return the entry at the current iterator position.
          */
         protected Entry<K,V> getEntry() {
             return new java.util.AbstractMap.SimpleImmutableEntry<>(getKey(), getValue());
@@ -139,8 +139,8 @@ public abstract class AbstractMap<K,V> i
      * (which is consistent with the default implementation of {@link AbstractMap} methods).
      * Modifiable maps should override {@code remove()} themselves.</p>
      *
-     * @param <K> The type of keys maintained by the map.
-     * @param <V> The type of mapped values.
+     * @param <K> the type of keys maintained by the map.
+     * @param <V> the type of mapped values.
      *
      * @see AbstractMap#entryIterator()
      */
@@ -165,7 +165,7 @@ public abstract class AbstractMap<K,V> i
         /**
          * Creates a new adapter initialized to the entry iterator of the given map.
          *
-         * @param map The map from which to return entries.
+         * @param map the map from which to return entries.
          */
         public IteratorAdapter(final Map<K,V> map) {
             it = map.entrySet().iterator();
@@ -246,7 +246,7 @@ public abstract class AbstractMap<K,V> i
      * Returns {@code true} if this map contains a value for the given name.
      * The default implementation assumes that the map can not contain {@code null} values.
      *
-     * @param  key The key for which to test the presence of a value.
+     * @param  key  the key for which to test the presence of a value.
      * @return {@code true} if the map contains a non-null value for the given key.
      */
     @Override
@@ -258,7 +258,7 @@ public abstract class AbstractMap<K,V> i
      * Returns {@code true} if this map contains the given value.
      * The default implementation iterates over all values using the {@link #entryIterator()}.
      *
-     * @param  value The value for which to test the presence.
+     * @param  value  the value for which to test the presence.
      * @return {@code true} if the map contains the given value.
      */
     @Override
@@ -276,9 +276,9 @@ public abstract class AbstractMap<K,V> i
      * Returns the value for the given key, or {@code defaultValue} if none.
      * The default implementation assumes that the map can not contain {@code null} values.
      *
-     * @param  key The key for which to get the value.
-     * @param  defaultValue The value to return if this map does not have an entry for the given key.
-     * @return The value for the given key, or {@code defaultValue} if none.
+     * @param  key  the key for which to get the value.
+     * @param  defaultValue  the value to return if this map does not have an entry for the given key.
+     * @return the value for the given key, or {@code defaultValue} if none.
      */
     @Override
     public V getOrDefault(final Object key, final V defaultValue) {
@@ -309,8 +309,8 @@ public abstract class AbstractMap<K,V> i
      * Removes the entry for the given key in this map.
      * The default operation throws {@link UnsupportedOperationException}.
      *
-     * @param  key The key of the entry to remove.
-     * @return The previous value, or {@code null} if none.
+     * @param  key  the key of the entry to remove.
+     * @return the previous value, or {@code null} if none.
      */
     @Override
     public V remove(Object key) throws UnsupportedOperationException {
@@ -321,9 +321,9 @@ public abstract class AbstractMap<K,V> i
      * Adds an entry for the given key in this map.
      * The default operation throws {@link UnsupportedOperationException}.
      *
-     * @param  key The key of the entry to remove.
-     * @param  value The value to associate to the given key.
-     * @return The previous value, or {@code null} if none.
+     * @param  key    the key of the entry to remove.
+     * @param  value  the value to associate to the given key.
+     * @return the previous value, or {@code null} if none.
      */
     @Override
     public V put(K key, V value) throws UnsupportedOperationException {
@@ -333,7 +333,7 @@ public abstract class AbstractMap<K,V> i
     /**
      * Puts all entries of the given map in this map.
      *
-     * @param map The other map from which to copy the entries.
+     * @param map  the other map from which to copy the entries.
      */
     @Override
     public void putAll(final Map<? extends K, ? extends V> map) throws UnsupportedOperationException {
@@ -346,7 +346,7 @@ public abstract class AbstractMap<K,V> i
      * Adds the given key in this map. Implementation of this method shall generate a corresponding value.
      * The default operation throws {@link UnsupportedOperationException}.
      *
-     * @param  key The key to add.
+     * @param  key  the key to add.
      * @return {@code true} if this map changed as a result of this operation.
      */
     protected boolean addKey(final K key) throws UnsupportedOperationException {
@@ -357,7 +357,7 @@ public abstract class AbstractMap<K,V> i
      * Adds the given value in this map. Implementation of this method shall generate a corresponding key.
      * The default operation throws {@link UnsupportedOperationException}.
      *
-     * @param  value The value to add.
+     * @param  value  the value to add.
      * @return {@code true} if this map changed as a result of this operation.
      */
     protected boolean addValue(final V value) throws UnsupportedOperationException {
@@ -372,7 +372,7 @@ public abstract class AbstractMap<K,V> i
      * and usually not retained for a long time (we often want only its iterator). Caching the set would require
      * a {@code volatile} field for thread safety, which also has cost.</p>
      *
-     * @return A view of the keys in this map.
+     * @return a view of the keys in this map.
      */
     @Override
     public Set<K> keySet() {
@@ -420,7 +420,7 @@ public abstract class AbstractMap<K,V> i
      * <p>The default implementation does not cache the collection on the assumption that it is very quick to create
      * and usually not retained for a long time.</p>
      *
-     * @return A view of the values in this map.
+     * @return a view of the values in this map.
      */
     @Override
     public Collection<V> values() {
@@ -443,7 +443,7 @@ public abstract class AbstractMap<K,V> i
      * <p>The default implementation does not cache the set on the assumption that it is very quick to create
      * and usually not retained for a long time.</p>
      *
-     * @return A view of the entries in this map.
+     * @return a view of the entries in this map.
      */
     @Override
     public Set<Entry<K,V>> entrySet() {
@@ -499,7 +499,7 @@ public abstract class AbstractMap<K,V> i
      * Returns an iterator over the entries in this map.
      * It is okay (but not required) to return {@code null} if the map is empty.
      *
-     * @return An iterator over the entries in this map, or {@code null}.
+     * @return an iterator over the entries in this map, or {@code null}.
      */
     protected abstract EntryIterator<K,V> entryIterator();
 
@@ -594,7 +594,7 @@ public abstract class AbstractMap<K,V> i
     /**
      * Compares this map with the given object for equality.
      *
-     * @param  object The other object to compare with this map.
+     * @param  object  the other object to compare with this map.
      * @return {@code true} if both objects are equal.
      */
     @Override
@@ -628,7 +628,7 @@ public abstract class AbstractMap<K,V> i
     /**
      * Computes a hash code value for this map.
      *
-     * @return A hash code value.
+     * @return a hash code value.
      */
     @Override
     public int hashCode() {
@@ -645,7 +645,7 @@ public abstract class AbstractMap<K,V> i
      * {@code java.util.AbstractMap} one, as it uses a tabular format rather than formatting all entries
      * on a single line.
      *
-     * @return A string representation of this map.
+     * @return a string representation of this map.
      */
     @Override
     public String toString() {

Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/util/LazySet.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/util/LazySet.java?rev=1754982&r1=1754981&r2=1754982&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/util/LazySet.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/util/LazySet.java [UTF-8] Tue Aug  2 17:12:56 2016
@@ -43,7 +43,7 @@ import java.util.Objects;
  *
  * <p>This class is not thread-safe. Synchronization, if desired, shall be done by the caller.</p>
  *
- * @param <E> The type of elements in the set.
+ * @param <E> the type of elements in the set.
  *
  * @author  Martin Desruisseaux (IRD, Geomatys)
  * @since   0.6
@@ -86,7 +86,7 @@ public class LazySet<E> extends SetOfUnk
      * only when first needed, and at most one iteration will be performed (unless {@link #reload()}
      * is invoked).
      *
-     * @param service  the type of service to request with {@link ServiceLoader}, or {@code null} if unknown.
+     * @param  service  the type of service to request with {@link ServiceLoader}, or {@code null} if unknown.
      */
     public LazySet(final Class<E> service) {
         Objects.requireNonNull(service);
@@ -97,7 +97,7 @@ public class LazySet<E> extends SetOfUnk
      * Constructs a set to be filled using the specified iterator.
      * Iteration with the given iterator will occur only when needed.
      *
-     * @param iterator The iterator to use for filling this set.
+     * @param  iterator  the iterator to use for filling this set.
      */
     public LazySet(final Iterator<? extends E> iterator) {
         Objects.requireNonNull(iterator);
@@ -123,7 +123,7 @@ public class LazySet<E> extends SetOfUnk
      * {@code LazySet} will not write in that array ({@code LazySet} will create a new array if
      * it needs to add more values).
      *
-     * @return Values to prepend before the source {@code Iterable}, or {@code null} if none.
+     * @return values to prepend before the source {@code Iterable}, or {@code null} if none.
      *
      * @since 0.7
      */
@@ -184,7 +184,7 @@ public class LazySet<E> extends SetOfUnk
      * Returns the number of elements in this set. Invoking this method
      * forces the set to immediately iterates through all remaining elements.
      *
-     * @return Number of elements in the iterator.
+     * @return number of elements in the iterator.
      */
     @Override
     public final int size() {
@@ -201,7 +201,7 @@ public class LazySet<E> extends SetOfUnk
      * Caches a new element. Subclasses can override this method is they want to substitute the given value
      * by another value.
      *
-     * @param element The element to add to the cache.
+     * @param  element  The element to add to the cache.
      */
     protected void cache(final E element) {
         if (numCached >= cachedElements.length) {
@@ -214,7 +214,7 @@ public class LazySet<E> extends SetOfUnk
      * Returns an unmodifiable view over the elements cached so far.
      * The returned list does not contain any elements that were not yet fetched from the source.
      *
-     * @return  the elements cached so far.
+     * @return the elements cached so far.
      */
     protected final List<E> cached() {
         return UnmodifiableArrayList.wrap(cachedElements, 0, numCached);
@@ -235,8 +235,8 @@ public class LazySet<E> extends SetOfUnk
     /**
      * Returns the element at the specified position in this set.
      *
-     * @param index The index at which to get an element.
-     * @return The element at the requested index.
+     * @param  index  the index at which to get an element.
+     * @return the element at the requested index.
      */
     final E get(final int index) {
         if (index >= numCached) {
@@ -253,7 +253,7 @@ public class LazySet<E> extends SetOfUnk
      * Returns an iterator over the elements contained in this set.
      * This is not the same iterator than the one given to the constructor.
      *
-     * @return An iterator over the elements in this set.
+     * @return an iterator over the elements in this set.
      */
     @Override
     public final Iterator<E> iterator() {

Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/util/SetOfUnknownSize.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/util/SetOfUnknownSize.java?rev=1754982&r1=1754981&r2=1754982&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/util/SetOfUnknownSize.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/util/SetOfUnknownSize.java [UTF-8] Tue Aug  2 17:12:56 2016
@@ -28,11 +28,11 @@ import org.apache.sis.util.ArraysExt;
  * An alternative to {@code AbstractSet} for implementations having a costly {@link #size()} method.
  * This class overrides some methods in a way that avoid or reduce calls to {@link #size()}.
  *
- * @param <E> The type of elements in the set.
+ * @param <E> the type of elements in the set.
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.7
- * @version 0.7
+ * @version 0.8
  * @module
  */
 public abstract class SetOfUnknownSize<E> extends AbstractSet<E> {
@@ -64,10 +64,29 @@ public abstract class SetOfUnknownSize<E
     }
 
     /**
+     * Returns the number of elements in this set. The default implementation counts the number of elements
+     * returned by the {@link #iterator() iterator}. Subclasses are encouraged to cache this value if they
+     * know that the underlying storage is immutable.
+     *
+     * @return the number of elements in this set.
+     */
+    @Override
+    public int size() {
+        int count = 0;
+        for (final Iterator<E> it=iterator(); it.hasNext();) {
+            it.next();
+            if (++count == Integer.MAX_VALUE) {
+                break;
+            }
+        }
+        return count;
+    }
+
+    /**
      * Removes elements of the given collection from this set.
      * This method avoids to invoke {@link #size()}.
      *
-     * @param c The collection containing elements to remove.
+     * @param  c  the collection containing elements to remove.
      * @return {@code true} if at least one element has been removed.
      */
     @Override
@@ -89,7 +108,7 @@ public abstract class SetOfUnknownSize<E
     /**
      * Returns the elements in an array.
      *
-     * @return An array containing all set elements.
+     * @return an array containing all set elements.
      */
     @Override
     public Object[] toArray() {
@@ -100,9 +119,9 @@ public abstract class SetOfUnknownSize<E
      * Returns the elements in the given array, or in a new array of the same type
      * if it was necessary to allocate more space.
      *
-     * @param <T> The type array elements.
-     * @param  array Where to store the elements.
-     * @return An array containing all set elements.
+     * @param  <T>    the type array elements.
+     * @param  array  where to store the elements.
+     * @return an array containing all set elements.
      */
     @Override
     @SuppressWarnings("SuspiciousToArrayCall")
@@ -124,7 +143,7 @@ public abstract class SetOfUnknownSize<E
                 array = Arrays.copyOf(array, Math.max(16, array.length) << 1);
                 trimToSize = true;
             }
-            array[i++] = (T) it.next();   // Will throw an ArrayStoreException if the type is incorrect.
+            array[i++] = (T) it.next();     // Will throw an ArrayStoreException if the type is incorrect.
         }
         if (trimToSize) {
             array = ArraysExt.resize(array, i);
@@ -139,7 +158,7 @@ public abstract class SetOfUnknownSize<E
      * This method avoids to invoke {@link #size()} on this instance (but it still call that method
      * on the other instance).
      *
-     * @param object The object to compare with this set.
+     * @param  object  the object to compare with this set.
      * @return {@code true} if the two set have the same content.
      */
     @Override

Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/collection/DerivedSet.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/collection/DerivedSet.java?rev=1754982&r1=1754981&r2=1754982&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/collection/DerivedSet.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/collection/DerivedSet.java [UTF-8] Tue Aug  2 17:12:56 2016
@@ -53,12 +53,12 @@ import org.apache.sis.internal.util.SetO
  * If the storage set is known to be immutable, then sub-classes may consider to cache some values,
  * especially the result of the {@link #size()} method.
  *
- * @param <S> The type of elements in the storage set.
- * @param <E> The type of elements in this set.
+ * @param <S> the type of elements in the storage set.
+ * @param <E> the type of elements in this set.
  *
  * @author  Martin Desruisseaux (IRD, Geomatys)
  * @since   0.3
- * @version 0.3
+ * @version 0.8
  * @module
  */
 class DerivedSet<S,E> extends SetOfUnknownSize<E> implements CheckedContainer<E>, Serializable {
@@ -97,8 +97,8 @@ class DerivedSet<S,E> extends SetOfUnkno
     /**
      * Creates a new derived set from the specified storage set.
      *
-     * @param storage   The set which actually store the elements.
-     * @param converter The type of elements in this derived set.
+     * @param  storage    the set which actually store the elements.
+     * @param  converter  the type of elements in this derived set.
      */
     private DerivedSet(final Set<S> storage, final ObjectConverter<S,E> converter) {
         this.storage   = storage;
@@ -125,24 +125,6 @@ class DerivedSet<S,E> extends SetOfUnkno
     }
 
     /**
-     * Returns the number of elements in this set. The default implementation counts
-     * the number of elements returned by the {@link #iterator() iterator}.
-     * Subclasses are encouraged to cache this value if they know that the
-     * {@linkplain #storage} set is immutable.
-     *
-     * @return the number of elements in this set.
-     */
-    @Override
-    public int size() {
-        int count = 0;
-        for (final Iterator<E> it=iterator(); it.hasNext();) {
-            it.next();
-            count++;
-        }
-        return count;
-    }
-
-    /**
      * Returns {@code true} if this set contains no elements.
      *
      * @return {@code true} if this set contains no elements.
@@ -189,8 +171,8 @@ class DerivedSet<S,E> extends SetOfUnkno
      * allows us to delegate the {@link #contains(Object)} and {@linkplain #remove(Object)}
      * operations to the {@linkplain #storage} set instead than iterating over all elements.
      *
-     * @param <S> The type of elements in the storage set.
-     * @param <E> The type of elements in this set.
+     * @param <S> the type of elements in the storage set.
+     * @param <E> the type of elements in this set.
      */
     private static class Invertible<S,E> extends DerivedSet<S,E> {
         /**
@@ -266,8 +248,8 @@ class DerivedSet<S,E> extends SetOfUnkno
      * The bijection allows us to query the {@linkplain #storage} set size directly
      * instead than iterating over all elements.
      *
-     * @param <S> The type of elements in the storage set.
-     * @param <E> The type of elements in this set.
+     * @param <S> the type of elements in the storage set.
+     * @param <E> the type of elements in this set.
      */
     private static final class Bijective<S,E> extends Invertible<S,E> {
         /**



Mime
View raw message