sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1457600 [1/3] - in /sis/branches/JDK6: ./ ide-project/NetBeans/ sis-metadata/src/main/java/org/apache/sis/metadata/ sis-metadata/src/main/java/org/apache/sis/metadata/iso/ sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/ si...
Date Sun, 17 Mar 2013 23:50:04 GMT
Author: desruisseaux
Date: Sun Mar 17 23:50:02 2013
New Revision: 1457600

URL: http://svn.apache.org/r1457600
Log:
Merge from the JDK7 branch.

Added:
    sis/branches/JDK6/sis-metadata/src/main/java/org/apache/sis/metadata/InvalidMetadataException.java
      - copied unchanged from r1457583, sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/InvalidMetadataException.java
    sis/branches/JDK6/sis-metadata/src/main/java/org/apache/sis/metadata/MetadataMap.java
      - copied unchanged from r1457583, sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/MetadataMap.java
    sis/branches/JDK6/sis-metadata/src/main/java/org/apache/sis/metadata/PropertyMap.java
      - copied, changed from r1457583, sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/PropertyMap.java
    sis/branches/JDK6/sis-metadata/src/main/java/org/apache/sis/metadata/Pruner.java
      - copied, changed from r1457583, sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/Pruner.java
    sis/branches/JDK6/sis-metadata/src/main/java/org/apache/sis/metadata/iso/ISOMetadata.java
      - copied unchanged from r1457583, sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/ISOMetadata.java
    sis/branches/JDK6/sis-metadata/src/test/java/org/apache/sis/metadata/PropertyAccessorTest.java
      - copied unchanged from r1457583, sis/branches/JDK7/sis-metadata/src/test/java/org/apache/sis/metadata/PropertyAccessorTest.java
    sis/branches/JDK6/sis-metadata/src/test/java/org/apache/sis/metadata/iso/
      - copied from r1457583, sis/branches/JDK7/sis-metadata/src/test/java/org/apache/sis/metadata/iso/
    sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/internal/converter/
      - copied from r1457583, sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/internal/converter/
    sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/internal/jdk7/
    sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/internal/jdk7/JDK7.java
      - copied, changed from r1457583, sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/internal/util/JDK7.java
    sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/internal/jdk7/Objects.java
      - copied, changed from r1457583, sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/internal/util/Objects.java
    sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/internal/jdk7/StandardCharsets.java   (with props)
    sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/internal/jdk7/package-info.java   (with props)
    sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/io/ClassFormat.java
      - copied unchanged from r1457583, sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/io/ClassFormat.java
    sis/branches/JDK6/sis-utility/src/main/resources/META-INF/
      - copied from r1457583, sis/branches/JDK7/sis-utility/src/main/resources/META-INF/
    sis/branches/JDK6/sis-utility/src/test/java/org/apache/sis/internal/converter/
      - copied from r1457583, sis/branches/JDK7/sis-utility/src/test/java/org/apache/sis/internal/converter/
    sis/branches/JDK6/sis-utility/src/test/java/org/apache/sis/test/PlatformDependentTest.java
      - copied unchanged from r1457583, sis/branches/JDK7/sis-utility/src/test/java/org/apache/sis/test/PlatformDependentTest.java
Removed:
    sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/internal/util/JDK7.java
    sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/internal/util/Objects.java
    sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/internal/util/SurjectiveConverter.java
    sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/util/IdentityConverter.java
Modified:
    sis/branches/JDK6/   (props changed)
    sis/branches/JDK6/ide-project/NetBeans/build.xml
    sis/branches/JDK6/pom.xml
    sis/branches/JDK6/sis-metadata/src/main/java/org/apache/sis/metadata/AbstractMetadata.java
    sis/branches/JDK6/sis-metadata/src/main/java/org/apache/sis/metadata/MetadataStandard.java
    sis/branches/JDK6/sis-metadata/src/main/java/org/apache/sis/metadata/ModifiableMetadata.java
    sis/branches/JDK6/sis-metadata/src/main/java/org/apache/sis/metadata/PropertyAccessor.java
    sis/branches/JDK6/sis-metadata/src/main/java/org/apache/sis/metadata/PropertyComparator.java
    sis/branches/JDK6/sis-metadata/src/main/java/org/apache/sis/metadata/PropertyDescriptor.java
    sis/branches/JDK6/sis-metadata/src/main/java/org/apache/sis/metadata/TypeValuePolicy.java
    sis/branches/JDK6/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/DefaultCitation.java
    sis/branches/JDK6/sis-metadata/src/test/java/org/apache/sis/metadata/PropertyDescriptorTest.java
    sis/branches/JDK6/sis-metadata/src/test/java/org/apache/sis/test/suite/MetadataTestSuite.java
    sis/branches/JDK6/sis-referencing/src/main/java/org/apache/sis/geometry/AbstractDirectPosition.java
    sis/branches/JDK6/sis-referencing/src/main/java/org/apache/sis/geometry/AbstractEnvelope.java
    sis/branches/JDK6/sis-referencing/src/main/java/org/apache/sis/geometry/ArrayEnvelope.java
    sis/branches/JDK6/sis-referencing/src/main/java/org/apache/sis/geometry/DirectPosition2D.java
    sis/branches/JDK6/sis-referencing/src/main/java/org/apache/sis/geometry/Envelope2D.java
    sis/branches/JDK6/sis-referencing/src/main/java/org/apache/sis/geometry/GeneralDirectPosition.java
    sis/branches/JDK6/sis-referencing/src/main/java/org/apache/sis/geometry/ImmutableEnvelope.java
    sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/internal/converter/ClassPair.java
    sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/internal/converter/CollectionConverter.java
    sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/internal/converter/ConverterRegistry.java
    sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/internal/converter/DateConverter.java
    sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/internal/converter/FallbackConverter.java
    sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/internal/converter/IdentityConverter.java
    sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/internal/converter/StringConverter.java
    sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/internal/converter/SystemRegistry.java
    sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/internal/jaxb/IdentifierMapAdapter.java
    sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/internal/jaxb/IdentifierMapWithSpecialCases.java
    sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/internal/jaxb/SpecializedIdentifier.java
    sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gmd/LocalisedCharacterString.java
    sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gmd/TextGroup.java
    sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gmx/Anchor.java
    sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/internal/simple/SimpleCitation.java
    sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/internal/simple/SimpleReferenceIdentifier.java
    sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/internal/util/Citations.java
    sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/io/Appender.java
    sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/io/CompoundFormat.java
    sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/io/DefaultFormat.java
    sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/io/LineAppender.java
    sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/io/TableAppender.java
    sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/io/TabularFormat.java
    sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/math/Statistics.java
    sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/measure/AngleFormat.java
    sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/measure/FormattedCharacterIterator.java
    sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/measure/MeasurementRange.java
    sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/measure/Range.java
    sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/util/About.java
    sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/util/ArraysExt.java
    sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/util/CharSequences.java
    sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/util/Classes.java
    sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/util/Exceptions.java
    sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/util/LenientComparable.java
    sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/util/Numbers.java
    sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/util/ObjectConverter.java
    sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/util/ObjectConverters.java
    sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/util/Utilities.java
    sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/util/collection/DefaultTreeTable.java
    sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/util/collection/TableColumn.java
    sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/util/collection/TreeTable.java
    sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/util/collection/TreeTableFormat.java
    sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/util/collection/TreeTables.java
    sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/util/collection/UnmodifiableArrayList.java
    sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/util/collection/WeakHashSet.java
    sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/util/collection/WeakValueHashMap.java
    sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/util/iso/AbstractName.java
    sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultInternationalString.java
    sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultLocalName.java
    sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultNameSpace.java
    sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/util/iso/SimpleInternationalString.java
    sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.java
    sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.properties
    sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/util/resources/Errors_fr.properties
    sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/util/resources/IndexedResourceBundle.java
    sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/util/resources/ResourceInternationalString.java
    sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary.java
    sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary.properties
    sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary_fr.properties
    sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/xml/IdentifiedObject.java
    sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/xml/NilObjectHandler.java
    sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/xml/XLink.java
    sis/branches/JDK6/sis-utility/src/main/resources/META-INF/services/org.apache.sis.util.ObjectConverter
    sis/branches/JDK6/sis-utility/src/test/java/org/apache/sis/internal/converter/ConverterRegistryTest.java
    sis/branches/JDK6/sis-utility/src/test/java/org/apache/sis/internal/converter/StringConverterTest.java
    sis/branches/JDK6/sis-utility/src/test/java/org/apache/sis/io/TableAppenderTest.java
    sis/branches/JDK6/sis-utility/src/test/java/org/apache/sis/io/WordWrapTest.java
    sis/branches/JDK6/sis-utility/src/test/java/org/apache/sis/test/Assert.java
    sis/branches/JDK6/sis-utility/src/test/java/org/apache/sis/test/XMLComparator.java
    sis/branches/JDK6/sis-utility/src/test/java/org/apache/sis/test/suite/UtilityTestSuite.java
    sis/branches/JDK6/sis-utility/src/test/java/org/apache/sis/util/ClassesTest.java
    sis/branches/JDK6/sis-utility/src/test/java/org/apache/sis/util/NumbersTest.java
    sis/branches/JDK6/sis-utility/src/test/java/org/apache/sis/util/collection/TreeTablesTest.java
    sis/branches/JDK6/sis-webapp/pom.xml
    sis/branches/JDK6/src/site/apt/index.apt

Propchange: sis/branches/JDK6/
------------------------------------------------------------------------------
  Merged /sis/branches/JDK7:r1452375-1457583

Modified: sis/branches/JDK6/ide-project/NetBeans/build.xml
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/ide-project/NetBeans/build.xml?rev=1457600&r1=1457599&r2=1457600&view=diff
==============================================================================
--- sis/branches/JDK6/ide-project/NetBeans/build.xml (original)
+++ sis/branches/JDK6/ide-project/NetBeans/build.xml Sun Mar 17 23:50:02 2013
@@ -19,9 +19,10 @@
     </copy>
 
     <!-- Following are classical properties resources files. -->
-    <copy todir="${build.classes.dir}/org/apache/sis/internal/util">
-      <fileset dir="${project.root}/sis-utility/src/main/resources/org/apache/sis/internal/util">
-        <include name="*.properties"/>
+    <copy todir="${build.classes.dir}">
+      <fileset dir="${project.root}/sis-utility/src/main/resources">
+        <include name="META-INF/services/*"/>
+        <include name="**/*.properties"/>
       </fileset>
     </copy>
   </target>

Modified: sis/branches/JDK6/pom.xml
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/pom.xml?rev=1457600&r1=1457599&r2=1457600&view=diff
==============================================================================
--- sis/branches/JDK6/pom.xml (original)
+++ sis/branches/JDK6/pom.xml Sun Mar 17 23:50:02 2013
@@ -344,6 +344,7 @@ Apache SIS is a toolkit for describing l
               <Specification-Vendor>Open Geospatial Consortium</Specification-Vendor>
             </manifestEntries>
           </archive>
+          <skipIfEmpty>true</skipIfEmpty>
         </configuration>
         <executions>
           <execution>
@@ -607,9 +608,9 @@ Apache SIS is a toolkit for describing l
        ============================================================== -->
   <modules>
     <module>sis-build-helper</module>
-    <module>sis-referencing</module>
     <module>sis-utility</module>
     <module>sis-metadata</module>
+    <module>sis-referencing</module>
     <module>sis-webapp</module>
     <module>sis-app</module>
   </modules>

Modified: sis/branches/JDK6/sis-metadata/src/main/java/org/apache/sis/metadata/AbstractMetadata.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/sis-metadata/src/main/java/org/apache/sis/metadata/AbstractMetadata.java?rev=1457600&r1=1457599&r2=1457600&view=diff
==============================================================================
--- sis/branches/JDK6/sis-metadata/src/main/java/org/apache/sis/metadata/AbstractMetadata.java [UTF-8] (original)
+++ sis/branches/JDK6/sis-metadata/src/main/java/org/apache/sis/metadata/AbstractMetadata.java [UTF-8] Sun Mar 17 23:50:02 2013
@@ -16,34 +16,52 @@
  */
 package org.apache.sis.metadata;
 
+import java.util.Map;
 import java.util.logging.Logger;
 import org.apache.sis.util.ComparisonMode;
 import org.apache.sis.util.LenientComparable;
+import org.apache.sis.util.collection.TreeTable;
 import org.apache.sis.util.logging.Logging;
 
+import static org.apache.sis.util.ArgumentChecks.ensureNonNull;
+
 
 /**
- * Base class for metadata implementations, providing basic operations using Java reflection.
- * All {@code AbstractMetadata} instances shall be associated to a {@link MetadataStandard},
- * which is provided by subclasses in the {@link #getStandard()} method. There is typically
- * a large number of {@code AbstractMetadata} subclasses (not necessarily as direct children)
- * for the same standard.
+ * Provides basic operations using Java reflection for metadata implementations.
+ * All {@code AbstractMetadata} instances shall be associated to a {@link MetadataStandard}.
+ * The metadata standard is given by the {@link #getStandard()} method and is typically a
+ * constant fixed by the subclass.
  *
- * <p>This base class reduces the effort required to implement metadata interface by providing
+ * <p>There is a large number of {@code AbstractMetadata} subclasses (not necessarily as direct children)
+ * for the same standard, where each subclass implement one Java interface defined by the metadata standard.
+ * This base class reduces the effort required to implement those metadata interfaces by providing
  * {@link #equals(Object)}, {@link #hashCode()} and {@link #toString()} implementations.
  * Those methods are implemented using Java reflection for invoking the getter methods
  * defined by the {@code MetadataStandard}.</p>
  *
- * <p>{@code AbstractMetadata} may be read-only or read/write, at implementation choice.
- * The {@link ModifiableMetadata} subclass provides the basis of most SIS metadata classes
- * having writing capabilities.</p>
- *
- * {@section Synchronization}
- * The methods in this class are not synchronized. Synchronizations may be done by getter and
- * setter methods in subclasses, at implementation choice. We never synchronize the methods that
- * perform deep traversal of the metadata tree (like {@code equals(Object)}, {@code hashCode()}
- * or {@code toString()}) because such synchronizations are deadlock prone. For example if
- * subclasses synchronize their getter methods, then many locks may be acquired in various orders.
+ * {@note This class does not synchronize the methods that perform deep traversal of the metadata tree
+ * (like <code>equals(Object)</code>, <code>hashCode()</code> or <code>toString()</code>) because such
+ * synchronizations are deadlock prone. For example if subclasses synchronize their getter methods,
+ * then many locks may be acquired in various orders.}
+ *
+ * {@code AbstractMetadata} subclasses may be read-only or read/write, at implementation choice.
+ * The methods that modify the metadata may throw {@link UnmodifiableMetadataException} if the
+ * metadata does not support the operation. Those methods are:
+ *
+ * <ul>
+ *   <li>{@link #prune()}</li>
+ *   <li>{@link #shallowCopy(Object)}</li>
+ *   <li>{@link #asMap()} with {@code put} operations</li>
+ * </ul>
+ *
+ * Read-only operations operating on metadata values are:
+ *
+ * <ul>
+ *   <li>{@link #isEmpty()}</li>
+ *   <li>{@link #asMap()} with {@code get} operations</li>
+ *   <li>{@link #asTreeTable()}</li>
+ *   <li>{@link #equals(Object, ComparisonMode)}</li>
+ * </ul>
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.3 (derived from geotk-2.4)
@@ -57,6 +75,13 @@ public abstract class AbstractMetadata i
     protected static final Logger LOGGER = Logging.getLogger(AbstractMetadata.class);
 
     /**
+     * A view of this metadata as a map. Will be created only when first needed.
+     *
+     * @see #asMap()
+     */
+    private transient Map<String,Object> asMap;
+
+    /**
      * Creates an initially empty metadata.
      */
     protected AbstractMetadata() {
@@ -64,15 +89,12 @@ public abstract class AbstractMetadata i
 
     /**
      * Returns the metadata standard implemented by subclasses.
+     * Subclasses will typically return a hard-coded constant such as
+     * {@link MetadataStandard#ISO_19115}.
      *
      * @return The metadata standard implemented.
-     *
-     * @todo This method returns {@link MetadataStandard#ISO_19115} for now,
-     *       but will become an abstract method soon.
      */
-    public MetadataStandard getStandard() {
-        return MetadataStandard.ISO_19115;
-    }
+    public abstract MetadataStandard getStandard();
 
     /**
      * Returns the metadata interface implemented by this class. It should be one of the
@@ -89,6 +111,105 @@ public abstract class AbstractMetadata i
     }
 
     /**
+     * Returns {@code true} if this metadata contains only {@code null} or empty properties.
+     * A property is considered empty in any of the following cases:
+     *
+     * <ul>
+     *   <li>An empty {@linkplain CharSequence character sequences}.</li>
+     *   <li>An {@linkplain java.util.Collection#isEmpty() empty collection} or an empty array.</li>
+     *   <li>A collection or array containing only {@code null} or empty elements.</li>
+     *   <li>An other metadata object containing only {@code null} or empty attributes.</li>
+     * </ul>
+     *
+     * Note that empty properties can be removed by calling the {@link ModifiableMetadata#prune()}
+     * method.
+     *
+     * {@section Note for implementors}
+     * The default implementation uses Java reflection indirectly, by iterating over all entries
+     * returned by {@link MetadataStandard#asMap(Object, KeyNamePolicy, ValueExistencePolicy)}.
+     * Subclasses that override this method should usually not invoke {@code super.isEmpty()},
+     * because the Java reflection will discover and process the properties defined in the
+     * subclasses - which is usually not the intend when overriding a method.
+     *
+     * @return {@code true} if this metadata is empty.
+     *
+     * @see org.apache.sis.metadata.iso.extent.DefaultGeographicBoundingBox#isEmpty()
+     */
+    public boolean isEmpty() {
+        return Pruner.isEmpty(this, false);
+    }
+
+    /**
+     * Removes all references to empty properties. The default implementation iterates over all
+     * {@linkplain ValueExistencePolicy#NON_NULL non null} properties, and sets to {@code null}
+     * the properties for which {@link #isEmpty()} returned {@code true}.
+     *
+     * @throws UnmodifiableMetadataException If this metadata is not modifiable.
+     */
+    public void prune() {
+        Pruner.isEmpty(this, true);
+    }
+
+    /**
+     * Copies the values from the specified metadata. The {@code source} metadata must implements
+     * the same metadata interface (defined by the {@linkplain #getStandard() standard}) than this
+     * class, but doesn't need to be the same implementation class.
+     * The default implementation performs the copy using Java reflections.
+     *
+     * {@note This method is intended to provide the functionality of a <cite>copy constructor</cite>.
+     * We do not provide copy constructor directly because usage of Java reflection in this context
+     * is unsafe (we could invoke subclass methods before the subclasses construction is completed).}
+     *
+     * @param  source The metadata to copy values from.
+     * @throws ClassCastException if the specified metadata doesn't implements the expected
+     *         metadata interface.
+     * @throws UnmodifiableMetadataException if this class doesn't define {@code set*(…)} methods
+     *         corresponding to the {@code get*()} methods found in the implemented interface, or
+     *         if this instance is not modifiable for some other reason.
+     */
+    public void shallowCopy(final Object source) throws ClassCastException, UnmodifiableMetadataException {
+        ensureNonNull("source", source);
+        getStandard().shallowCopy(source, this);
+    }
+
+    /**
+     * Returns a view of the property values in a {@link Map}. The map is backed by this metadata
+     * object, so changes in the underlying metadata object are immediately reflected in the map
+     * and conversely.
+     *
+     * <p>The map supports the {@link Map#put(Object, Object) put(…)} and {@link Map#remove(Object)
+     * remove(…)} operations if the underlying metadata object contains setter methods.
+     * The keys are case-insensitive and can be either the JavaBeans property name or
+     * the UML identifier.</p>
+     *
+     * <p>The default implementation is equivalent to the following method call:</p>
+     * {@preformat java
+     *   return getStandard().asMap(this, KeyNamePolicy.JAVABEANS_PROPERTY, ValueExistencePolicy.NON_EMPTY);
+     * }
+     *
+     * @return A view of this metadata object as a map.
+     *
+     * @see MetadataStandard#asMap(Object, KeyNamePolicy, ValueExistencePolicy)
+     */
+    public synchronized Map<String,Object> asMap() {
+        if (asMap == null) {
+            asMap = getStandard().asMap(this, KeyNamePolicy.JAVABEANS_PROPERTY, ValueExistencePolicy.NON_EMPTY);
+        }
+        return asMap;
+    }
+
+    /**
+     * Returns the property types and values as a tree table.
+     * In the current implementation, the tree is not live (i.e. changes in metadata are not
+     * reflected in the tree). However it may be improved in a future SIS implementation.
+     *
+     * @return The property types and values as a tree table.
+     */
+    public TreeTable asTreeTable() {
+        return getStandard().asTreeTable(this);
+    }
+
+    /**
      * Compares this metadata with the specified object for equality. The default
      * implementation uses Java reflection. Subclasses may override this method
      * for better performances, or for comparing "hidden" properties not specified
@@ -158,10 +279,9 @@ public abstract class AbstractMetadata i
      * similar contract than {@link java.util.Set#hashCode()} and ensures that the hash code
      * value is insensitive to the ordering of properties.
      *
-     * {@section Performance note}
-     * This method does not cache the value because current implementation has no notification
-     * mechanism for tracking changes in children properties. If this metadata is known to be
-     * immutable, then subclasses may consider caching the hash code value at their choice.
+     * {@note This method does not cache the value because current implementation has no notification
+     *        mechanism for tracking changes in children properties. If this metadata is known to be
+     *        immutable, then subclasses may consider caching the hash code value at their choice.}
      *
      * @see MetadataStandard#hashCode(Object)
      */
@@ -169,4 +289,20 @@ public abstract class AbstractMetadata i
     public int hashCode() {
         return getStandard().hashCode(this);
     }
+
+    /**
+     * Returns a string representation of this metadata.
+     * The default implementation is as below:
+     *
+     * {@preformat java
+     *     return asTreeTable().toString();
+     * }
+     *
+     * Note that this make extensive use of Unicode characters
+     * and is better rendered with a monospaced font.
+     */
+    @Override
+    public String toString() {
+        return asTreeTable().toString();
+    }
 }

Modified: sis/branches/JDK6/sis-metadata/src/main/java/org/apache/sis/metadata/MetadataStandard.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/sis-metadata/src/main/java/org/apache/sis/metadata/MetadataStandard.java?rev=1457600&r1=1457599&r2=1457600&view=diff
==============================================================================
--- sis/branches/JDK6/sis-metadata/src/main/java/org/apache/sis/metadata/MetadataStandard.java [UTF-8] (original)
+++ sis/branches/JDK6/sis-metadata/src/main/java/org/apache/sis/metadata/MetadataStandard.java [UTF-8] Sun Mar 17 23:50:02 2013
@@ -27,6 +27,7 @@ import org.opengis.metadata.citation.Cit
 import org.apache.sis.util.Classes;
 import org.apache.sis.util.ComparisonMode;
 import org.apache.sis.util.resources.Errors;
+import org.apache.sis.util.collection.TreeTable;
 import org.apache.sis.internal.util.SystemListener;
 
 import static org.apache.sis.util.ArgumentChecks.ensureNonNull;
@@ -419,6 +420,56 @@ public class MetadataStandard {
     }
 
     /**
+     * Returns a view of the specified metadata object as a {@link Map}.
+     * The map is backed by the metadata object using Java reflection, so changes in the
+     * underlying metadata object are immediately reflected in the map and conversely.
+     *
+     * <p>The map content is determined by the arguments: {@code metadata} determines the set of
+     * keys, {@code keyPolicy} determines their {@code String} representations of those keys and
+     * {@code valuePolicy} determines whether entries having a null value or an empty collection
+     * shall be included in the map.</p>
+     *
+     * <p>The map supports the {@link Map#put(Object, Object) put(…)} and {@link Map#remove(Object)
+     * remove(…)} operations if the underlying metadata object contains setter methods.
+     * The keys are case-insensitive and can be either the JavaBeans property name or
+     * the UML identifier.</p>
+     *
+     * @param  metadata The metadata object to view as a map.
+     * @param  keyPolicy Determines the string representation of map keys.
+     * @param  valuePolicy Whether the entries having null value or empty collection shall be
+     *         included in the map.
+     * @return A map view over the metadata object.
+     * @throws ClassCastException if the metadata object doesn't implement a metadata
+     *         interface of the expected package.
+     *
+     * @see AbstractMetadata#asMap()
+     */
+    public Map<String,Object> asMap(final Object metadata, final KeyNamePolicy keyPolicy,
+            final ValueExistencePolicy valuePolicy) throws ClassCastException
+    {
+        ensureNonNull("metadata",    metadata);
+        ensureNonNull("keyPolicy",   keyPolicy);
+        ensureNonNull("valuePolicy", valuePolicy);
+        return new PropertyMap(metadata, getAccessor(metadata.getClass(), true), keyPolicy, valuePolicy);
+    }
+
+    /**
+     * Returns the specified metadata object as a tree table.
+     * In the current implementation, the tree is not live (i.e. changes in metadata are not
+     * reflected in the tree). However it may be improved in a future SIS implementation.
+     *
+     * @param  metadata The metadata object to formats as a tree table.
+     * @return A tree table representation of the specified metadata.
+     * @throws ClassCastException if the metadata object doesn't implement a metadata
+     *         interface of the expected package.
+     *
+     * @see AbstractMetadata#asTreeTable()
+     */
+    public TreeTable asTreeTable(final Object metadata) throws ClassCastException {
+        throw new UnsupportedOperationException("Not yet implemented"); // TODO
+    }
+
+    /**
      * Replaces every properties in the specified metadata by their
      * {@linkplain ModifiableMetadata#unmodifiable() unmodifiable variant}.
      *

Modified: sis/branches/JDK6/sis-metadata/src/main/java/org/apache/sis/metadata/ModifiableMetadata.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/sis-metadata/src/main/java/org/apache/sis/metadata/ModifiableMetadata.java?rev=1457600&r1=1457599&r2=1457600&view=diff
==============================================================================
--- sis/branches/JDK6/sis-metadata/src/main/java/org/apache/sis/metadata/ModifiableMetadata.java [UTF-8] (original)
+++ sis/branches/JDK6/sis-metadata/src/main/java/org/apache/sis/metadata/ModifiableMetadata.java [UTF-8] Sun Mar 17 23:50:02 2013
@@ -35,13 +35,9 @@ import static org.apache.sis.util.collec
 
 
 /**
- * Base class for metadata that may (or may not) be modifiable. Implementations will typically
- * provide {@code set*(...)} methods for each corresponding {@code get*()} method. An initially
- * modifiable metadata may become unmodifiable at a later stage (typically after its construction
- * is completed) by the call to the {@link #freeze()} method.
- *
- * {@section Guidline for implementors}
- * Subclasses should follow the pattern below for every {@code get} and {@code set} methods,
+ * Provides convenience methods for support of modifiable properties in metadata implementations.
+ * Implementations typically provide {@code set*(…)} methods for each corresponding {@code get*()}
+ * method. Subclasses can follow the pattern below for every {@code get} and {@code set} methods,
  * with a different processing for singleton value or for {@linkplain Collection collections}.
  *
  * <p>For singleton value:</p>
@@ -77,6 +73,10 @@ import static org.apache.sis.util.collec
  *     }
  * }
  *
+ * An initially modifiable metadata may become unmodifiable at a later stage
+ * (typically after its construction is completed) by the call to the
+ * {@link #freeze()} method.
+ *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.3 (derived from geotk-2.1)
  * @version 0.3
@@ -600,15 +600,13 @@ public abstract class ModifiableMetadata
 
     /**
      * Returns a shallow copy of this metadata.
-     *
-     * {@section Usage}
-     * While {@linkplain Cloneable cloneable}, this class do not provides the {@code clone()}
+     * While {@linkplain Cloneable cloneable}, this class does not provides the {@code clone()}
      * operation as part of the public API. The clone operation is required for the internal
-     * working of the {@link #unmodifiable()} method, which needs <strong>shallow</strong>
+     * working of the {@link #unmodifiable()} method, which needs <em>shallow</em>
      * copies of metadata entities. The default {@link Object#clone()} implementation is
      * sufficient in most cases.
      *
-     * @return A <strong>shallow</strong> copy of this metadata.
+     * @return A <em>shallow</em> copy of this metadata.
      * @throws CloneNotSupportedException if the clone is not supported.
      */
     @Override

Modified: sis/branches/JDK6/sis-metadata/src/main/java/org/apache/sis/metadata/PropertyAccessor.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/sis-metadata/src/main/java/org/apache/sis/metadata/PropertyAccessor.java?rev=1457600&r1=1457599&r2=1457600&view=diff
==============================================================================
--- sis/branches/JDK6/sis-metadata/src/main/java/org/apache/sis/metadata/PropertyAccessor.java [UTF-8] (original)
+++ sis/branches/JDK6/sis-metadata/src/main/java/org/apache/sis/metadata/PropertyAccessor.java [UTF-8] Sun Mar 17 23:50:02 2013
@@ -264,11 +264,11 @@ final class PropertyAccessor {
             Method getter  = getters[i];
             String name    = getter.getName();
             final int base = prefix(name).length();
-            addMapping(names[i] = toPropertyName(name, base), index);
             addMapping(name, index);
+            addMappingWithLowerCase(names[i] = toPropertyName(name, base), index);
             final UML annotation = getter.getAnnotation(UML.class);
             if (annotation != null) {
-                addMapping(annotation.identifier(), index);
+                addMappingWithLowerCase(annotation.identifier().intern(), index);
             }
             /*
              * Now try to infer the setter from the getter. We replace the "get" prefix by
@@ -277,12 +277,12 @@ final class PropertyAccessor {
             Class<?> returnType = getter.getReturnType();
             arguments[0] = returnType;
             if (name.length() > base) {
-                final char lo = name.charAt(base);
-                final char up = Character.toUpperCase(lo);
+                final int lo = name.codePointAt(base);
+                final int up = Character.toUpperCase(lo);
                 final int length = name.length();
-                final StringBuilder buffer = new StringBuilder(length - base + 3).append(SET);
+                final StringBuilder buffer = new StringBuilder(length - base + 5).append(SET);
                 if (lo != up) {
-                    buffer.append(up).append(name, base+1, length);
+                    buffer.appendCodePoint(up).append(name, base + Character.charCount(lo), length);
                 } else {
                     buffer.append(name, base, length);
                 }
@@ -349,18 +349,24 @@ final class PropertyAccessor {
      * Adds the given (name, index) pair to {@link #mapping}, making sure we don't
      * overwrite an existing entry with different value.
      */
-    private void addMapping(String name, final Integer index) throws IllegalArgumentException {
+    private void addMapping(final String name, final Integer index) {
         if (!name.isEmpty()) {
-            String original;
-            do {
-                final Integer old = mapping.put(name, index);
-                if (old != null && !old.equals(index)) {
-                    throw new IllegalStateException(Errors.format(Errors.Keys.DuplicatedValue_1,
-                            Classes.getShortName(type) + '.' + name));
-                }
-                original = name;
-                name = CharSequences.trimWhitespaces(name.toLowerCase(Locale.ROOT));
-            } while (!name.equals(original));
+            final Integer old = mapping.put(name, index);
+            if (old != null && !old.equals(index)) {
+                throw new IllegalStateException(Errors.format(Errors.Keys.DuplicatedValue_1,
+                        Classes.getShortName(type) + '.' + name));
+            }
+        }
+    }
+
+    /**
+     * Adds the given (name, index) pair and its lower-case variant.
+     */
+    private void addMappingWithLowerCase(final String name, final Integer index) {
+        addMapping(name, index);
+        final String lower = name.toLowerCase(Locale.ROOT);
+        if (lower != name) { // Identity comparison is okay here.
+            addMapping(lower, index);
         }
     }
 
@@ -494,7 +500,7 @@ final class PropertyAccessor {
                 }
             }
         }
-        return CharSequences.trimWhitespaces(name).intern();
+        return name.intern();
     }
 
     /**
@@ -534,30 +540,17 @@ final class PropertyAccessor {
     }
 
     /**
-     * Returns the declaring class of the getter at the given index.
-     *
-     * @param  index The index of the property for which to get the declaring class.
-     * @return The declaring class at the given index, or {@code null} if the index is out of bounds.
-     */
-    final Class<?> getDeclaringClass(final int index) {
-        if (index >= 0 && index < names.length) {
-            return getters[index].getDeclaringClass();
-        }
-        return null;
-    }
-
-    /**
      * Returns the name of the property at the given index, or {@code null} if none.
      *
      * @param  index The index of the property for which to get the name.
-     * @param  keyName The kind of name to return.
+     * @param  keyPolicy The kind of name to return.
      * @return The name of the given kind at the given index,
      *         or {@code null} if the index is out of bounds.
      */
     @SuppressWarnings("fallthrough")
-    final String name(final int index, final KeyNamePolicy keyName) {
+    final String name(final int index, final KeyNamePolicy keyPolicy) {
         if (index >= 0 && index < names.length) {
-            switch (keyName) {
+            switch (keyPolicy) {
                 case UML_IDENTIFIER: {
                     final UML uml = getters[index].getAnnotation(UML.class);
                     if (uml != null) {
@@ -667,15 +660,14 @@ final class PropertyAccessor {
     }
 
     /**
-     * Returns {@code true} if the property at the given index is writable.
-     */
-    final boolean isWritable(final int index) {
-        return (index >= 0) && (index < standardCount) && (setters != null) && (setters[index] != null);
-    }
-
-    /**
      * Returns the value for the specified metadata, or {@code null} if none.
+     * If the given index is out of bounds, then this method returns {@code null},
+     * so it is safe to invoke this method even if {@link #indexOf(String, boolean)}
+     * returned -1.
      *
+     * @param  index The index of the property for which to get a value.
+     * @param  metadata The metadata object to query.
+     * @return The value, or {@code null} if none or if the given is out of bounds.
      * @throws BackingStoreException If the implementation threw a checked exception.
      */
     final Object get(final int index, final Object metadata) throws BackingStoreException {
@@ -719,6 +711,12 @@ final class PropertyAccessor {
      * a new collection or map before the new value is set, because the setter methods typically
      * copy the new collection in their existing instance.
      *
+     * <p>If the given index is out of bounds, then this method does nothing and return {@code null}.
+     * We do that because the {@link PropertyMap#remove(Object)} method may invoke this method with
+     * an index of -1 if the {@link #indexOf(String, boolean)} method didn't found the property name.
+     * However the given value will be silently discarded, so index out-of-bounds shall be used only
+     * in the context of {@code remove} operations (this is not verified).</p>
+     *
      * @param  index    The index of the property to set.
      * @param  metadata The metadata object on which to set the value.
      * @param  value    The new value.
@@ -731,7 +729,10 @@ final class PropertyAccessor {
     final Object set(final int index, final Object metadata, final Object value, final boolean getOld)
             throws UnmodifiableMetadataException, ClassCastException, BackingStoreException
     {
-        if (index >= 0 && index < standardCount && setters != null) {
+        if (index < 0 || index >= standardCount) {
+            return null;
+        }
+        if (setters != null) {
             final Method getter = getters[index];
             final Method setter = setters[index];
             if (setter != null) {
@@ -1031,7 +1032,7 @@ final class PropertyAccessor {
 
     /**
      * Replaces every properties in the specified metadata by their
-     * {@linkplain ModifiableMetadata#unmodifiable unmodifiable variant}.
+     * {@linkplain ModifiableMetadata#unmodifiable() unmodifiable variant}.
      *
      * @throws BackingStoreException If the implementation threw a checked exception.
      */
@@ -1088,6 +1089,7 @@ final class PropertyAccessor {
     /**
      * Counts the number of non-empty properties.
      *
+     * @param  max Stop the count if we reach that value.
      * @throws BackingStoreException If the implementation threw a checked exception.
      */
     public int count(final Object metadata, final int max) throws BackingStoreException {

Modified: sis/branches/JDK6/sis-metadata/src/main/java/org/apache/sis/metadata/PropertyComparator.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/sis-metadata/src/main/java/org/apache/sis/metadata/PropertyComparator.java?rev=1457600&r1=1457599&r2=1457600&view=diff
==============================================================================
--- sis/branches/JDK6/sis-metadata/src/main/java/org/apache/sis/metadata/PropertyComparator.java [UTF-8] (original)
+++ sis/branches/JDK6/sis-metadata/src/main/java/org/apache/sis/metadata/PropertyComparator.java [UTF-8] Sun Mar 17 23:50:02 2013
@@ -26,7 +26,7 @@ import org.opengis.annotation.Obligation
 
 /**
  * The comparator for sorting method order. This comparator puts mandatory methods first,
- * which is necessary for reducing the risk of ambiguity in {@link PropertyTree#parse}.
+ * which is necessary for reducing the risk of ambiguity in {@link MetadataTreeFormat#parse}.
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.3 (derived from geotk-2.4)

Modified: sis/branches/JDK6/sis-metadata/src/main/java/org/apache/sis/metadata/PropertyDescriptor.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/sis-metadata/src/main/java/org/apache/sis/metadata/PropertyDescriptor.java?rev=1457600&r1=1457599&r2=1457600&view=diff
==============================================================================
--- sis/branches/JDK6/sis-metadata/src/main/java/org/apache/sis/metadata/PropertyDescriptor.java [UTF-8] (original)
+++ sis/branches/JDK6/sis-metadata/src/main/java/org/apache/sis/metadata/PropertyDescriptor.java [UTF-8] Sun Mar 17 23:50:02 2013
@@ -35,7 +35,7 @@ import org.apache.sis.measure.ValueRange
 import org.apache.sis.util.iso.Types;
 
 // Related to JDK7
-import org.apache.sis.internal.util.Objects;
+import org.apache.sis.internal.jdk7.Objects;
 
 
 /**

Copied: sis/branches/JDK6/sis-metadata/src/main/java/org/apache/sis/metadata/PropertyMap.java (from r1457583, sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/PropertyMap.java)
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/sis-metadata/src/main/java/org/apache/sis/metadata/PropertyMap.java?p2=sis/branches/JDK6/sis-metadata/src/main/java/org/apache/sis/metadata/PropertyMap.java&p1=sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/PropertyMap.java&r1=1457583&r2=1457600&rev=1457600&view=diff
==============================================================================
--- sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/PropertyMap.java [UTF-8] (original)
+++ sis/branches/JDK6/sis-metadata/src/main/java/org/apache/sis/metadata/PropertyMap.java [UTF-8] Sun Mar 17 23:50:02 2013
@@ -23,7 +23,7 @@ import java.util.NoSuchElementException;
 import org.apache.sis.util.CharSequences;
 
 // Related to JDK7
-import java.util.Objects;
+import org.apache.sis.internal.jdk7.Objects;
 
 
 /**

Copied: sis/branches/JDK6/sis-metadata/src/main/java/org/apache/sis/metadata/Pruner.java (from r1457583, sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/Pruner.java)
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/sis-metadata/src/main/java/org/apache/sis/metadata/Pruner.java?p2=sis/branches/JDK6/sis-metadata/src/main/java/org/apache/sis/metadata/Pruner.java&p1=sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/Pruner.java&r1=1457583&r2=1457600&rev=1457600&view=diff
==============================================================================
--- sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/Pruner.java [UTF-8] (original)
+++ sis/branches/JDK6/sis-metadata/src/main/java/org/apache/sis/metadata/Pruner.java [UTF-8] Sun Mar 17 23:50:02 2013
@@ -51,7 +51,7 @@ final class Pruner extends ThreadLocal<M
      */
     @Override
     protected Map<Object,Boolean> initialValue() {
-        return new IdentityHashMap<>();
+        return new IdentityHashMap<Object,Boolean>();
     }
 
     /**

Modified: sis/branches/JDK6/sis-metadata/src/main/java/org/apache/sis/metadata/TypeValuePolicy.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/sis-metadata/src/main/java/org/apache/sis/metadata/TypeValuePolicy.java?rev=1457600&r1=1457599&r2=1457600&view=diff
==============================================================================
--- sis/branches/JDK6/sis-metadata/src/main/java/org/apache/sis/metadata/TypeValuePolicy.java [UTF-8] (original)
+++ sis/branches/JDK6/sis-metadata/src/main/java/org/apache/sis/metadata/TypeValuePolicy.java [UTF-8] Sun Mar 17 23:50:02 2013
@@ -18,9 +18,9 @@ package org.apache.sis.metadata;
 
 
 /**
- * Whatever {@link MetadataStandard#asTypeMap MetadataStandard.asTypeMap(…)} shall return values
- * for the property types, the element types (same as property types except for collections) or
- * the declaring classes.
+ * The kind of values in the {@link MetadataStandard#asTypeMap MetadataStandard.asTypeMap(…)}.
+ * This enumeration specifies whether the values shall be property types, element types (same
+ * as property types except for collections) or the declaring classes.
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.3 (derived from geotk-3.03)

Modified: sis/branches/JDK6/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/DefaultCitation.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/DefaultCitation.java?rev=1457600&r1=1457599&r2=1457600&view=diff
==============================================================================
--- sis/branches/JDK6/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/DefaultCitation.java [UTF-8] (original)
+++ sis/branches/JDK6/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/DefaultCitation.java [UTF-8] Sun Mar 17 23:50:02 2013
@@ -18,7 +18,6 @@ package org.apache.sis.metadata.iso.cita
 
 import java.util.Date;
 import java.util.Collection;
-
 import org.opengis.metadata.Identifier;
 import org.opengis.metadata.citation.Citation;
 import org.opengis.metadata.citation.CitationDate;
@@ -26,8 +25,7 @@ import org.opengis.metadata.citation.Pre
 import org.opengis.metadata.citation.ResponsibleParty;
 import org.opengis.metadata.citation.Series;
 import org.opengis.util.InternationalString;
-
-import org.apache.sis.metadata.ModifiableMetadata;
+import org.apache.sis.metadata.iso.ISOMetadata;
 
 
 /**
@@ -39,7 +37,7 @@ import org.apache.sis.metadata.Modifiabl
  * @version 0.3
  * @module
  */
-public class DefaultCitation extends ModifiableMetadata implements Citation {
+public class DefaultCitation extends ISOMetadata implements Citation {
     /**
      * Serial number for inter-operability with different versions.
      */
@@ -204,7 +202,7 @@ public class DefaultCitation extends Mod
      */
     @Override
     public Collection<Identifier> getIdentifiers() {
-        return null; // Not yet implemented on intend.
+        return java.util.Collections.emptyList(); // TODO: Not yet implemented on intend.
     }
 
     /**

Modified: sis/branches/JDK6/sis-metadata/src/test/java/org/apache/sis/metadata/PropertyDescriptorTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/sis-metadata/src/test/java/org/apache/sis/metadata/PropertyDescriptorTest.java?rev=1457600&r1=1457599&r2=1457600&view=diff
==============================================================================
--- sis/branches/JDK6/sis-metadata/src/test/java/org/apache/sis/metadata/PropertyDescriptorTest.java [UTF-8] (original)
+++ sis/branches/JDK6/sis-metadata/src/test/java/org/apache/sis/metadata/PropertyDescriptorTest.java [UTF-8] Sun Mar 17 23:50:02 2013
@@ -18,9 +18,10 @@ package org.apache.sis.metadata;
 
 import java.util.Locale;
 import org.opengis.util.InternationalString;
+import org.opengis.parameter.ParameterDescriptor;
 import org.opengis.metadata.citation.Citation;
 import org.opengis.metadata.citation.PresentationForm;
-import org.apache.sis.internal.simple.SimpleCitation;
+import org.apache.sis.metadata.iso.citation.HardCodedCitations;
 import org.apache.sis.test.TestCase;
 import org.junit.Test;
 
@@ -47,7 +48,7 @@ public final strictfp class PropertyDesc
     private static <T> PropertyDescriptor<T> create(final Class<T> elementType, final String method,
             final String property) throws NoSuchMethodException
     {
-        return new PropertyDescriptor<T>(elementType, new SimpleCitation("ISO 19115"), property,
+        return new PropertyDescriptor<T>(elementType, HardCodedCitations.ISO_19115, property,
                 Citation.class.getMethod(method));
     }
 
@@ -59,10 +60,17 @@ public final strictfp class PropertyDesc
      */
     @Test
     public void testTitle() throws NoSuchMethodException {
-        final PropertyDescriptor<?> descriptor = create(InternationalString.class, "getTitle", "title");
+        validateTitle(create(InternationalString.class, "getTitle", "title"));
+    }
+
+    /**
+     * Validates a descriptor for {@link Citation#getTitle()}.
+     * This is validation code to be shared with {@link PropertyAccessorTest#testDescriptor()}.
+     */
+    static void validateTitle(final ParameterDescriptor<?> descriptor) {
         assertEquals("ISO 19115",   descriptor.getName().getAuthority().getTitle().toString());
-        assertEquals("CI_Citation", descriptor.getCodeSpace());
-        assertEquals("title",       descriptor.getCode());
+        assertEquals("CI_Citation", descriptor.getName().getCodeSpace());
+        assertEquals("title",       descriptor.getName().getCode());
         final InternationalString remarks = descriptor.getRemarks();
         assertEquals("Name by which the cited resource is known.", remarks.toString(Locale.ENGLISH));
         // Test other locale here, if any.
@@ -80,10 +88,17 @@ public final strictfp class PropertyDesc
      */
     @Test
     public void testPresentationForm() throws NoSuchMethodException {
-        final PropertyDescriptor<?> descriptor = create(PresentationForm.class, "getPresentationForms", "presentationForm");
+        validatePresentationForm(create(PresentationForm.class, "getPresentationForms", "presentationForm"));
+    }
+
+    /**
+     * Validates a descriptor for {@link Citation#getPresentationForms()}.
+     * This is validation code to be shared with {@link PropertyAccessorTest#testDescriptor()}.
+     */
+    static void validatePresentationForm(final ParameterDescriptor<?> descriptor) {
         assertEquals("ISO 19115",        descriptor.getName().getAuthority().getTitle().toString());
-        assertEquals("CI_Citation",      descriptor.getCodeSpace());
-        assertEquals("presentationForm", descriptor.getCode());
+        assertEquals("CI_Citation",      descriptor.getName().getCodeSpace());
+        assertEquals("presentationForm", descriptor.getName().getCode());
         final InternationalString remarks = descriptor.getRemarks();
         assertEquals("Mode in which the resource is represented.", remarks.toString(Locale.ENGLISH));
         // Test other locale here, if any.

Modified: sis/branches/JDK6/sis-metadata/src/test/java/org/apache/sis/test/suite/MetadataTestSuite.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/sis-metadata/src/test/java/org/apache/sis/test/suite/MetadataTestSuite.java?rev=1457600&r1=1457599&r2=1457600&view=diff
==============================================================================
--- sis/branches/JDK6/sis-metadata/src/test/java/org/apache/sis/test/suite/MetadataTestSuite.java [UTF-8] (original)
+++ sis/branches/JDK6/sis-metadata/src/test/java/org/apache/sis/test/suite/MetadataTestSuite.java [UTF-8] Sun Mar 17 23:50:02 2013
@@ -29,7 +29,8 @@ import org.junit.runners.Suite;
  * @module
  */
 @Suite.SuiteClasses({
-    org.apache.sis.metadata.PropertyDescriptorTest.class
+    org.apache.sis.metadata.PropertyDescriptorTest.class,
+    org.apache.sis.metadata.PropertyAccessorTest.class
 })
 public final strictfp class MetadataTestSuite extends TestSuite {
 }

Modified: sis/branches/JDK6/sis-referencing/src/main/java/org/apache/sis/geometry/AbstractDirectPosition.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/sis-referencing/src/main/java/org/apache/sis/geometry/AbstractDirectPosition.java?rev=1457600&r1=1457599&r2=1457600&view=diff
==============================================================================
--- sis/branches/JDK6/sis-referencing/src/main/java/org/apache/sis/geometry/AbstractDirectPosition.java [UTF-8] (original)
+++ sis/branches/JDK6/sis-referencing/src/main/java/org/apache/sis/geometry/AbstractDirectPosition.java [UTF-8] Sun Mar 17 23:50:02 2013
@@ -39,7 +39,7 @@ import static org.apache.sis.util.String
 import static org.apache.sis.util.ArgumentChecks.ensureDimensionMatches;
 
 // Related to JDK7
-import org.apache.sis.internal.util.Objects;
+import org.apache.sis.internal.jdk7.Objects;
 
 
 /**

Modified: sis/branches/JDK6/sis-referencing/src/main/java/org/apache/sis/geometry/AbstractEnvelope.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/sis-referencing/src/main/java/org/apache/sis/geometry/AbstractEnvelope.java?rev=1457600&r1=1457599&r2=1457600&view=diff
==============================================================================
--- sis/branches/JDK6/sis-referencing/src/main/java/org/apache/sis/geometry/AbstractEnvelope.java [UTF-8] (original)
+++ sis/branches/JDK6/sis-referencing/src/main/java/org/apache/sis/geometry/AbstractEnvelope.java [UTF-8] Sun Mar 17 23:50:02 2013
@@ -47,7 +47,7 @@ import static org.apache.sis.math.MathFu
 import static org.apache.sis.math.MathFunctions.isPositive;
 
 // Related to JDK7
-import org.apache.sis.internal.util.Objects;
+import org.apache.sis.internal.jdk7.Objects;
 
 
 /**
@@ -939,7 +939,7 @@ public abstract class AbstractEnvelope i
      * @param  isSimplePrecision {@code true} if every lower and upper corner values can be casted to {@code float}.
      * @return The envelope as a {@code BOX2D} or {@code BOX3D} (most typical dimensions) in WKT format.
      *
-     * @see GeneralEnvelope#GeneralEnvelope(String)
+     * @see GeneralEnvelope#GeneralEnvelope(CharSequence)
      * @see org.apache.sis.measure.CoordinateFormat
      * @see org.apache.sis.io.wkt
      */

Modified: sis/branches/JDK6/sis-referencing/src/main/java/org/apache/sis/geometry/ArrayEnvelope.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/sis-referencing/src/main/java/org/apache/sis/geometry/ArrayEnvelope.java?rev=1457600&r1=1457599&r2=1457600&view=diff
==============================================================================
--- sis/branches/JDK6/sis-referencing/src/main/java/org/apache/sis/geometry/ArrayEnvelope.java [UTF-8] (original)
+++ sis/branches/JDK6/sis-referencing/src/main/java/org/apache/sis/geometry/ArrayEnvelope.java [UTF-8] Sun Mar 17 23:50:02 2013
@@ -41,7 +41,7 @@ import static org.apache.sis.math.MathFu
 import static org.apache.sis.internal.referencing.Utilities.isPoleToPole;
 
 // Related to JDK7
-import org.apache.sis.internal.util.Objects;
+import org.apache.sis.internal.jdk7.Objects;
 
 
 /**
@@ -195,7 +195,7 @@ class ArrayEnvelope extends AbstractEnve
      * }
      *
      * However this constructor is lenient to other geometry types like {@code POLYGON}.
-     * See the javadoc of the {@link GeneralEnvelope#GeneralEnvelope(String) GeneralEnvelope}
+     * See the javadoc of the {@link GeneralEnvelope#GeneralEnvelope(CharSequence) GeneralEnvelope}
      * constructor for more information.
      *
      * @param  wkt The {@code BOX}, {@code POLYGON} or other kind of element to parse.

Modified: sis/branches/JDK6/sis-referencing/src/main/java/org/apache/sis/geometry/DirectPosition2D.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/sis-referencing/src/main/java/org/apache/sis/geometry/DirectPosition2D.java?rev=1457600&r1=1457599&r2=1457600&view=diff
==============================================================================
--- sis/branches/JDK6/sis-referencing/src/main/java/org/apache/sis/geometry/DirectPosition2D.java [UTF-8] (original)
+++ sis/branches/JDK6/sis-referencing/src/main/java/org/apache/sis/geometry/DirectPosition2D.java [UTF-8] Sun Mar 17 23:50:02 2013
@@ -28,7 +28,7 @@ import static org.apache.sis.util.Argume
 import static org.apache.sis.util.ArgumentChecks.ensureDimensionMatches;
 
 // Related to JDK7
-import org.apache.sis.internal.util.Objects;
+import org.apache.sis.internal.jdk7.Objects;
 
 
 /**

Modified: sis/branches/JDK6/sis-referencing/src/main/java/org/apache/sis/geometry/Envelope2D.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/sis-referencing/src/main/java/org/apache/sis/geometry/Envelope2D.java?rev=1457600&r1=1457599&r2=1457600&view=diff
==============================================================================
--- sis/branches/JDK6/sis-referencing/src/main/java/org/apache/sis/geometry/Envelope2D.java [UTF-8] (original)
+++ sis/branches/JDK6/sis-referencing/src/main/java/org/apache/sis/geometry/Envelope2D.java [UTF-8] Sun Mar 17 23:50:02 2013
@@ -50,7 +50,7 @@ import static org.apache.sis.geometry.Ab
 import static org.apache.sis.geometry.AbstractEnvelope.isNegativeUnsafe;
 
 // Related to JDK7
-import org.apache.sis.internal.util.Objects;
+import org.apache.sis.internal.jdk7.Objects;
 
 
 /**

Modified: sis/branches/JDK6/sis-referencing/src/main/java/org/apache/sis/geometry/GeneralDirectPosition.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/sis-referencing/src/main/java/org/apache/sis/geometry/GeneralDirectPosition.java?rev=1457600&r1=1457599&r2=1457600&view=diff
==============================================================================
--- sis/branches/JDK6/sis-referencing/src/main/java/org/apache/sis/geometry/GeneralDirectPosition.java [UTF-8] (original)
+++ sis/branches/JDK6/sis-referencing/src/main/java/org/apache/sis/geometry/GeneralDirectPosition.java [UTF-8] Sun Mar 17 23:50:02 2013
@@ -32,7 +32,7 @@ import org.apache.sis.util.resources.Err
 import static org.apache.sis.util.ArgumentChecks.ensureDimensionMatches;
 
 // JDK7 related
-import org.apache.sis.internal.util.Objects;
+import org.apache.sis.internal.jdk7.Objects;
 
 
 /**

Modified: sis/branches/JDK6/sis-referencing/src/main/java/org/apache/sis/geometry/ImmutableEnvelope.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/sis-referencing/src/main/java/org/apache/sis/geometry/ImmutableEnvelope.java?rev=1457600&r1=1457599&r2=1457600&view=diff
==============================================================================
--- sis/branches/JDK6/sis-referencing/src/main/java/org/apache/sis/geometry/ImmutableEnvelope.java [UTF-8] (original)
+++ sis/branches/JDK6/sis-referencing/src/main/java/org/apache/sis/geometry/ImmutableEnvelope.java [UTF-8] Sun Mar 17 23:50:02 2013
@@ -139,7 +139,7 @@ public final class ImmutableEnvelope ext
      * }
      *
      * However this constructor is lenient to other geometry types like {@code POLYGON}.
-     * See the javadoc of the {@link GeneralEnvelope#GeneralEnvelope(String) GeneralEnvelope}
+     * See the javadoc of the {@link GeneralEnvelope#GeneralEnvelope(CharSequence) GeneralEnvelope}
      * constructor for more information.
      *
      * @param  wkt The {@code BOX}, {@code POLYGON} or other kind of element to parse.

Modified: sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/internal/converter/ClassPair.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/internal/converter/ClassPair.java?rev=1457600&r1=1457583&r2=1457600&view=diff
==============================================================================
--- sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/internal/converter/ClassPair.java [UTF-8] (original)
+++ sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/internal/converter/ClassPair.java [UTF-8] Sun Mar 17 23:50:02 2013
@@ -98,7 +98,7 @@ class ClassPair<S,T> implements Serializ
                 return null;
             }
         }
-        return new ClassPair<>(source, targetClass);
+        return new ClassPair(source, targetClass); // Checked in JDK7 branch.
     }
 
     /**

Modified: sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/internal/converter/CollectionConverter.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/internal/converter/CollectionConverter.java?rev=1457600&r1=1457583&r2=1457600&view=diff
==============================================================================
--- sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/internal/converter/CollectionConverter.java [UTF-8] (original)
+++ sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/internal/converter/CollectionConverter.java [UTF-8] Sun Mar 17 23:50:02 2013
@@ -76,7 +76,7 @@ abstract class CollectionConverter<T> ex
             if (source instanceof java.util.List<?>) {
                 return (java.util.List<?>) source;
             }
-            return new ArrayList<>(source);
+            return new ArrayList(source); // Checked in JDK7 branch.
         }
     }
 
@@ -100,7 +100,7 @@ abstract class CollectionConverter<T> ex
             if (source instanceof java.util.Set<?>) {
                 return (java.util.Set<?>) source;
             }
-            return new LinkedHashSet<>(source);
+            return new LinkedHashSet(source); // Checked in JDK7 branch.
         }
     }
 }

Modified: sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/internal/converter/ConverterRegistry.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/internal/converter/ConverterRegistry.java?rev=1457600&r1=1457583&r2=1457600&view=diff
==============================================================================
--- sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/internal/converter/ConverterRegistry.java [UTF-8] (original)
+++ sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/internal/converter/ConverterRegistry.java [UTF-8] Sun Mar 17 23:50:02 2013
@@ -82,7 +82,7 @@ public class ConverterRegistry {
      * Creates an initially empty set of object converters.
      */
     public ConverterRegistry() {
-        converters = new LinkedHashMap<>();
+        converters = new LinkedHashMap<ClassPair<?,?>, ObjectConverter<?,?>>();
     }
 
     /**
@@ -271,7 +271,7 @@ public class ConverterRegistry {
                 initialize();
             }
             for (Class<? super T> i=targetClass; i!=null && i!=stopAt; i=i.getSuperclass()) {
-                register(new ClassPair<>(sourceClass, i), converter);
+                register(new ClassPair(sourceClass, i), converter); // Checked in the JDK7 branch.
             }
             /*
              * At this point, the given class and parent classes have been registered.
@@ -315,7 +315,7 @@ public class ConverterRegistry {
                     continue;
                 }
                 if (!i.isAssignableFrom(sourceClass)) {
-                    register(new ClassPair<>(sourceClass, i), converter);
+                    register(new ClassPair(sourceClass, i), converter); // Checked in the JDK7 branch.
                 }
             }
         }
@@ -436,7 +436,7 @@ public class ConverterRegistry {
     public <S,T> ObjectConverter<? super S, ? extends T> find(final Class<S> sourceClass, final Class<T> targetClass)
             throws UnconvertibleObjectException
     {
-        final ClassPair<S,T> key = new ClassPair<>(sourceClass, targetClass);
+        final ClassPair<S,T> key = new ClassPair<S,T>(sourceClass, targetClass);
         synchronized (converters) {
             ObjectConverter<? super S, ? extends T> converter = get(key);
             if (converter != null) {

Modified: sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/internal/converter/DateConverter.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/internal/converter/DateConverter.java?rev=1457600&r1=1457583&r2=1457600&view=diff
==============================================================================
--- sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/internal/converter/DateConverter.java [UTF-8] (original)
+++ sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/internal/converter/DateConverter.java [UTF-8] Sun Mar 17 23:50:02 2013
@@ -140,7 +140,7 @@ abstract class DateConverter<T> extends 
 
         public SQL() { // Instantiated by ServiceLoader.
             super(java.sql.Date.class);
-            inverse = new IdentityConverter<>(targetClass, Date.class, this);
+            inverse = new IdentityConverter<Date, java.sql.Date>(targetClass, Date.class, this); // <T,S> in reverse order.
         }
 
         @Override public java.sql.Date convert(final Date source) {
@@ -160,7 +160,7 @@ abstract class DateConverter<T> extends 
 
         public Timestamp() { // Instantiated by ServiceLoader.
             super(java.sql.Timestamp.class);
-            inverse = new IdentityConverter<>(targetClass, Date.class, this);
+            inverse = new IdentityConverter<Date, java.sql.Timestamp>(targetClass, Date.class, this); // <T,S> in reverse order.
         }
 
         @Override public java.sql.Timestamp convert(final Date source) {

Modified: sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/internal/converter/FallbackConverter.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/internal/converter/FallbackConverter.java?rev=1457600&r1=1457583&r2=1457600&view=diff
==============================================================================
--- sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/internal/converter/FallbackConverter.java [UTF-8] (original)
+++ sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/internal/converter/FallbackConverter.java [UTF-8] Sun Mar 17 23:50:02 2013
@@ -246,7 +246,7 @@ final class FallbackConverter<S,T> exten
             /*
              * Both 'branch' and 'checked' are ordinary converters (not FallbackConverter).
              */
-            return new FallbackConverter<>(branch.getSourceClass(), targetClass, branch, checked);
+            return new FallbackConverter<S,T>(branch.getSourceClass(), targetClass, branch, checked);
         }
     }
 
@@ -289,7 +289,7 @@ final class FallbackConverter<S,T> exten
                 return null;
             }
         }
-        return new FallbackConverter<>(sourceClass, targetClass, newPrimary, newFallback);
+        return new FallbackConverter<S,T>(sourceClass, targetClass, newPrimary, newFallback);
     }
 
     /**
@@ -318,7 +318,7 @@ final class FallbackConverter<S,T> exten
             try {
                 return fallback.convert(source);
             } catch (UnconvertibleObjectException failure) {
-                exception.addSuppressed(failure);
+                // addSuppressed(failure) on the JDK7 branch.
                 throw exception;
             }
         }

Modified: sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/internal/converter/IdentityConverter.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/internal/converter/IdentityConverter.java?rev=1457600&r1=1457583&r2=1457600&view=diff
==============================================================================
--- sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/internal/converter/IdentityConverter.java [UTF-8] (original)
+++ sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/internal/converter/IdentityConverter.java [UTF-8] Sun Mar 17 23:50:02 2013
@@ -37,7 +37,10 @@ import org.apache.sis.math.FunctionPrope
  * @see org.apache.sis.util.ObjectConverters#identity(Class)
  */
 @Immutable
-public final class IdentityConverter<S extends T, T> extends SystemConverter<S,T> {
+public final class IdentityConverter<T, S extends T> extends SystemConverter<S,T> {
+    // JDK6 NOTE: Order of above <T> and <S> parameters is reversed compared to the
+    // JDK7 branch, because the JDK6 compiler does not supports forward reference.
+
     /**
      * For cross-version compatibility.
      */

Modified: sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/internal/converter/StringConverter.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/internal/converter/StringConverter.java?rev=1457600&r1=1457583&r2=1457600&view=diff
==============================================================================
--- sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/internal/converter/StringConverter.java [UTF-8] (original)
+++ sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/internal/converter/StringConverter.java [UTF-8] Sun Mar 17 23:50:02 2013
@@ -21,7 +21,6 @@ import java.util.EnumSet;
 import java.nio.charset.UnsupportedCharsetException;
 import java.net.URISyntaxException;
 import java.net.MalformedURLException;
-import java.nio.file.InvalidPathException;
 import net.jcip.annotations.Immutable;
 
 import org.apache.sis.math.FunctionProperty;
@@ -92,7 +91,7 @@ abstract class StringConverter<T> extend
      * To be overridden by classes which need a specialized instance.
      */
     ObjectConverter<T, String> createInverse() {
-        return new ObjectToString<>(targetClass, this);
+        return new ObjectToString<T>(targetClass, this);
     }
 
     /**
@@ -237,10 +236,10 @@ abstract class StringConverter<T> extend
 
         /** See {@link StringConverter} for the conversion table. */
         @Override java.lang.Boolean doConvert(final String source) throws UnconvertibleObjectException {
-            switch (source.toLowerCase(java.util.Locale.ROOT)) {
-                case "true":  case "yes": case "on":  case "1": return java.lang.Boolean.TRUE;
-                case "false": case "no":  case "off": case "0": return java.lang.Boolean.FALSE;
-            }
+            // "String in switch" in the JDK7 branch.
+            final String lower = source.toLowerCase(java.util.Locale.US);
+            if (lower.equals("true")  || lower.equals("yes") || lower.equals("on")  || lower.equals("1")) return java.lang.Boolean.TRUE;
+            if (lower.equals("false") || lower.equals("no")  || lower.equals("off") || lower.equals("0")) return java.lang.Boolean.FALSE;
             throw new UnconvertibleObjectException(formatErrorMessage(source));
         }
     }
@@ -272,15 +271,6 @@ abstract class StringConverter<T> extend
         }
     }
 
-    public static final class Path extends StringConverter<java.nio.file.Path> {
-        private static final long serialVersionUID = -5227120925547132828L;
-        public Path() {super(java.nio.file.Path.class);} // Instantiated by ServiceLoader.
-
-        @Override java.nio.file.Path doConvert(String source) throws InvalidPathException {
-            return java.nio.file.Paths.get(source);
-        }
-    }
-
     public static final class URI extends StringConverter<java.net.URI> {
         private static final long serialVersionUID = -2804405634789179706L;
         public URI() {super(java.net.URI.class);} // Instantiated by ServiceLoader.
@@ -351,7 +341,7 @@ abstract class StringConverter<T> extend
 
         /** Invoked by the constructor for creating the inverse converter. */
         @Override ObjectConverter<T, String> createInverse() {
-            return new ObjectToString.CodeList<>(targetClass, this);
+            return new ObjectToString.CodeList<T>(targetClass, this);
         }
     }
 }

Modified: sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/internal/converter/SystemRegistry.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/internal/converter/SystemRegistry.java?rev=1457600&r1=1457583&r2=1457600&view=diff
==============================================================================
--- sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/internal/converter/SystemRegistry.java [UTF-8] (original)
+++ sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/internal/converter/SystemRegistry.java [UTF-8] Sun Mar 17 23:50:02 2013
@@ -175,7 +175,7 @@ public final class SystemRegistry extend
          * CharSequence or Object), otherwise this converter would apply useless toString().
          */
         if (sourceClass == CharSequence.class) {
-            return (ObjectConverter<S,T>) new CharSequenceConverter<>(
+            return (ObjectConverter<S,T>) new CharSequenceConverter<T>( // More checks in JDK7 branch.
                     targetClass, find(String.class, targetClass));
         }
         /*
@@ -183,7 +183,7 @@ public final class SystemRegistry extend
          */
         if (sourceClass == String.class) {
             if (CodeList.class.isAssignableFrom(targetClass)) {
-                return (ObjectConverter<S,T>) new StringConverter.CodeList<>(
+                return (ObjectConverter<S,T>) new StringConverter.CodeList( // More checks in JDK7 branch.
                         targetClass.asSubclass(CodeList.class));
             }
         }
@@ -192,12 +192,12 @@ public final class SystemRegistry extend
          */
         if (sourceClass == Number.class || isSupportedNumber(sourceClass)) {
             if (isSupportedNumber(targetClass)) {
-                return (ObjectConverter<S,T>) new NumberConverter<>(
+                return (ObjectConverter<S,T>) new NumberConverter( // More checks in JDK7 branch.
                         sourceClass.asSubclass(Number.class),
                         targetClass.asSubclass(Number.class));
             }
             if (targetClass == Comparable.class) {
-                return (ObjectConverter<S,T>) new NumberConverter.Comparable<>(
+                return (ObjectConverter<S,T>) new NumberConverter.Comparable( // More checks in JDK7 branch.
                         sourceClass.asSubclass(Number.class));
             }
         }
@@ -205,7 +205,7 @@ public final class SystemRegistry extend
          * From various objects to String.
          */
         if (targetClass == String.class) {
-            return (ObjectConverter<S,T>) new ObjectToString<>(sourceClass, null);
+            return (ObjectConverter<S,T>) new ObjectToString<S>(sourceClass, null);
         }
         return null;
     }

Modified: sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/internal/jaxb/IdentifierMapAdapter.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/internal/jaxb/IdentifierMapAdapter.java?rev=1457600&r1=1457599&r2=1457600&view=diff
==============================================================================
--- sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/internal/jaxb/IdentifierMapAdapter.java [UTF-8] (original)
+++ sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/internal/jaxb/IdentifierMapAdapter.java [UTF-8] Sun Mar 17 23:50:02 2013
@@ -34,7 +34,7 @@ import org.apache.sis.xml.IdentifierSpac
 import static org.apache.sis.util.collection.CollectionsExt.hashMapCapacity;
 
 // Related to JDK7
-import org.apache.sis.internal.util.Objects;
+import org.apache.sis.internal.jdk7.Objects;
 
 
 /**

Modified: sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/internal/jaxb/IdentifierMapWithSpecialCases.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/internal/jaxb/IdentifierMapWithSpecialCases.java?rev=1457600&r1=1457599&r2=1457600&view=diff
==============================================================================
--- sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/internal/jaxb/IdentifierMapWithSpecialCases.java [UTF-8] (original)
+++ sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/internal/jaxb/IdentifierMapWithSpecialCases.java [UTF-8] Sun Mar 17 23:50:02 2013
@@ -25,7 +25,7 @@ import org.apache.sis.xml.IdentifierSpac
 import org.apache.sis.xml.XLink;
 
 // Related to JDK7
-import org.apache.sis.internal.util.Objects;
+import org.apache.sis.internal.jdk7.Objects;
 
 
 /**

Modified: sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/internal/jaxb/SpecializedIdentifier.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/internal/jaxb/SpecializedIdentifier.java?rev=1457600&r1=1457599&r2=1457600&view=diff
==============================================================================
--- sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/internal/jaxb/SpecializedIdentifier.java [UTF-8] (original)
+++ sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/internal/jaxb/SpecializedIdentifier.java [UTF-8] Sun Mar 17 23:50:02 2013
@@ -29,7 +29,7 @@ import org.apache.sis.util.logging.Loggi
 import org.apache.sis.internal.util.Citations;
 
 // Related to JDK7
-import org.apache.sis.internal.util.Objects;
+import org.apache.sis.internal.jdk7.Objects;
 
 
 /**

Modified: sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gmd/LocalisedCharacterString.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gmd/LocalisedCharacterString.java?rev=1457600&r1=1457599&r2=1457600&view=diff
==============================================================================
--- sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gmd/LocalisedCharacterString.java [UTF-8] (original)
+++ sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gmd/LocalisedCharacterString.java [UTF-8] Sun Mar 17 23:50:02 2013
@@ -22,7 +22,7 @@ import javax.xml.bind.annotation.XmlAttr
 import org.apache.sis.internal.jaxb.MarshalContext;
 
 // Related to JDK7
-import org.apache.sis.internal.util.Objects;
+import org.apache.sis.internal.jdk7.Objects;
 
 
 /**

Modified: sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gmd/TextGroup.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gmd/TextGroup.java?rev=1457600&r1=1457599&r2=1457600&view=diff
==============================================================================
--- sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gmd/TextGroup.java [UTF-8] (original)
+++ sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gmd/TextGroup.java [UTF-8] Sun Mar 17 23:50:02 2013
@@ -20,7 +20,7 @@ import java.util.Locale;
 import javax.xml.bind.annotation.XmlElement;
 
 // Related to JDK7
-import org.apache.sis.internal.util.JDK7;
+import org.apache.sis.internal.jdk7.JDK7;
 
 
 /**

Modified: sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gmx/Anchor.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gmx/Anchor.java?rev=1457600&r1=1457599&r2=1457600&view=diff
==============================================================================
--- sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gmx/Anchor.java [UTF-8] (original)
+++ sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gmx/Anchor.java [UTF-8] Sun Mar 17 23:50:02 2013
@@ -24,7 +24,7 @@ import org.opengis.util.InternationalStr
 import org.apache.sis.xml.XLink;
 
 // Related to JDK7
-import org.apache.sis.internal.util.Objects;
+import org.apache.sis.internal.jdk7.Objects;
 
 
 /**

Copied: sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/internal/jdk7/JDK7.java (from r1457583, sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/internal/util/JDK7.java)
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/internal/jdk7/JDK7.java?p2=sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/internal/jdk7/JDK7.java&p1=sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/internal/util/JDK7.java&r1=1457583&r2=1457600&rev=1457600&view=diff
==============================================================================
--- sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/internal/util/JDK7.java (original)
+++ sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/internal/jdk7/JDK7.java Sun Mar 17 23:50:02 2013
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.sis.internal.util;
+package org.apache.sis.internal.jdk7;
 
 
 /**

Copied: sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/internal/jdk7/Objects.java (from r1457583, sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/internal/util/Objects.java)
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/internal/jdk7/Objects.java?p2=sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/internal/jdk7/Objects.java&p1=sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/internal/util/Objects.java&r1=1457583&r2=1457600&rev=1457600&view=diff
==============================================================================
--- sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/internal/util/Objects.java (original)
+++ sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/internal/jdk7/Objects.java Sun Mar 17 23:50:02 2013
@@ -14,14 +14,14 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.sis.internal.util;
+package org.apache.sis.internal.jdk7;
 
 import java.util.Arrays;
 
 
 /**
- * Place holder for {@link java.util.Objects}. This class will be deleted when we will be allowed
- * to compile for JDK7.
+ * Place holder for {@link java.util.Objects}.
+ * This class will be deleted when we will be allowed to compile for JDK7.
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.3 (derived from GeoAPI)

Added: sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/internal/jdk7/StandardCharsets.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/internal/jdk7/StandardCharsets.java?rev=1457600&view=auto
==============================================================================
--- sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/internal/jdk7/StandardCharsets.java (added)
+++ sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/internal/jdk7/StandardCharsets.java [UTF-8] Sun Mar 17 23:50:02 2013
@@ -0,0 +1,42 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sis.internal.jdk7;
+
+import java.nio.charset.Charset;
+
+
+/**
+ * Place holder for {@link java.nio.charset.StandardCharsets}.
+ * This class will be deleted when we will be allowed to compile for JDK7.
+ *
+ * @author  Martin Desruisseaux (Geomatys)
+ * @since   0.3 (derived from GeoAPI)
+ * @version 0.3
+ * @module
+ */
+public final class StandardCharsets {
+    /**
+     * Do not allow instantiation of this class.
+     */
+    private StandardCharsets() {
+    }
+
+    /**
+     * Eight-bit UCS Transformation Format.
+     */
+    public static final Charset UTF_8 = Charset.forName("UTF-8");
+}

Propchange: sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/internal/jdk7/StandardCharsets.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/internal/jdk7/StandardCharsets.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain;charset=UTF-8

Added: sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/internal/jdk7/package-info.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/internal/jdk7/package-info.java?rev=1457600&view=auto
==============================================================================
--- sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/internal/jdk7/package-info.java (added)
+++ sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/internal/jdk7/package-info.java [UTF-8] Sun Mar 17 23:50:02 2013
@@ -0,0 +1,31 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Place-holder for JDK7 classes that do not exist in JDK6.
+ *
+ * <STRONG>Do not use!</STRONG>
+ *
+ * This package is for internal use by SIS only. Classes in this package
+ * may change in incompatible ways in any future version without notice.
+ *
+ * @author  Martin Desruisseaux (Geomatys)
+ * @since   0.3
+ * @version 0.3
+ * @module
+ */
+package org.apache.sis.internal.jdk7;

Propchange: sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/internal/jdk7/package-info.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/internal/jdk7/package-info.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain;charset=UTF-8

Modified: sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/internal/simple/SimpleCitation.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/internal/simple/SimpleCitation.java?rev=1457600&r1=1457599&r2=1457600&view=diff
==============================================================================
--- sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/internal/simple/SimpleCitation.java [UTF-8] (original)
+++ sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/internal/simple/SimpleCitation.java [UTF-8] Sun Mar 17 23:50:02 2013
@@ -31,7 +31,7 @@ import org.opengis.util.InternationalStr
 import org.apache.sis.util.iso.SimpleInternationalString;
 
 // Related to JDK7
-import org.apache.sis.internal.util.Objects;
+import org.apache.sis.internal.jdk7.Objects;
 
 
 /**



Mime
View raw message