sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1778899 [2/4] - in /sis/branches/JDK7: ./ application/sis-console/src/main/java/org/apache/sis/console/ core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/ core/sis-metadata/src/main/java/org/apache/sis/metadata/ core/sis-met...
Date Sun, 15 Jan 2017 10:08:14 GMT
Modified: sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/TreeNodeChildren.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/TreeNodeChildren.java?rev=1778899&r1=1778898&r2=1778899&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/TreeNodeChildren.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/TreeNodeChildren.java [UTF-8] Sun Jan 15 10:08:13 2017
@@ -47,7 +47,7 @@ import org.apache.sis.util.Debug;
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.3
- * @version 0.3
+ * @version 0.8
  * @module
  */
 final class TreeNodeChildren extends AbstractCollection<TreeTable.Node> {
@@ -106,9 +106,9 @@ final class TreeNodeChildren extends Abs
     /**
      * Creates a collection of children for the specified metadata.
      *
-     * @param parent   The parent for which this node is an element.
-     * @param metadata The metadata object for which property values will be the elements of this collection.
-     * @param accessor The accessor to use for accessing the property names, types and values of the metadata object.
+     * @param  parent    the parent for which this node is an element.
+     * @param  metadata  the metadata object for which property values will be the elements of this collection.
+     * @param  accessor  the accessor to use for accessing the property names, types and values of the metadata object.
      */
     TreeNodeChildren(final TreeNode parent, final Object metadata, final PropertyAccessor accessor) {
         this.parent   = parent;
@@ -132,7 +132,7 @@ final class TreeNodeChildren extends Abs
      * Passing null avoid the type check and is safe at least with SIS implementation. We may revisit
      * later if this appears to be a problem with other implementations.
      *
-     * @param index The index in the accessor (<em>not</em> the index in this collection).
+     * @param  index  the index in the accessor (<em>not</em> the index in this collection).
      */
     final void clearAt(final int index) {
         accessor.set(index, metadata, null, PropertyAccessor.RETURN_NULL);
@@ -142,8 +142,8 @@ final class TreeNodeChildren extends Abs
      * Returns the value at the given index. The given {@code index} is relative to
      * the {@link #accessor} indexing, <strong>not</strong> to this collection.
      *
-     * @param  index The index in the accessor (<em>not</em> the index in this collection).
-     * @return The value at the given index. May be {@code null} or a collection.
+     * @param  index  the index in the accessor (<em>not</em> the index in this collection).
+     * @return the value at the given index. May be {@code null} or a collection.
      */
     final Object valueAt(final int index) {
         return accessor.get(index, metadata);
@@ -158,7 +158,7 @@ final class TreeNodeChildren extends Abs
      * We do not test {@code (value instanceof Collection)} because the value could be any user's implementation.
      * Nothing prevent users from implementing the collection interface even for singleton elements if they wish.</div>
      *
-     * @param  index The index in the accessor (<em>not</em> the index in this collection).
+     * @param  index  the index in the accessor (<em>not</em> the index in this collection).
      * @return {@code true} if the value at the given index is a collection.
      */
     final boolean isCollection(final int index) {
@@ -169,7 +169,7 @@ final class TreeNodeChildren extends Abs
      * Returns {@code true} if the give value shall be skipped by the iterators,
      * according the value policy.
      *
-     * @param  value The value to test.
+     * @param  value  the value to test.
      * @return {@code true} if the given value shall be skipped by the iterators.
      */
     final boolean isSkipped(final Object value) {
@@ -183,10 +183,10 @@ final class TreeNodeChildren extends Abs
      * <p>This method does not check if the child at the given index should be skipped.
      * It is caller responsibility to do such verification before this method call.</p>
      *
-     * @param  index The index in the accessor (<em>not</em> the index in this collection).
-     * @param  subIndex If the property at {@link #index} is a collection, the index in that
+     * @param  index     the index in the accessor (<em>not</em> the index in this collection).
+     * @param  subIndex  if the property at {@link #index} is a collection, the index in that
      *         collection (<em>not</em> the index in <em>this</em> collection). Otherwise -1.
-     * @return The node to be returned by public API.
+     * @return the node to be returned by public API.
      */
     final TreeNode childAt(final int index, final int subIndex) {
         TreeNode node = children[index];
@@ -198,7 +198,6 @@ final class TreeNodeChildren extends Abs
              */
             if (node == null || ((TreeNode.CollectionElement) node).indexInList != subIndex) {
                 node = new TreeNode.CollectionElement(parent, metadata, accessor, index, subIndex);
-                node.init();
             }
         } else {
             /*
@@ -208,7 +207,6 @@ final class TreeNodeChildren extends Abs
              */
             if (node == null) {
                 node = new TreeNode.Element(parent, metadata, accessor, index);
-                node.init();
             }
         }
         children[index] = node;
@@ -378,7 +376,7 @@ final class TreeNodeChildren extends Abs
                 }
                 subIterator = null;
                 subIndex = -1;
-                nextInAccessor++; // See the comment before nextInAccessor++ in the next() method.
+                nextInAccessor++;       // See the comment before nextInAccessor++ in the next() method.
             }
             /*
              * Search for the next property, which may be either a singleton or the first element
@@ -399,17 +397,21 @@ final class TreeNodeChildren extends Abs
                             subIterator = ((Iterable<?>) nextValue).iterator();
                         } else {
                             subIterator = Collections.emptyIterator();
-                            // Null collections are illegal (it shall be empty collections instead),
-                            // but we try to keep the iterator robut to ill-formed metadata, because
-                            // we want AbstractMetadata.toString() to work so we can spot problems.
+                            /*
+                             * Null collections are illegal (it shall be empty collections instead),
+                             * but we try to keep the iterator robut to ill-formed metadata, because
+                             * we want AbstractMetadata.toString() to work so we can spot problems.
+                             */
                         }
                         subIndex = 0;
                         if (subIterator.hasNext()) {
                             nextValue = subIterator.next();
                         } else {
                             nextValue = null;
-                            // Do not set 'childIterator' to null, since the above 'nextValue'
-                            // is considered as part of the child iteration.
+                            /*
+                             * Do not set 'childIterator' to null, since the above 'nextValue'
+                             * is considered as part of the child iteration.
+                             */
                         }
                     }
                     isNextVerified = true;
@@ -481,7 +483,7 @@ final class TreeNodeChildren extends Abs
      * <p>This method does not iterate explicitly through the children list, because adding a metadata
      * object implicitly adds all its children.</p>
      *
-     * @param  node The node from which to get the values.
+     * @param  node  the node from which to get the values.
      * @return {@code true} if the metadata changed as a result of this method call.
      * @throws NullPointerException if the given node is null.
      * @throws IllegalArgumentException if this list does not have a property for the node identifier.
@@ -504,8 +506,8 @@ final class TreeNodeChildren extends Abs
      * Implementation of {@link #add(TreeTable.Node)}, also invoked by {@link TreeNode.NewChild}.
      * This method will attempt to convert the given {@code value} to the expected type.
      *
-     * @param  index The index in the accessor (<em>not</em> the index in this collection).
-     * @param  value The property value to add.
+     * @param  index  the index in the accessor (<em>not</em> the index in this collection).
+     * @param  value  the property value to add.
      * @return {@code true} if the metadata changed as a result of this method call.
      */
     final boolean add(final int index, final Object value) throws IllegalStateException {

Modified: sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/TreeTableView.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/TreeTableView.java?rev=1778899&r1=1778898&r2=1778899&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/TreeTableView.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/TreeTableView.java [UTF-8] Sun Jan 15 10:08:13 2017
@@ -46,14 +46,14 @@ import org.apache.sis.internal.system.Se
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.3
- * @version 0.5
+ * @version 0.8
  * @module
  */
 final class TreeTableView implements TreeTable, Serializable {
     /**
      * For cross-version compatibility.
      */
-    private static final long serialVersionUID = 6320615192545089879L;
+    private static final long serialVersionUID = 3911016927808764394L;
 
     /**
      * The columns to be returned by {@link #getColumns()}.
@@ -94,14 +94,17 @@ final class TreeTableView implements Tre
     /**
      * Creates a tree table for the specified metadata object.
      *
-     * @param standard    The metadata standard implemented by the given metadata.
-     * @param metadata    The metadata object to wrap.
-     * @param valuePolicy The behavior of this map toward null or empty values.
-     */
-    TreeTableView(final MetadataStandard standard, final Object metadata, final ValueExistencePolicy valuePolicy) {
+     * @param  standard     the metadata standard implemented by the given metadata.
+     * @param  metadata     the metadata object to wrap.
+     * @param  baseType     base type of {@code metadata} interfaces to take in account.
+     * @param  valuePolicy  the behavior of this map toward null or empty values.
+     */
+    TreeTableView(final MetadataStandard standard, final Object metadata,
+            final Class<?> baseType, final ValueExistencePolicy valuePolicy)
+    {
         this.standard    = standard;
         this.valuePolicy = valuePolicy;
-        this.root = new TreeNode(this, metadata);
+        this.root = new TreeNode(this, metadata, baseType);
     }
 
     /**
@@ -128,7 +131,7 @@ final class TreeTableView implements Tre
      * developers are encouraged to create and configure their own {@link TreeTableFormat}
      * instance.
      *
-     * @return A string representation of this tree table.
+     * @return a string representation of this tree table.
      */
     @Override
     public String toString() {
@@ -160,23 +163,25 @@ final class TreeTableView implements Tre
     /**
      * Invoked on serialization. Write the metadata object instead of the {@linkplain #root} node.
      *
-     * @param  out The output stream where to serialize this object.
-     * @throws IOException If an I/O error occurred while writing.
+     * @param  out  the output stream where to serialize this object.
+     * @throws IOException if an I/O error occurred while writing.
      */
     private void writeObject(final ObjectOutputStream out) throws IOException {
         out.defaultWriteObject();
+        out.writeObject(root.baseType);
         out.writeObject(root.metadata);
     }
 
     /**
      * Invoked on deserialization. Recreate the {@linkplain #root} node from the metadata object.
      *
-     * @param  in The input stream from which to deserialize an object.
-     * @throws IOException If an I/O error occurred while reading or if the stream contains invalid data.
-     * @throws ClassNotFoundException If the class serialized on the stream is not on the classpath.
+     * @param  in  the input stream from which to deserialize an object.
+     * @throws IOException if an I/O error occurred while reading or if the stream contains invalid data.
+     * @throws ClassNotFoundException if the class serialized on the stream is not on the classpath.
      */
     private void readObject(final ObjectInputStream in) throws IOException, ClassNotFoundException {
         in.defaultReadObject();
-        root = new TreeNode(this, in.readObject());
+        final Class<?> baseType = (Class<?>) in.readObject();
+        root = new TreeNode(this, in.readObject(), baseType);
     }
 }

Modified: sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/ValueExistencePolicy.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/ValueExistencePolicy.java?rev=1778899&r1=1778898&r2=1778899&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/ValueExistencePolicy.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/ValueExistencePolicy.java [UTF-8] Sun Jan 15 10:08:13 2017
@@ -42,7 +42,7 @@ import org.apache.sis.xml.NilReason;
  * @version 0.4
  * @module
  *
- * @see MetadataStandard#asValueMap(Object, KeyNamePolicy, ValueExistencePolicy)
+ * @see MetadataStandard#asValueMap(Object, Class, KeyNamePolicy, ValueExistencePolicy)
  */
 public enum ValueExistencePolicy {
     /**

Modified: sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/ValueMap.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/ValueMap.java?rev=1778899&r1=1778898&r2=1778899&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/ValueMap.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/ValueMap.java [UTF-8] Sun Jan 15 10:08:13 2017
@@ -35,7 +35,7 @@ import static org.apache.sis.metadata.Pr
  * @version 0.3
  * @module
  *
- * @see MetadataStandard#asValueMap(Object, KeyNamePolicy, ValueExistencePolicy)
+ * @see MetadataStandard#asValueMap(Object, Class, KeyNamePolicy, ValueExistencePolicy)
  */
 final class ValueMap extends PropertyMap<Object> {
     /**

Modified: sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/ImmutableIdentifier.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/ImmutableIdentifier.java?rev=1778899&r1=1778898&r2=1778899&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/ImmutableIdentifier.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/ImmutableIdentifier.java [UTF-8] Sun Jan 15 10:08:13 2017
@@ -185,7 +185,7 @@ public class ImmutableIdentifier extends
      * Creates a new identifier from the specified one. This is a copy constructor which
      * get the code, codespace, authority and version from the given identifier.
      *
-     * @param identifier The identifier to copy.
+     * @param identifier  the identifier to copy.
      */
     public ImmutableIdentifier(final Identifier identifier) {
         ensureNonNull("identifier", identifier);
@@ -200,13 +200,10 @@ public class ImmutableIdentifier extends
     /**
      * Creates a new identifier from the specified code and authority.
      *
-     * @param authority
-     *          The person or party responsible for maintenance of the namespace, or {@code null} if not available.
-     * @param codeSpace
-     *          Identifier or namespace in which the code is valid, or {@code null} if not available.
-     *          This is often an abbreviation of the authority name.
-     * @param code
-     *          Alphanumeric value identifying an instance in the namespace. The code can not be null.
+     * @param authority  the person or party responsible for maintenance of the namespace, or {@code null} if not available.
+     * @param codeSpace  identifier or namespace in which the code is valid, or {@code null} if not available.
+     *                   This is often an abbreviation of the authority name.
+     * @param code       alphanumeric value identifying an instance in the namespace. The code can not be null.
      */
     public ImmutableIdentifier(final Citation authority, final String codeSpace, final String code) {
         this(authority, codeSpace, code, null, null);
@@ -216,17 +213,12 @@ public class ImmutableIdentifier extends
      * Creates a new identifier from the specified code and authority,
      * with an optional version number and description.
      *
-     * @param authority
-     *          The person or party responsible for maintenance of the namespace, or {@code null} if not available.
-     * @param codeSpace
-     *          Identifier or namespace in which the code is valid, or {@code null} if not available.
-     *          This is often an abbreviation of the authority name.
-     * @param code
-     *          Alphanumeric value identifying an instance in the namespace. The code can not be null.
-     * @param version
-     *          The version identifier for the namespace as specified by the code authority, or {@code null} if none.
-     * @param description
-     *          Natural language description of the meaning of the code value, or {@code null} if none.
+     * @param authority    the person or party responsible for maintenance of the namespace, or {@code null} if not available.
+     * @param codeSpace    identifier or namespace in which the code is valid, or {@code null} if not available.
+     *                     This is often an abbreviation of the authority name.
+     * @param code         alphanumeric value identifying an instance in the namespace. The code can not be null.
+     * @param version      the version identifier for the namespace as specified by the code authority, or {@code null} if none.
+     * @param description  natural language description of the meaning of the code value, or {@code null} if none.
      */
     public ImmutableIdentifier(final Citation authority, final String codeSpace,
             final String code, final String version, final InternationalString description)
@@ -294,7 +286,7 @@ public class ImmutableIdentifier extends
      * After successful construction, {@code ImmutableIdentifier} instances do not keep the locale
      * since localizations are deferred to the {@link InternationalString#toString(Locale)} method.</p>
      *
-     * @param  properties The properties to be given to this identifier.
+     * @param  properties  the properties to be given to this identifier.
      * @throws IllegalArgumentException if a property has an illegal value.
      */
     public ImmutableIdentifier(final Map<String,?> properties) throws IllegalArgumentException {
@@ -365,8 +357,8 @@ public class ImmutableIdentifier extends
      *       metadata contained in the given object are not recursively copied.</li>
      * </ul>
      *
-     * @param  object The object to get as a SIS implementation, or {@code null} if none.
-     * @return A SIS implementation containing the values of the given object (may be the
+     * @param  object  the object to get as a SIS implementation, or {@code null} if none.
+     * @return a SIS implementation containing the values of the given object (may be the
      *         given object itself), or {@code null} if the argument was null.
      */
     public static ImmutableIdentifier castOrCopy(final Identifier object) {
@@ -381,7 +373,7 @@ public class ImmutableIdentifier extends
      * The organization's abbreviation is often the same than this identifier {@linkplain #getCodeSpace() code space},
      * but not necessarily.
      *
-     * @return The authority, or {@code null} if not available.
+     * @return the authority, or {@code null} if not available.
      */
     @Override
     public Citation getAuthority() {
@@ -393,7 +385,7 @@ public class ImmutableIdentifier extends
      *
      * <div class="note"><b>Example:</b> {@code "4326"}.</div>
      *
-     * @return Value identifying an instance in the namespace (never {@code null}).
+     * @return value identifying an instance in the namespace (never {@code null}).
      *
      * @see org.apache.sis.referencing.NamedIdentifier#tip()
      */
@@ -408,7 +400,7 @@ public class ImmutableIdentifier extends
      *
      * <div class="note"><b>Example:</b> {@code "EPSG"}.</div>
      *
-     * @return Identifier or namespace in which the code is valid, or {@code null} if not available.
+     * @return identifier or namespace in which the code is valid, or {@code null} if not available.
      *
      * @see org.apache.sis.referencing.NamedIdentifier#head()
      * @see org.apache.sis.referencing.NamedIdentifier#scope()
@@ -425,7 +417,7 @@ public class ImmutableIdentifier extends
      *
      * <div class="note"><b>Example:</b> the version of the underlying EPSG database.</div>
      *
-     * @return The version identifier for the namespace, or {@code null} if none.
+     * @return the version identifier for the namespace, or {@code null} if none.
      */
     @Override
     public String getVersion() {
@@ -437,7 +429,7 @@ public class ImmutableIdentifier extends
      *
      * <div class="note"><b>Example:</b> "World Geodetic System 1984".</div>
      *
-     * @return The natural language description, or {@code null} if none.
+     * @return the natural language description, or {@code null} if none.
      *
      * @since 0.5
      */
@@ -464,7 +456,7 @@ public class ImmutableIdentifier extends
     /**
      * Compares this object with the given one for equality.
      *
-     * @param object The object to compare with this identifier.
+     * @param  object  the object to compare with this identifier.
      * @return {@code true} if both objects are equal.
      */
     @Override
@@ -487,7 +479,7 @@ public class ImmutableIdentifier extends
      * Formats this identifier as a <cite>Well Known Text</cite> {@code Id[…]} element.
      * See class javadoc for more information on the WKT format.
      *
-     * @param  formatter The formatter where to format the inner content of this WKT element.
+     * @param  formatter  the formatter where to format the inner content of this WKT element.
      * @return {@code "Id"} (WKT 2) or {@code "Authority"} (WKT 1).
      *
      * @see <a href="http://docs.opengeospatial.org/is/12-063r5/12-063r5.html#33">WKT 2 specification §7.3.4</a>

Modified: sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/package-info.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/package-info.java?rev=1778899&r1=1778898&r2=1778899&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/package-info.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/package-info.java [UTF-8] Sun Jan 15 10:08:13 2017
@@ -120,7 +120,7 @@
  * @author  Martin Desruisseaux (IRD, Geomatys)
  * @author  Adrian Custer (Geomatys)
  * @since   0.3
- * @version 0.3
+ * @version 0.8
  * @module
  */
 package org.apache.sis.metadata;

Modified: sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/sql/MetadataSource.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/sql/MetadataSource.java?rev=1778899&r1=1778898&r2=1778899&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/sql/MetadataSource.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/sql/MetadataSource.java [UTF-8] Sun Jan 15 10:08:13 2017
@@ -541,7 +541,7 @@ public class MetadataSource implements A
      *         of the expected package.
      */
     private Map<String,Object> asMap(final Object metadata) throws ClassCastException {
-        return standard.asValueMap(metadata, KeyNamePolicy.UML_IDENTIFIER, ValueExistencePolicy.ALL);
+        return standard.asValueMap(metadata, null, KeyNamePolicy.UML_IDENTIFIER, ValueExistencePolicy.ALL);
     }
 
     /**

Modified: sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/AbstractMetadataTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/AbstractMetadataTest.java?rev=1778899&r1=1778898&r2=1778899&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/AbstractMetadataTest.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/AbstractMetadataTest.java [UTF-8] Sun Jan 15 10:08:13 2017
@@ -29,7 +29,7 @@ import static org.apache.sis.test.TestUt
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.3
- * @version 0.3
+ * @version 0.8
  * @module
  */
 @DependsOn(MetadataStandardTest.class)
@@ -44,7 +44,7 @@ public final strictfp class AbstractMeta
     @Test
     public void testHashCodeOnCyclicMetadata() {
         final int code = MetadataStandardTest.createCyclicMetadata().hashCode();
-        assertEquals(code, MetadataStandardTest.createCyclicMetadata().hashCode());
+        assertEquals("hashCode", code, MetadataStandardTest.createCyclicMetadata().hashCode());
     }
 
     /**
@@ -54,29 +54,41 @@ public final strictfp class AbstractMeta
      *
      * <p>The tree formatted by this test is:</p>
      * {@preformat text
-     *     Platform
-     *       ├─Description……………………… A platform.
-     *       └─Instrument
-     *           ├─Type……………………………… An instrument type.
-     *           └─Mounted on
-     *             (cycle omitted)
+     *     Acquisition information
+     *       └─Platform
+     *           ├─Description………………………………… A platform.
+     *           └─Instrument
+     *               ├─Type………………………………………… An instrument type.
+     *               └─Mounted on
+     *                   ├─Description…………… A platform.
+     *                   └─Instrument
+     *                         (omitted cycle)
      * }
+     *
+     * Note that the cycle detection apparently happens too late since "A platform" has been repeated.
+     * This is because that same Platform instance appears in two different metadata property.  We do
+     * not stop the formatting on the same metadata instance - we also require that it appears in the
+     * same property - for allowing the complete formatting of objects that implement more than one
+     * metadata interface.
      */
     @Test
     public void testToStringOnCyclicMetadata() {
         final String text = MetadataStandardTest.createCyclicMetadata().toString();
         /*
-         * We can not perform a full comparison of the string, since it is locale-dependent.
-         * Compare only the tree structure. The full tree is English is shown in javadoc.
+         * We can not perform a full comparison of the string since it is locale-dependent.
+         * Compare only the tree structure. The full tree in English is shown in javadoc.
          */
-        assertTrue(text, text.startsWith("Platform"));
-        assertArrayEquals(new String[] {
-            "",
-            "  ├─",
-            "  └─",
-            "      ├─",
-            "      └─",
-            "        (",
+        assertTrue(text, text.startsWith("Acquisition information"));
+        assertArrayEquals("toTreeStructure", new String[] {
+            "",                             // Acquisition information
+            "  └─",                         // Platform
+            "      ├─",                     // Description
+            "      └─",                     // Instrument
+            "          ├─",                 // Type
+            "          └─",                 // Mounted on
+            "              ├─",             // Description
+            "              └─",             // Instrument
+            "                    (",        // Omitted cycle
             ""}, toTreeStructure(text));
     }
 }

Modified: sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/MetadataStandardTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/MetadataStandardTest.java?rev=1778899&r1=1778898&r2=1778899&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/MetadataStandardTest.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/MetadataStandardTest.java [UTF-8] Sun Jan 15 10:08:13 2017
@@ -29,6 +29,7 @@ import org.apache.sis.metadata.iso.citat
 import org.apache.sis.metadata.iso.citation.HardCodedCitations;
 import org.apache.sis.metadata.iso.acquisition.DefaultPlatform;
 import org.apache.sis.metadata.iso.acquisition.DefaultInstrument;
+import org.apache.sis.metadata.iso.acquisition.DefaultAcquisitionInformation;
 import org.apache.sis.metadata.iso.quality.AbstractCompleteness;
 import org.apache.sis.internal.simple.SimpleIdentifiedObject;
 import org.apache.sis.util.iso.SimpleInternationalString;
@@ -58,7 +59,7 @@ import static org.apache.sis.test.TestUt
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.3
- * @version 0.3
+ * @version 0.8
  * @module
  */
 @DependsOn({
@@ -69,36 +70,55 @@ import static org.apache.sis.test.TestUt
     ValueMapTest.class})
 public final strictfp class MetadataStandardTest extends TestCase {
     /**
+     * The standard being tested.
+     */
+    private MetadataStandard standard;
+
+    /**
+     * Returns {@code true} if the given type is a metadata.
+     */
+    private boolean isMetadata(final Class<?> type) {
+        return standard.isMetadata(type);
+    }
+
+    /**
      * Tests {@link MetadataStandard#isMetadata(Class)}.
      */
     @Test
     public void testIsMetadata() {
-        MetadataStandard std = MetadataStandard.ISO_19115;
-        assertFalse("isMetadata(String)",                 std.isMetadata(String.class));
-        assertTrue ("isMetadata(Citation)",               std.isMetadata(Citation.class));
-        assertTrue ("isMetadata(DefaultCitation)",        std.isMetadata(DefaultCitation.class));
-        assertFalse("isMetadata(IdentifiedObject)",       std.isMetadata(IdentifiedObject.class));
-        assertFalse("isMetadata(SimpleIdentifiedObject)", std.isMetadata(SimpleIdentifiedObject.class));
-        assertFalse("isMetadata(GeographicCRS)",          std.isMetadata(GeographicCRS.class));
-        assertFalse("isMetadata(RectifiedGrid)",          std.isMetadata(RectifiedGrid.class));
-
-        std = MetadataStandard.ISO_19111;
-        assertFalse("isMetadata(String)",                 std.isMetadata(String.class));
-        assertTrue ("isMetadata(Citation)",               std.isMetadata(Citation.class));          // Dependency
-        assertTrue ("isMetadata(DefaultCitation)",        std.isMetadata(DefaultCitation.class));   // Dependency
-        assertTrue ("isMetadata(IdentifiedObject)",       std.isMetadata(IdentifiedObject.class));
-        assertTrue ("isMetadata(SimpleIdentifiedObject)", std.isMetadata(SimpleIdentifiedObject.class));
-        assertTrue ("isMetadata(GeographicCRS)",          std.isMetadata(GeographicCRS.class));
-        assertFalse("isMetadata(RectifiedGrid)",          std.isMetadata(RectifiedGrid.class));
-
-        std = MetadataStandard.ISO_19123;
-        assertFalse("isMetadata(String)",                 std.isMetadata(String.class));
-        assertTrue ("isMetadata(Citation)",               std.isMetadata(Citation.class));               // Transitive dependency
-        assertTrue ("isMetadata(DefaultCitation)",        std.isMetadata(DefaultCitation.class));        // Transivive dependency
-        assertTrue ("isMetadata(IdentifiedObject)",       std.isMetadata(IdentifiedObject.class));       // Dependency
-        assertTrue ("isMetadata(SimpleIdentifiedObject)", std.isMetadata(SimpleIdentifiedObject.class)); // Dependency
-        assertTrue ("isMetadata(GeographicCRS)",          std.isMetadata(GeographicCRS.class));          // Dependency
-        assertTrue ("isMetadata(RectifiedGrid)",          std.isMetadata(RectifiedGrid.class));
+        standard = MetadataStandard.ISO_19115;
+        assertFalse("isMetadata(String)",                 isMetadata(String.class));
+        assertTrue ("isMetadata(Citation)",               isMetadata(Citation.class));
+        assertTrue ("isMetadata(DefaultCitation)",        isMetadata(DefaultCitation.class));
+        assertFalse("isMetadata(IdentifiedObject)",       isMetadata(IdentifiedObject.class));
+        assertFalse("isMetadata(SimpleIdentifiedObject)", isMetadata(SimpleIdentifiedObject.class));
+        assertFalse("isMetadata(GeographicCRS)",          isMetadata(GeographicCRS.class));
+        assertFalse("isMetadata(RectifiedGrid)",          isMetadata(RectifiedGrid.class));
+
+        standard = MetadataStandard.ISO_19111;
+        assertFalse("isMetadata(String)",                 isMetadata(String.class));
+        assertTrue ("isMetadata(Citation)",               isMetadata(Citation.class));               // Dependency
+        assertTrue ("isMetadata(DefaultCitation)",        isMetadata(DefaultCitation.class));        // Dependency
+        assertTrue ("isMetadata(IdentifiedObject)",       isMetadata(IdentifiedObject.class));
+        assertTrue ("isMetadata(SimpleIdentifiedObject)", isMetadata(SimpleIdentifiedObject.class));
+        assertTrue ("isMetadata(GeographicCRS)",          isMetadata(GeographicCRS.class));
+        assertFalse("isMetadata(RectifiedGrid)",          isMetadata(RectifiedGrid.class));
+
+        standard = MetadataStandard.ISO_19123;
+        assertFalse("isMetadata(String)",                 isMetadata(String.class));
+        assertTrue ("isMetadata(Citation)",               isMetadata(Citation.class));               // Transitive dependency
+        assertTrue ("isMetadata(DefaultCitation)",        isMetadata(DefaultCitation.class));        // Transivive dependency
+        assertTrue ("isMetadata(IdentifiedObject)",       isMetadata(IdentifiedObject.class));       // Dependency
+        assertTrue ("isMetadata(SimpleIdentifiedObject)", isMetadata(SimpleIdentifiedObject.class)); // Dependency
+        assertTrue ("isMetadata(GeographicCRS)",          isMetadata(GeographicCRS.class));          // Dependency
+        assertTrue ("isMetadata(RectifiedGrid)",          isMetadata(RectifiedGrid.class));
+    }
+
+    /**
+     * Returns the interface for the given metadata implementation class.
+     */
+    private Class<?> getInterface(final Class<?> type) {
+        return standard.getInterface(type);
     }
 
     /**
@@ -107,38 +127,46 @@ public final strictfp class MetadataStan
     @Test
     @DependsOnMethod("testIsMetadata")
     public void testGetInterface() {
-        MetadataStandard std = MetadataStandard.ISO_19115;
-        assertEquals("getInterface(Citation)",             Citation.class,     std.getInterface(Citation.class));
-        assertEquals("getInterface(DefaultCitation)",      Citation.class,     std.getInterface(DefaultCitation.class));
-        assertEquals("getInterface(AbstractCompleteness)", Completeness.class, std.getInterface(AbstractCompleteness.class));
-
-        std = MetadataStandard.ISO_19111;
-        assertEquals("getInterface(Citation)",               Citation.class,         std.getInterface(Citation.class));
-        assertEquals("getInterface(DefaultCitation)",        Citation.class,         std.getInterface(DefaultCitation.class));
-        assertEquals("getInterface(AbstractCompleteness)",   Completeness.class,     std.getInterface(AbstractCompleteness.class));
-        assertEquals("getInterface(IdentifiedObject)",       IdentifiedObject.class, std.getInterface(IdentifiedObject.class));
-        assertEquals("getInterface(SimpleIdentifiedObject)", IdentifiedObject.class, std.getInterface(SimpleIdentifiedObject.class));
-        assertEquals("getInterface(GeographicCRS)",          GeographicCRS.class,    std.getInterface(GeographicCRS.class));
+        standard = MetadataStandard.ISO_19115;
+        assertEquals("getInterface(Citation)",               Citation.class,         getInterface(Citation.class));
+        assertEquals("getInterface(DefaultCitation)",        Citation.class,         getInterface(DefaultCitation.class));
+        assertEquals("getInterface(AbstractCompleteness)",   Completeness.class,     getInterface(AbstractCompleteness.class));
+
+        standard = MetadataStandard.ISO_19111;
+        assertEquals("getInterface(Citation)",               Citation.class,         getInterface(Citation.class));
+        assertEquals("getInterface(DefaultCitation)",        Citation.class,         getInterface(DefaultCitation.class));
+        assertEquals("getInterface(AbstractCompleteness)",   Completeness.class,     getInterface(AbstractCompleteness.class));
+        assertEquals("getInterface(IdentifiedObject)",       IdentifiedObject.class, getInterface(IdentifiedObject.class));
+        assertEquals("getInterface(SimpleIdentifiedObject)", IdentifiedObject.class, getInterface(SimpleIdentifiedObject.class));
+        assertEquals("getInterface(GeographicCRS)",          GeographicCRS.class,    getInterface(GeographicCRS.class));
 
         // Verify that the cache has not been updated in inconsistent way.
         testIsMetadata();
     }
 
     /**
+     * Returns the interface type declared by the accessor for the given class.
+     */
+    private Class<?> getAccessor(final Class<?> type, final boolean mandatory) {
+        final PropertyAccessor accessor = standard.getAccessor(new CacheKey(type), mandatory);
+        return (accessor != null) ? accessor.type : null;
+    }
+
+    /**
      * Tests {@link MetadataStandard#getAccessor(Class, boolean)}.
      */
     @Test
     @DependsOnMethod("testGetInterface")
     public void testGetAccessor() {
-        MetadataStandard std = MetadataStandard.ISO_19115;
-        assertEquals("getAccessor(DefaultCitation)",      Citation.class,     std.getAccessor(DefaultCitation.class, true).type);
-        assertEquals("getAccessor(AbstractCompleteness)", Completeness.class, std.getAccessor(AbstractCompleteness.class, true).type);
-        assertNull  ("getAccessor(SimpleIdentifiedObject)",                   std.getAccessor(SimpleIdentifiedObject.class, false));
-
-        std = MetadataStandard.ISO_19111;
-        assertEquals("getAccessor(DefaultCitation)",        Citation.class,         std.getAccessor(DefaultCitation.class, true).type);
-        assertEquals("getAccessor(AbstractCompleteness)",   Completeness.class,     std.getAccessor(AbstractCompleteness.class, true).type);
-        assertEquals("getAccessor(SimpleIdentifiedObject)", IdentifiedObject.class, std.getAccessor(SimpleIdentifiedObject.class, true).type);
+        standard = MetadataStandard.ISO_19115;
+        assertEquals("getAccessor(DefaultCitation)",        Citation.class,         getAccessor(DefaultCitation.class, true));
+        assertEquals("getAccessor(AbstractCompleteness)",   Completeness.class,     getAccessor(AbstractCompleteness.class, true));
+        assertNull  ("getAccessor(SimpleIdentifiedObject)",                         getAccessor(SimpleIdentifiedObject.class, false));
+
+        standard = MetadataStandard.ISO_19111;
+        assertEquals("getAccessor(DefaultCitation)",        Citation.class,         getAccessor(DefaultCitation.class, true));
+        assertEquals("getAccessor(AbstractCompleteness)",   Completeness.class,     getAccessor(AbstractCompleteness.class, true));
+        assertEquals("getAccessor(SimpleIdentifiedObject)", IdentifiedObject.class, getAccessor(SimpleIdentifiedObject.class, true));
 
         // Verify that the cache has not been updated in inconsistent way.
         testGetInterface();
@@ -151,9 +179,9 @@ public final strictfp class MetadataStan
     @Test
     @DependsOnMethod("testGetInterface")
     public void testGetWrongInterface() {
-        final MetadataStandard std = new MetadataStandard("SIS", "org.apache.sis.dummy.", null);
+        standard = new MetadataStandard("SIS", "org.apache.sis.dummy.", null);
         try {
-            std.getInterface(DefaultCitation.class);
+            getInterface(DefaultCitation.class);
             fail("No dummy interface expected.");
         } catch (ClassCastException e) {
             // This is the expected exception.
@@ -167,35 +195,37 @@ public final strictfp class MetadataStan
     @Test
     @DependsOnMethod("testGetAccessor")
     public void testEquals() {
-        final MetadataStandard std = MetadataStandard.ISO_19115;
+        standard = MetadataStandard.ISO_19115;
 
         // Self equality test
         DefaultCitation instance = HardCodedCitations.EPSG;
-        assertFalse(std.equals(instance, HardCodedCitations.SIS,  ComparisonMode.STRICT));
-        assertTrue (std.equals(instance, HardCodedCitations.EPSG, ComparisonMode.STRICT));
+        assertFalse(standard.equals(instance, HardCodedCitations.SIS,  ComparisonMode.STRICT));
+        assertTrue (standard.equals(instance, HardCodedCitations.EPSG, ComparisonMode.STRICT));
 
         // Test comparison with a copy
         instance = new DefaultCitation(HardCodedCitations.EPSG);
-        assertFalse(std.equals(instance, HardCodedCitations.SIS,  ComparisonMode.STRICT));
-        assertTrue (std.equals(instance, HardCodedCitations.EPSG, ComparisonMode.STRICT));
+        assertFalse(standard.equals(instance, HardCodedCitations.SIS,  ComparisonMode.STRICT));
+        assertTrue (standard.equals(instance, HardCodedCitations.EPSG, ComparisonMode.STRICT));
 
         // test comparison with a modified copy
         instance.setTitle(new SimpleInternationalString("A dummy title"));
-        assertFalse(std.equals(instance, HardCodedCitations.EPSG,    ComparisonMode.STRICT));
+        assertFalse(standard.equals(instance, HardCodedCitations.EPSG, ComparisonMode.STRICT));
     }
 
     /**
      * Creates a metadata object having a cyclic association. The cycle is between
      * {@code platform.instrument} and {@code instrument.isMountedOn}.
      */
-    static DefaultPlatform createCyclicMetadata() {
+    static DefaultAcquisitionInformation createCyclicMetadata() {
         final DefaultInstrument instrument = new DefaultInstrument();
         instrument.setType(new SimpleInternationalString("An instrument type."));
         final DefaultPlatform platform = new DefaultPlatform();
         platform.setDescription(new SimpleInternationalString("A platform."));
         instrument.setMountedOn(platform);
         platform.setInstruments(singleton(instrument));
-        return platform;
+        final DefaultAcquisitionInformation acquisition = new DefaultAcquisitionInformation();
+        acquisition.setPlatforms(singleton(platform));
+        return acquisition;
     }
 
     /**
@@ -206,12 +236,14 @@ public final strictfp class MetadataStan
     @Test
     @DependsOnMethod("testEquals")
     public void testEqualsOnCyclicMetadata() {
-        final DefaultPlatform p1 = createCyclicMetadata();
-        final DefaultPlatform p2 = createCyclicMetadata();
-        assertTrue(p1.equals(p2));
-        ((DefaultInstrument) getSingleton(p2.getInstruments()))
-                .setType(new SimpleInternationalString("An other instrument type."));
-        assertFalse(p1.equals(p2));
+        final DefaultAcquisitionInformation p1 = createCyclicMetadata();
+        final DefaultAcquisitionInformation p2 = createCyclicMetadata();
+        assertTrue("equals", p1.equals(p2));
+
+        final DefaultPlatform   platform   = (DefaultPlatform)   getSingleton(p2.getPlatforms());
+        final DefaultInstrument instrument = (DefaultInstrument) getSingleton(platform.getInstruments());
+        instrument.setType(new SimpleInternationalString("An other instrument type."));
+        assertFalse("equals", p1.equals(p2));
     }
 
     /**
@@ -223,7 +255,7 @@ public final strictfp class MetadataStan
     @DependsOnMethod("testGetAccessor")
     public void testValueMap() {
         final DefaultCitation instance = new DefaultCitation(HardCodedCitations.EPSG);
-        final Map<String,Object> map = MetadataStandard.ISO_19115.asValueMap(instance,
+        final Map<String,Object> map = MetadataStandard.ISO_19115.asValueMap(instance, null,
                 KeyNamePolicy.JAVABEANS_PROPERTY, ValueExistencePolicy.NON_EMPTY);
         assertFalse("The properties map shall not be empty.", map.isEmpty());
         assertEquals("Unexpected number of properties.", 4, map.size());
@@ -261,13 +293,13 @@ public final strictfp class MetadataStan
     @Test
     @DependsOnMethod("testValueMap")
     public void testHashCode() {
-        final MetadataStandard std = MetadataStandard.ISO_19115;
+        standard = MetadataStandard.ISO_19115;
         final DefaultCitation instance = HardCodedCitations.EPSG;
-        final Map<String,Object> map = std.asValueMap(instance,
+        final Map<String,Object> map = standard.asValueMap(instance, null,
                 KeyNamePolicy.JAVABEANS_PROPERTY, ValueExistencePolicy.NON_EMPTY);
         assertFalse(map.isEmpty()); // Actually 'testValueMap()' job, but verified for safety.
         assertEquals("hashCode()", new HashSet<>(map.values()).hashCode() + Citation.class.hashCode(),
-                std.hashCode(instance));
+                standard.hashCode(instance));
     }
 
     /**
@@ -279,13 +311,13 @@ public final strictfp class MetadataStan
     @Test
     @DependsOnMethod("testHashCode")
     public void testHashCodeOnCyclicMetadata() {
-        final MetadataStandard std = MetadataStandard.ISO_19115;
-        final int code = std.hashCode(createCyclicMetadata());
+        standard = MetadataStandard.ISO_19115;
+        final int code = standard.hashCode(createCyclicMetadata());
         /*
          * Following line checks that the hash code is stable, just for doing something with the code.
          * The real test was actually to ensure that the above line didn't threw a StackOverflowError.
          */
-        assertEquals(code, std.hashCode(createCyclicMetadata()));
+        assertEquals(code, standard.hashCode(createCyclicMetadata()));
     }
 
     /**
@@ -295,15 +327,15 @@ public final strictfp class MetadataStan
     @Test
     @DependsOnMethod("testGetAccessor")
     public void testWithoutImplementation() {
-        final MetadataStandard std = MetadataStandard.ISO_19123;
-        assertFalse("isMetadata(String)",          std.isMetadata(String.class));
-        assertTrue ("isMetadata(Citation)",        std.isMetadata(Citation.class));         // Transitive dependency
-        assertTrue ("isMetadata(DefaultCitation)", std.isMetadata(DefaultCitation.class));  // Transitive dependency
-        assertTrue ("isMetadata(RectifiedGrid)",   std.isMetadata(RectifiedGrid.class));
+        standard = MetadataStandard.ISO_19123;
+        assertFalse("isMetadata(String)",          isMetadata(String.class));
+        assertTrue ("isMetadata(Citation)",        isMetadata(Citation.class));         // Transitive dependency
+        assertTrue ("isMetadata(DefaultCitation)", isMetadata(DefaultCitation.class));  // Transitive dependency
+        assertTrue ("isMetadata(RectifiedGrid)",   isMetadata(RectifiedGrid.class));
         /*
          * Ensure that the getters have been found.
          */
-        final Map<String,String> names = std.asNameMap(RectifiedGrid.class, KeyNamePolicy.UML_IDENTIFIER, KeyNamePolicy.JAVABEANS_PROPERTY);
+        final Map<String,String> names = standard.asNameMap(RectifiedGrid.class, KeyNamePolicy.UML_IDENTIFIER, KeyNamePolicy.JAVABEANS_PROPERTY);
         assertFalse("Getters should have been found even if there is no implementation.", names.isEmpty());
         assertEquals("dimension", names.get("dimension"));
         assertEquals("cells", names.get("cell"));
@@ -312,11 +344,11 @@ public final strictfp class MetadataStan
          * which is of type List<double[]>.
          */
         Map<String,Class<?>> types;
-        types = std.asTypeMap(RectifiedGrid.class, KeyNamePolicy.UML_IDENTIFIER, TypeValuePolicy.PROPERTY_TYPE);
+        types = standard.asTypeMap(RectifiedGrid.class, KeyNamePolicy.UML_IDENTIFIER, TypeValuePolicy.PROPERTY_TYPE);
         assertEquals("The return type is the int primitive type.", Integer.TYPE, types.get("dimension"));
         assertEquals("The offset vectors are stored in a List.",   List.class,   types.get("offsetVectors"));
 
-        types = std.asTypeMap(RectifiedGrid.class, KeyNamePolicy.UML_IDENTIFIER, TypeValuePolicy.ELEMENT_TYPE);
+        types = standard.asTypeMap(RectifiedGrid.class, KeyNamePolicy.UML_IDENTIFIER, TypeValuePolicy.ELEMENT_TYPE);
         assertEquals("As elements in a list of dimensions.",       Integer.class,  types.get("dimension"));
         assertEquals("As elements in the list of offset vectors.", double[].class, types.get("offsetVectors"));
     }

Modified: sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/MetadataTestCase.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/MetadataTestCase.java?rev=1778899&r1=1778898&r2=1778899&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/MetadataTestCase.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/MetadataTestCase.java [UTF-8] Sun Jan 15 10:08:13 2017
@@ -64,8 +64,8 @@ public abstract strictfp class MetadataT
     /**
      * Creates a new test suite for the given types.
      *
-     * @param standard The standard implemented by the metadata objects to test.
-     * @param types The GeoAPI interfaces, {@link CodeList} or {@link Enum} types to test.
+     * @param  standard  the standard implemented by the metadata objects to test.
+     * @param  types     the GeoAPI interfaces, {@link CodeList} or {@link Enum} types to test.
      */
     protected MetadataTestCase(final MetadataStandard standard, final Class<?>... types) {
         super(types);
@@ -92,8 +92,8 @@ public abstract strictfp class MetadataT
      *
      * <p>The default implementation returns {@code true}.</p>
      *
-     * @param  impl     The implementation class.
-     * @param  property The name of the property to test.
+     * @param  impl      the implementation class.
+     * @param  property  the name of the property to test.
      * @return {@code true} if the given property is writable.
      */
     protected boolean isWritable(final Class<?> impl, final String property) {
@@ -108,9 +108,9 @@ public abstract strictfp class MetadataT
      * <p>The returned value may be of an other type than the given one if the
      * {@code PropertyAccessor} converter method know how to convert that type.</p>
      *
-     * @param  property The name of the property for which to create a value.
-     * @param  type The type of value to create.
-     * @return The value of the given {@code type}, or of a type convertible to the given type.
+     * @param  property  the name of the property for which to create a value.
+     * @param  type      the type of value to create.
+     * @return the value of the given {@code type}, or of a type convertible to the given type.
      */
     protected Object valueFor(final String property, final Class<?> type) {
         if (CharSequence.class.isAssignableFrom(type)) {
@@ -171,7 +171,7 @@ public abstract strictfp class MetadataT
      * Validates the given newly constructed metadata. The default implementation ensures that
      * {@link AbstractMetadata#isEmpty()} returns {@code true}.
      *
-     * @param metadata The metadata to validate.
+     * @param  metadata  the metadata to validate.
      */
     protected void validate(final AbstractMetadata metadata) {
         assertTrue("AbstractMetadata.isEmpty()", metadata.isEmpty());
@@ -179,7 +179,7 @@ public abstract strictfp class MetadataT
 
     /**
      * For every properties in every non-{@code Codelist} types listed in the {@link #types} array,
-     * test the property values. This method performs the tests documented in class javadoc.
+     * tests the property values. This method performs the tests documented in class javadoc.
      */
     @Test
     public void testPropertyValues() {

Modified: sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/PropertyAccessorTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/PropertyAccessorTest.java?rev=1778899&r1=1778898&r2=1778899&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/PropertyAccessorTest.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/PropertyAccessorTest.java [UTF-8] Sun Jan 15 10:08:13 2017
@@ -111,8 +111,8 @@ public final strictfp class PropertyAcce
      *
      * The tuples shall be ordered according the {@link PropertyComparator}.
      *
-     * @param accessor The accessor to test.
-     * @param expected The expected names and types as described above.
+     * @param  accessor  the accessor to test.
+     * @param  expected  the expected names and types as described above.
      *
      * @see PropertyAccessor#mapping
      */
@@ -229,9 +229,8 @@ public final strictfp class PropertyAcce
     }
 
     /**
-     * Tests the constructor with a method which override an other method with covariant
-     * return type. This test may need to be updated if a future GeoAPI release modifies
-     * the {@link GeographicCRS} interface.
+     * Tests the constructor with a method which override an other method with covariant return type.
+     * This test may need to be updated if a future GeoAPI release modifies the {@link GeographicCRS} interface.
      *
      * @see <a href="http://jira.geotoolkit.org/browse/GEOTK-205">GEOTK-205</a>
      */
@@ -264,8 +263,8 @@ public final strictfp class PropertyAcce
     }
 
     /**
-     * Tests the {@link PropertyAccessor#get(int, Object)} method on the {@link HardCodedCitations#ISO}
-     * constant. The metadata object read by this test is:
+     * Tests the {@link PropertyAccessor#get(int, Object)} method on the {@link HardCodedCitations#ISO} constant.
+     * The metadata object read by this test is:
      *
      * {@preformat text
      *   DefaultCitation
@@ -654,7 +653,7 @@ public final strictfp class PropertyAcce
      * Returns the code of the singleton identifier found in the given collection.
      * This method verifies that the object is of the expected type.
      *
-     * @param identifiers A singleton {@code Collection<Identifier>}.
+     * @param  identifiers  a singleton {@code Collection<Identifier>}.
      * @return {@link Identifier#getCode()}.
      */
     static String getSingletonCode(final Object identifiers) {

Modified: sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/PropertyInformationTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/PropertyInformationTest.java?rev=1778899&r1=1778898&r2=1778899&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/PropertyInformationTest.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/PropertyInformationTest.java [UTF-8] Sun Jan 15 10:08:13 2017
@@ -50,10 +50,10 @@ public final strictfp class PropertyInfo
     /**
      * Creates a property information instance for the given method of the {@link Citation} interface.
      *
-     * @param  elementType The type of elements returned by the given method.
-     * @param  method      The name of the method.
-     * @param  property    The ISO 19115 name of the property.
-     * @throws NoSuchMethodException If the {@code method} name is invalid.
+     * @param  elementType  the type of elements returned by the given method.
+     * @param  method       the name of the method.
+     * @param  property     the ISO 19115 name of the property.
+     * @throws NoSuchMethodException if the {@code method} name is invalid.
      */
     private static <T> PropertyInformation<T> create(final Class<T> elementType, final String method,
             final String property) throws NoSuchMethodException
@@ -76,7 +76,7 @@ public final strictfp class PropertyInfo
      * Tests the properties of {@link Citation#getTitle()}.
      * The element type is an {@link InternationalString} singleton, which is mandatory.
      *
-     * @throws NoSuchMethodException Should never happen.
+     * @throws NoSuchMethodException if the {@code getTitle()} method has not been found.
      */
     @Test
     public void testTitle() throws NoSuchMethodException {
@@ -106,7 +106,7 @@ public final strictfp class PropertyInfo
      * Tests the properties of {@link Citation#getPresentationForms()}.
      * The element type is {@link PresentationForm} in a collection.
      *
-     * @throws NoSuchMethodException Should never happen.
+     * @throws NoSuchMethodException if the {@code getPresentationForms()} method has not been found.
      */
     @Test
     public void testPresentationForm() throws NoSuchMethodException {
@@ -135,7 +135,7 @@ public final strictfp class PropertyInfo
     /**
      * Tests {@link PropertyInformation#getDomainValue()} with a non-null range.
      *
-     * @throws NoSuchMethodException Should never happen.
+     * @throws NoSuchMethodException if the {@code getMaxRelativeHumidity()} or other method has not been found.
      */
     @Test
     @SuppressWarnings("UnnecessaryBoxing")
@@ -158,7 +158,7 @@ public final strictfp class PropertyInfo
      * Tests the {@link PropertyInformation#toString()} method.
      * All information in the expected strings have been validated by previous tests in this class.
      *
-     * @throws NoSuchMethodException Should never happen.
+     * @throws NoSuchMethodException if the {@code getTitle()} or other method has not been found.
      */
     @Test
     @DependsOnMethod({"testTitle", "testPresentationForm"})
@@ -173,7 +173,7 @@ public final strictfp class PropertyInfo
     /**
      * Tests serialization.
      *
-     * @throws NoSuchMethodException Should never happen.
+     * @throws NoSuchMethodException if the {@code getTitle()} method has not been found.
      */
     @Test
     public void testSerialization() throws NoSuchMethodException {

Modified: sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/PrunerTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/PrunerTest.java?rev=1778899&r1=1778898&r2=1778899&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/PrunerTest.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/PrunerTest.java [UTF-8] Sun Jan 15 10:08:13 2017
@@ -23,7 +23,6 @@ import org.apache.sis.metadata.iso.exten
 import org.apache.sis.metadata.iso.identification.DefaultResolution;
 import org.apache.sis.metadata.iso.identification.DefaultDataIdentification;
 import org.apache.sis.metadata.iso.identification.DefaultRepresentativeFraction;
-import org.apache.sis.metadata.iso.acquisition.DefaultAcquisitionInformation;
 import org.apache.sis.internal.simple.SimpleIdentifier;
 import org.apache.sis.test.DependsOnMethod;
 import org.apache.sis.test.DependsOn;
@@ -40,7 +39,7 @@ import static org.apache.sis.metadata.Va
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.3
- * @version 0.6
+ * @version 0.8
  * @module
  */
 @DependsOn(ValueMapTest.class)
@@ -153,9 +152,7 @@ public final strictfp class PrunerTest e
      * The cycle is between {@code platform.instrument} and {@code instrument.isMountedOn}.
      */
     private void createCyclicMetadata() {
-        final DefaultAcquisitionInformation acquisition = new DefaultAcquisitionInformation();
-        acquisition.setPlatforms(singleton(MetadataStandardTest.createCyclicMetadata()));
-        metadata.setAcquisitionInformation(singleton(acquisition));
+        metadata.setAcquisitionInformation(singleton(MetadataStandardTest.createCyclicMetadata()));
     }
 
     /**

Modified: sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/TreeNodeChildrenTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/TreeNodeChildrenTest.java?rev=1778899&r1=1778898&r2=1778899&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/TreeNodeChildrenTest.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/TreeNodeChildrenTest.java [UTF-8] Sun Jan 15 10:08:13 2017
@@ -20,6 +20,7 @@ import java.util.Random;
 import java.util.Iterator;
 import java.util.List;
 import java.util.ArrayList;
+import org.opengis.metadata.Metadata;
 import org.opengis.metadata.citation.PresentationForm;
 import org.apache.sis.metadata.iso.citation.DefaultCitation;
 import org.apache.sis.util.iso.SimpleInternationalString;
@@ -48,7 +49,7 @@ import static org.apache.sis.test.TestUt
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.3
- * @version 0.5
+ * @version 0.8
  * @module
  */
 @DependsOn(PropertyAccessorTest.class)
@@ -117,9 +118,9 @@ public final strictfp class TreeNodeChil
      */
     private static TreeNodeChildren create(final AbstractMetadata metadata, final ValueExistencePolicy valuePolicy) {
         final MetadataStandard standard = MetadataStandard.ISO_19115;
-        final TreeTableView    table    = new TreeTableView(standard, metadata, valuePolicy);
+        final TreeTableView    table    = new TreeTableView(standard, metadata, Metadata.class, valuePolicy);
         final TreeNode         node     = (TreeNode) table.getRoot();
-        final PropertyAccessor accessor = standard.getAccessor(metadata.getClass(), true);
+        final PropertyAccessor accessor = standard.getAccessor(new CacheKey(metadata.getClass()), true);
         return new TreeNodeChildren(node, metadata, accessor);
     }
 
@@ -199,9 +200,9 @@ public final strictfp class TreeNodeChil
             "Some title",
             "First alternate title",
             "Second alternate title",
-            "Third alternate title",  // After addition
-            "New edition", // After "addition" (actually change).
-            "PresentationForm[IMAGE_DIGITAL]", // After addition
+            "Third alternate title",                // After addition
+            "New edition",                          // After "addition" (actually change).
+            "PresentationForm[IMAGE_DIGITAL]",      // After addition
             "PresentationForm[MAP_DIGITAL]",
             "PresentationForm[MAP_HARDCOPY]",
             "Some other details"
@@ -216,7 +217,7 @@ public final strictfp class TreeNodeChil
         } catch (IllegalStateException e) {
             assertTrue(e.getMessage().contains("edition"));
         }
-        citation.setEdition(null); // Clears so we are allowed to add.
+        citation.setEdition(null);                                                  // Clears so we are allowed to add.
         assertTrue("Setting a new value shall be a change.", children.add(toAdd));
 
         toAdd.setValue(TableColumn.IDENTIFIER, "presentationForm");
@@ -309,7 +310,7 @@ public final strictfp class TreeNodeChil
             "PresentationForm[MAP_HARDCOPY]",
             null, // series
             "Some other details",
-//          null, // collective title  -- deprecated as of ISO 19115:2014.
+//          null, // collective title                       -- deprecated as of ISO 19115:2014.
             null, // ISBN
             null, // ISSN
             null, // onlineResources (collection)
@@ -351,8 +352,8 @@ public final strictfp class TreeNodeChil
      * Asserts that all next elements traversed by the {@code actual} iterator are equal
      * to the next elements traversed by {@code expected}.
      *
-     * @param expected The iterator over expected values.
-     * @param actual   The iterator over actual values.
+     * @param  expected  the iterator over expected values.
+     * @param  actual    the iterator over actual values.
      */
     private static void assertAllNextEqual(final Iterator<?> expected, final Iterator<?> actual) {
         while (expected.hasNext()) {
@@ -367,19 +368,19 @@ public final strictfp class TreeNodeChil
      * Elements are removed randomly until the collection is empty. After each removal,
      * the remaining elements are compared with the content of a standard Java collection.
      *
-     * @param random   A random number generator.
-     * @param children The collection from which to remove elements.
+     * @param  random    a random number generator.
+     * @param  children  the collection from which to remove elements.
      */
     private static void testRemove(final Random random, final TreeNodeChildren children) {
         final List<TreeTable.Node> reference = new ArrayList<>(children);
         assertFalse("The collection shall not be initially empty.", reference.isEmpty());
         do {
-            final Iterator<TreeTable.Node> rit = reference.iterator(); // The reference iterator.
-            final Iterator<TreeTable.Node> cit = children .iterator(); // The children iterator to be tested.
+            final Iterator<TreeTable.Node> rit = reference.iterator();      // The reference iterator.
+            final Iterator<TreeTable.Node> cit = children .iterator();      // The children iterator to be tested.
             while (rit.hasNext()) {
                 assertTrue(cit.hasNext());
                 assertSame(rit.next(), cit.next());
-                if (random.nextInt(3) == 0) { // Remove only 1/3 of entries on each pass.
+                if (random.nextInt(3) == 0) {                           // Remove only 1/3 of entries on each pass.
                     rit.remove();
                     cit.remove();
                     assertAllNextEqual(reference.iterator(), children.iterator());

Modified: sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/TreeNodeTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/TreeNodeTest.java?rev=1778899&r1=1778898&r2=1778899&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/TreeNodeTest.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/TreeNodeTest.java [UTF-8] Sun Jan 15 10:08:13 2017
@@ -49,7 +49,7 @@ import static java.util.Collections.sing
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.3
- * @version 0.5
+ * @version 0.8
  * @module
  */
 @DependsOn(TreeNodeChildrenTest.class)
@@ -100,9 +100,11 @@ public final strictfp class TreeNodeTest
     /**
      * Creates a node to be tested for the given metadata object and value policy.
      */
-    private static TreeNode create(final AbstractMetadata metadata, final ValueExistencePolicy valuePolicy) {
+    private static <T extends AbstractMetadata> TreeNode create(final T metadata,
+            final Class<? super T> baseType, final ValueExistencePolicy valuePolicy)
+    {
         final MetadataStandard  standard = MetadataStandard.ISO_19115;
-        final TreeTableView table = new TreeTableView(standard, metadata, valuePolicy);
+        final TreeTableView table = new TreeTableView(standard, metadata, baseType, valuePolicy);
         return (TreeNode) table.getRoot();
     }
 
@@ -112,10 +114,10 @@ public final strictfp class TreeNodeTest
     @Test
     public void testRootNode() {
         final DefaultCitation citation = TreeNodeChildrenTest.metadataWithoutCollections();
-        final TreeNode node = create(citation, ValueExistencePolicy.NON_EMPTY);
+        final TreeNode node = create(citation, Citation.class, ValueExistencePolicy.NON_EMPTY);
         assertEquals("getName()",        "Citation",     node.getName());
         assertEquals("getIdentifier()",  "CI_Citation",  node.getIdentifier());
-        assertEquals("getElementType()", Citation.class, node.getElementType());
+        assertEquals("baseType",         Citation.class, node.baseType);
         assertSame  ("getUserObject()",  citation,       node.getUserObject());
         assertFalse ("isWritable()",                     node.isWritable());
         assertNull  ("getParent()",                      node.getParent());
@@ -132,10 +134,10 @@ public final strictfp class TreeNodeTest
      * Those names shall <em>not</em> contain numbering like <cite>"(1 of 2)"</cite>.
      */
     @Test
-    @DependsOnMethod("testRootNode") // Because tested more basic methods than 'getValue(TableColumn)'.
+    @DependsOnMethod("testRootNode")            // Because tested more basic methods than 'getValue(TableColumn)'.
     public void testGetNameForSingleton() {
         final DefaultCitation citation = TreeNodeChildrenTest.metadataWithSingletonInCollections();
-        assertColumnContentEquals(create(citation, ValueExistencePolicy.NON_EMPTY), TableColumn.NAME,
+        assertColumnContentEquals(create(citation, Citation.class, ValueExistencePolicy.NON_EMPTY), TableColumn.NAME,
             "Citation",
               "Title",
               "Alternate title",
@@ -152,7 +154,7 @@ public final strictfp class TreeNodeTest
     @DependsOnMethod("testGetNameForSingleton")
     public void testGetNameForMultiOccurrences() {
         final DefaultCitation citation = TreeNodeChildrenTest.metadataWithMultiOccurrences();
-        assertColumnContentEquals(create(citation, ValueExistencePolicy.NON_EMPTY), TableColumn.NAME,
+        assertColumnContentEquals(create(citation, Citation.class, ValueExistencePolicy.NON_EMPTY), TableColumn.NAME,
             "Citation",
               "Title",
               "Alternate title (1 of 2)",
@@ -170,7 +172,7 @@ public final strictfp class TreeNodeTest
     @DependsOnMethod("testGetNameForMultiOccurrences")
     public void testGetNameForHierarchy() {
         final DefaultCitation citation = metadataWithHierarchy();
-        assertColumnContentEquals(create(citation, ValueExistencePolicy.NON_EMPTY), TableColumn.NAME,
+        assertColumnContentEquals(create(citation, Citation.class, ValueExistencePolicy.NON_EMPTY), TableColumn.NAME,
             "Citation",
               "Title",
               "Alternate title (1 of 2)",
@@ -199,10 +201,10 @@ public final strictfp class TreeNodeTest
      * The repetition of the same identifier means that they shall be part of a collection.
      */
     @Test
-    @DependsOnMethod("testGetNameForMultiOccurrences") // Because similar to names, which were tested progressively.
+    @DependsOnMethod("testGetNameForMultiOccurrences")     // Because similar to names, which were tested progressively.
     public void testGetIdentifier() {
         final DefaultCitation citation = metadataWithHierarchy();
-        assertColumnContentEquals(create(citation, ValueExistencePolicy.NON_EMPTY), TableColumn.IDENTIFIER,
+        assertColumnContentEquals(create(citation, Citation.class, ValueExistencePolicy.NON_EMPTY), TableColumn.IDENTIFIER,
             "CI_Citation",
               "title",
               "alternateTitle",
@@ -233,7 +235,7 @@ public final strictfp class TreeNodeTest
         final Integer ZERO = 0;
         final Integer ONE  = 1;
         final DefaultCitation citation = metadataWithHierarchy();
-        assertColumnContentEquals(create(citation, ValueExistencePolicy.NON_EMPTY), TableColumn.INDEX,
+        assertColumnContentEquals(create(citation, Citation.class, ValueExistencePolicy.NON_EMPTY), TableColumn.INDEX,
             null,           // CI_Citation
               null,         // title
               ZERO,         // alternateTitle
@@ -259,10 +261,10 @@ public final strictfp class TreeNodeTest
      * Tests {@link TreeNode#getElementType()} on a metadata with a hierarchy.
      */
     @Test
-    @DependsOnMethod("testGetIdentifier") // Because if identifiers are wrong, we are looking at wrong properties.
+    @DependsOnMethod("testGetIdentifier")       // Because if identifiers are wrong, we are looking at wrong properties.
     public void testGetElementType() {
         final DefaultCitation citation = metadataWithHierarchy();
-        assertColumnContentEquals(create(citation, ValueExistencePolicy.NON_EMPTY), TableColumn.TYPE,
+        assertColumnContentEquals(create(citation, Citation.class, ValueExistencePolicy.NON_EMPTY), TableColumn.TYPE,
             Citation.class,
               InternationalString.class,
               InternationalString.class,
@@ -288,10 +290,10 @@ public final strictfp class TreeNodeTest
      * Tests {@link TreeNode#getValue(TableColumn)} for the value column.
      */
     @Test
-    @DependsOnMethod("testGetIdentifier") // Because if identifiers are wrong, we are looking at wrong properties.
+    @DependsOnMethod("testGetIdentifier")       // Because if identifiers are wrong, we are looking at wrong properties.
     public void testGetValue() {
         final DefaultCitation citation = metadataWithHierarchy();
-        assertColumnContentEquals(create(citation, ValueExistencePolicy.NON_EMPTY), TableColumn.VALUE,
+        assertColumnContentEquals(create(citation, Citation.class, ValueExistencePolicy.NON_EMPTY), TableColumn.VALUE,
             null, // Citation
               "Some title",
               "First alternate title",
@@ -320,7 +322,7 @@ public final strictfp class TreeNodeTest
     @DependsOnMethod("testGetValue")
     public void testNewChild() {
         final DefaultCitation citation = metadataWithHierarchy();
-        final TreeNode node = create(citation, ValueExistencePolicy.NON_EMPTY);
+        final TreeNode node = create(citation, Citation.class, ValueExistencePolicy.NON_EMPTY);
         /*
          * Ensure that we can not overwrite existing nodes.
          */
@@ -357,11 +359,11 @@ public final strictfp class TreeNodeTest
      * on all children of that given. In the particular case of the {@link #NAME} method,
      * international strings are replaced by unlocalized strings before comparisons.
      *
-     * @param node     The node for which to test the children.
-     * @param column   The column from which to get a value.
-     * @param values   The expected values. The first value is the result of the getter method
-     *                 applied on the given node, and all other values are the result of the
-     *                 getter method applied on the children, in iteration order.
+     * @param  node     the node for which to test the children.
+     * @param  column   the column from which to get a value.
+     * @param  values   the expected values. The first value is the result of the getter method
+     *                  applied on the given node, and all other values are the result of the
+     *                  getter method applied on the children, in iteration order.
      */
     private static void assertColumnContentEquals(final TreeNode node,
             final TableColumn<?> column, final Object... values)

Modified: sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/TreeTableViewTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/TreeTableViewTest.java?rev=1778899&r1=1778898&r2=1778899&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/TreeTableViewTest.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/TreeTableViewTest.java [UTF-8] Sun Jan 15 10:08:13 2017
@@ -20,6 +20,7 @@ import java.io.ObjectInputStream;
 import java.io.ObjectOutputStream;
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
+import org.opengis.metadata.citation.Citation;
 import org.apache.sis.test.DependsOnMethod;
 import org.apache.sis.test.DependsOn;
 import org.apache.sis.test.TestCase;
@@ -36,7 +37,7 @@ import static org.apache.sis.test.TestUt
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.3
- * @version 0.5
+ * @version 0.8
  * @module
  */
 @DependsOn(TreeNodeTest.class)
@@ -45,7 +46,7 @@ public final strictfp class TreeTableVie
      * Creates a table to be tested for the given value policy.
      */
     private static TreeTableView create(final ValueExistencePolicy valuePolicy) {
-        return new TreeTableView(MetadataStandard.ISO_19115, TreeNodeTest.metadataWithHierarchy(), valuePolicy);
+        return new TreeTableView(MetadataStandard.ISO_19115, TreeNodeTest.metadataWithHierarchy(), Citation.class, valuePolicy);
     }
 
     /**

Modified: sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/ValueMapTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/ValueMapTest.java?rev=1778899&r1=1778898&r2=1778899&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/ValueMapTest.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/ValueMapTest.java [UTF-8] Sun Jan 15 10:08:13 2017
@@ -86,7 +86,7 @@ public final strictfp class ValueMapTest
      * The citation instance is stored in the {@link #citation} field.
      * The title and author instances are stored in the {@link #title} and {@link #author} fields.
      *
-     * @return The map view of the citation create by this method.
+     * @return the map view of the citation create by this method.
      */
     private Map<String,Object> createCitation() {
         title    = new SimpleInternationalString("Undercurrent");
@@ -96,7 +96,7 @@ public final strictfp class ValueMapTest
         citation.setCitedResponsibleParties(singleton(author));
         citation.setISBN("9782505004509");
         citation.setEdition(NilReason.UNKNOWN.createNilObject(InternationalString.class));
-        return MetadataStandard.ISO_19115.asValueMap(citation, KeyNamePolicy.JAVABEANS_PROPERTY, ValueExistencePolicy.NON_EMPTY);
+        return MetadataStandard.ISO_19115.asValueMap(citation, null, KeyNamePolicy.JAVABEANS_PROPERTY, ValueExistencePolicy.NON_EMPTY);
     }
 
     /**
@@ -157,7 +157,7 @@ public final strictfp class ValueMapTest
     public void testEntrySetForNonNil() {
         final Map<String,Object> map = createCitation();
         final Map<String,Object> all = MetadataStandard.ISO_19115.asValueMap(citation,
-                KeyNamePolicy.JAVABEANS_PROPERTY, ValueExistencePolicy.NON_NIL);
+                null, KeyNamePolicy.JAVABEANS_PROPERTY, ValueExistencePolicy.NON_NIL);
         assertFalse("Null values shall be excluded.", map.containsKey("alternateTitles"));
         assertTrue ("Null values shall be included.", all.containsKey("alternateTitles"));
         assertFalse("Nil objects shall be excluded.", map.containsKey("edition"));
@@ -187,7 +187,7 @@ public final strictfp class ValueMapTest
     public void testEntrySetForNonNull() {
         final Map<String,Object> map = createCitation();
         final Map<String,Object> all = MetadataStandard.ISO_19115.asValueMap(citation,
-                KeyNamePolicy.JAVABEANS_PROPERTY, ValueExistencePolicy.NON_NULL);
+                null, KeyNamePolicy.JAVABEANS_PROPERTY, ValueExistencePolicy.NON_NULL);
         assertFalse("Null values shall be excluded.", map.containsKey("alternateTitles"));
         assertTrue ("Null values shall be included.", all.containsKey("alternateTitles"));
         assertFalse("Nil objects shall be excluded.", map.containsKey("edition"));
@@ -218,7 +218,7 @@ public final strictfp class ValueMapTest
     public void testEntrySetForAll() {
         final Map<String,Object> map = createCitation();
         final Map<String,Object> all = MetadataStandard.ISO_19115.asValueMap(citation,
-                KeyNamePolicy.JAVABEANS_PROPERTY, ValueExistencePolicy.ALL);
+                null, KeyNamePolicy.JAVABEANS_PROPERTY, ValueExistencePolicy.ALL);
         assertFalse("Null values shall be excluded.", map.containsKey("alternateTitles"));
         assertTrue ("Null values shall be included.", all.containsKey("alternateTitles"));
         assertTrue ("'all' shall be a larger map than 'map'.", all.entrySet().containsAll(map.entrySet()));

Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/IdentifierMapAdapter.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/IdentifierMapAdapter.java?rev=1778899&r1=1778898&r2=1778899&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/IdentifierMapAdapter.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/IdentifierMapAdapter.java [UTF-8] Sun Jan 15 10:08:13 2017
@@ -25,6 +25,7 @@ import java.util.Collection;
 import java.util.Collections;
 import java.util.AbstractMap;
 import java.util.NoSuchElementException;
+import java.util.Objects;
 import java.io.Serializable;
 import org.opengis.metadata.Identifier;
 import org.opengis.metadata.citation.Citation;
@@ -36,9 +37,6 @@ import org.apache.sis.internal.util.SetO
 
 import static org.apache.sis.util.collection.Containers.hashMapCapacity;
 
-// Branch-dependent imports
-import java.util.Objects;
-
 
 /**
  * Implementation of the map of identifiers associated to {@link org.apache.sis.xml.IdentifiedObject} instances.



Mime
View raw message