sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1519814 - in /sis/branches/JDK6: ./ core/sis-build-helper/ core/sis-build-helper/src/main/java/org/apache/sis/internal/maven/ core/sis-build-helper/src/main/java/org/apache/sis/util/resources/ core/sis-build-helper/src/main/resources/META-...
Date Tue, 03 Sep 2013 19:52:28 GMT
Author: desruisseaux
Date: Tue Sep  3 19:52:27 2013
New Revision: 1519814

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

Added:
    sis/branches/JDK6/core/sis-build-helper/src/main/resources/META-INF/
      - copied from r1519810, sis/branches/JDK7/core/sis-build-helper/src/main/resources/META-INF/
    sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/
      - copied from r1519810, sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/
    sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/util/Numerics.java
      - copied unchanged from r1519810, sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/util/Numerics.java
    sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/internal/util/NumericsTest.java
      - copied unchanged from r1519810, sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/internal/util/NumericsTest.java
Modified:
    sis/branches/JDK6/   (props changed)
    sis/branches/JDK6/CHANGES
    sis/branches/JDK6/core/sis-build-helper/pom.xml
    sis/branches/JDK6/core/sis-build-helper/src/main/java/org/apache/sis/internal/maven/Assembler.java
    sis/branches/JDK6/core/sis-build-helper/src/main/java/org/apache/sis/internal/maven/BundleCreator.java
    sis/branches/JDK6/core/sis-build-helper/src/main/java/org/apache/sis/internal/maven/JarCollector.java
    sis/branches/JDK6/core/sis-build-helper/src/main/java/org/apache/sis/util/resources/ResourceCompilerMojo.java
    sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/PropertyAccessor.java
    sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/ImmutableIdentifier.java
    sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/DefaultExtent.java
    sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/MetadataTestCase.java
    sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/geometry/AbstractEnvelope.java
    sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/io/wkt/Convention.java
    sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/AbstractIdentifiedObject.java
    sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/AbstractReferenceSystem.java
    sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/IdentifiedObjects.java
    sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/AbstractDatum.java
    sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultImageDatum.java
    sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultPrimeMeridian.java
    sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/AbstractIdentifiedObjectTest.java
    sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/util/Utilities.java
    sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/math/MathFunctions.java
    sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/internal/util/UtilitiesTest.java
    sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/test/AnnotationsTestCase.java
    sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/test/suite/UtilityTestSuite.java
    sis/branches/JDK6/ide-project/NetBeans/build.xml
    sis/branches/JDK6/pom.xml

Propchange: sis/branches/JDK6/
------------------------------------------------------------------------------
  Merged /sis/trunk:r1519089-1519674
  Merged /sis/branches/JDK7:r1519082-1519810

Modified: sis/branches/JDK6/CHANGES
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/CHANGES?rev=1519814&r1=1519813&r2=1519814&view=diff
==============================================================================
--- sis/branches/JDK6/CHANGES (original)
+++ sis/branches/JDK6/CHANGES Tue Sep  3 19:52:27 2013
@@ -1,5 +1,11 @@
 Apache SIS Change Log
 ======================
+Release 0.4 - Current Development
+
+* SIS-133 ResourceCompilerMojo should execute only when properties files are modified
+          (Olivier Nouguier via mattmann)
+
+* SIS-132 Better support for eclipse IDE (Olivier Nouguier via mattmann)
 
 Release 0.3 - 06/29/2013
 

Modified: sis/branches/JDK6/core/sis-build-helper/pom.xml
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-build-helper/pom.xml?rev=1519814&r1=1519813&r2=1519814&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-build-helper/pom.xml (original)
+++ sis/branches/JDK6/core/sis-build-helper/pom.xml Tue Sep  3 19:52:27 2013
@@ -66,7 +66,16 @@ Define Maven Mojos and Javadoc taglets f
     </developer>
   </developers>
   <contributors>
-    <!-- To prevent inheritance from parent pom.xml -->
+    <contributor>
+      <name>Olivier Nouguier</name>
+      <email>olivier.nouguier@geomatys.com</email>
+      <organization>Geomatys</organization>
+      <organizationUrl>http://www.geomatys.com</organizationUrl>
+      <timezone>+1</timezone>
+      <roles>
+        <role>developer</role>
+      </roles>
+    </contributor>
   </contributors>
 
 
@@ -84,6 +93,11 @@ Define Maven Mojos and Javadoc taglets f
       <artifactId>maven-plugin-api</artifactId>
       <version>3.0.5</version>
     </dependency>
+     <dependency>
+      <groupId>org.sonatype.plexus</groupId>
+      <artifactId>plexus-build-api</artifactId>
+      <version>0.0.7</version>
+    </dependency>
     <dependency>
       <groupId>org.apache.commons</groupId>
       <artifactId>commons-compress</artifactId>

Modified: sis/branches/JDK6/core/sis-build-helper/src/main/java/org/apache/sis/internal/maven/Assembler.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-build-helper/src/main/java/org/apache/sis/internal/maven/Assembler.java?rev=1519814&r1=1519813&r2=1519814&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-build-helper/src/main/java/org/apache/sis/internal/maven/Assembler.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-build-helper/src/main/java/org/apache/sis/internal/maven/Assembler.java [UTF-8] Tue Sep  3 19:52:27 2013
@@ -56,7 +56,7 @@ public class Assembler extends AbstractM
     /**
      * Project information (name, version, URL).
      *
-     * @parameter default-value="${project}"
+     * @parameter property="project"
      * @required
      * @readonly
      */

Modified: sis/branches/JDK6/core/sis-build-helper/src/main/java/org/apache/sis/internal/maven/BundleCreator.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-build-helper/src/main/java/org/apache/sis/internal/maven/BundleCreator.java?rev=1519814&r1=1519813&r2=1519814&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-build-helper/src/main/java/org/apache/sis/internal/maven/BundleCreator.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-build-helper/src/main/java/org/apache/sis/internal/maven/BundleCreator.java [UTF-8] Tue Sep  3 19:52:27 2013
@@ -50,7 +50,7 @@ public class BundleCreator extends Abstr
     /**
      * Project information (name, version, URL).
      *
-     * @parameter default-value="${project}"
+     * @parameter property="project"
      * @required
      * @readonly
      */

Modified: sis/branches/JDK6/core/sis-build-helper/src/main/java/org/apache/sis/internal/maven/JarCollector.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-build-helper/src/main/java/org/apache/sis/internal/maven/JarCollector.java?rev=1519814&r1=1519813&r2=1519814&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-build-helper/src/main/java/org/apache/sis/internal/maven/JarCollector.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-build-helper/src/main/java/org/apache/sis/internal/maven/JarCollector.java [UTF-8] Tue Sep  3 19:52:27 2013
@@ -54,6 +54,7 @@ public final class JarCollector extends 
      *
      * @parameter property="project"
      * @required
+     * @readonly
      */
     private MavenProject project;
 

Modified: sis/branches/JDK6/core/sis-build-helper/src/main/java/org/apache/sis/util/resources/ResourceCompilerMojo.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-build-helper/src/main/java/org/apache/sis/util/resources/ResourceCompilerMojo.java?rev=1519814&r1=1519813&r2=1519814&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-build-helper/src/main/java/org/apache/sis/util/resources/ResourceCompilerMojo.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-build-helper/src/main/java/org/apache/sis/util/resources/ResourceCompilerMojo.java [UTF-8] Tue Sep  3 19:52:27 2013
@@ -19,8 +19,13 @@ package org.apache.sis.util.resources;
 import java.io.File;
 import java.io.FilenameFilter;
 import java.util.List;
+
+import org.apache.maven.model.Resource;
 import org.apache.maven.plugin.AbstractMojo;
 import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.project.MavenProject;
+import org.codehaus.plexus.util.Scanner;
+import org.sonatype.plexus.build.incremental.BuildContext;
 
 
 /**
@@ -28,9 +33,10 @@ import org.apache.maven.plugin.MojoExecu
  * See the <code><a href="{@website}/sis-build-helper/index.html">sis-build-helper</a></code> module
  * for more information.
  *
- * @author Martin Desruisseaux (Geomatys)
+ * @author  Martin Desruisseaux (Geomatys)
+ * @author  Olivier Nouguier (Geomatys)
  * @since   0.3 (derived from geotk-3.00)
- * @version 0.3
+ * @version 0.4
  * @module
  *
  * @goal compile-resources
@@ -38,6 +44,30 @@ import org.apache.maven.plugin.MojoExecu
  */
 public class ResourceCompilerMojo extends AbstractMojo implements FilenameFilter {
     /**
+     * Pattern to filter properties files that were modified.
+     */
+    private static final String[] PROPERTIES_PATTERN = new String[] {"**/*.properties"};
+
+    /**
+     * Project information (name, version, URL).
+     *
+     * @parameter property="project"
+     * @required
+     * @readonly
+     */
+    private MavenProject project;
+
+    /**
+     * A handler for the Eclipse workspace, used for declaring new resources.
+     * When Maven is run from the command line, this object does nothing.
+     *
+     * @see <a href="http://wiki.eclipse.org/M2E_compatible_maven_plugins">M2E compatible maven plugins</a>
+     *
+     * @component
+     */
+    private BuildContext buildContext;
+
+    /**
      * The source directories containing the sources to be compiled.
      *
      * @parameter property="project.compileSourceRoots"
@@ -49,10 +79,17 @@ public class ResourceCompilerMojo extend
     /**
      * Directory containing the generated class files.
      *
-     * @parameter property="project.build.outputDirectory"
+     * <p><b>Note:</b> at the time of writing, we found no well-established convention for generated resources.
+     * The conventions that we found were rather for generated sources. In the later case, the conventions use
+     * a different directory for each Maven plugin, e.g. <code>"generated-sources/xxx"</code>. But in our case
+     * (for resources), such separation seems of limited use since the resources are copied verbatim in the JAR
+     * file, so preventing clash in the <code>generated-resources</code> directory would not prevent clash in
+     * the JAR file anyway.</p>
+     *
+     * @parameter default-value="${project.build.directory}/generated-resources"
      * @required
      */
-    private String outputDirectory;
+    private File outputDirectory;
 
     /**
      * The <code>compileSourceRoots</code> named "java" as a <code>File</code>.
@@ -60,25 +97,39 @@ public class ResourceCompilerMojo extend
     private File javaDirectoryFile;
 
     /**
-     * The <code>outputDirectory</code> as a <code>File</code>.
-     */
-    private File outputDirectoryFile;
-
-    /**
      * Executes the mojo.
      *
      * @throws MojoExecutionException if the plugin execution failed.
      */
     @Override
-    @SuppressWarnings({"unchecked","rawtypes"}) // Generic array creation.
     public void execute() throws MojoExecutionException {
+        final boolean isIncremental = buildContext.isIncremental();
+    	declareOutputDirectory();
+
         int errors = 0;
-        outputDirectoryFile = new File(outputDirectory);
         for (final String sourceDirectory : compileSourceRoots) {
             final File directory = new File(sourceDirectory);
             if (directory.getName().equals("java")) {
+                /*
+                 * Check if we can skip the resources compilation (Eclipse environment only).
+                 *
+                 * Scanner.getIncludedFiles() returns an array of modified files. For now we ignore the array
+                 * content and unconditionally re-compile all resource files as soon as at least one file has
+                 * been modified. This is okay for now since changes in resource files are rare and compiling
+                 * them is very fast.
+                 */
+                if (isIncremental) {
+                    Scanner scanner = buildContext.newScanner(directory);
+                    scanner.setIncludes(PROPERTIES_PATTERN);
+                    scanner.scan();
+                    final String[] includedFiles = scanner.getIncludedFiles();
+                    if (includedFiles == null || includedFiles.length == 0) {
+                        continue;
+                    }
+                }
                 javaDirectoryFile = directory;
                 errors += processAllResourceDirectories(directory);
+                buildContext.refresh(outputDirectory);
             }
         }
         if (errors != 0) {
@@ -87,6 +138,15 @@ public class ResourceCompilerMojo extend
     }
 
     /**
+     * Declares {@link #outputDirectory} as resource, for inclusion by Maven in the JAR file.
+     */
+    private void declareOutputDirectory() {
+        final Resource resource = new Resource();
+        resource.setDirectory(outputDirectory.getPath());
+        project.addResource(resource);
+    }
+
+    /**
      * Recursively scans the directories for a sub-package named "resources",
      * then invokes the resource compiler for that directory.
      */
@@ -134,7 +194,7 @@ public class ResourceCompilerMojo extend
      */
     private final class Compiler extends IndexedResourceCompiler {
         public Compiler(File[] resourcesToProcess) {
-            super(javaDirectoryFile, outputDirectoryFile, resourcesToProcess);
+            super(javaDirectoryFile, outputDirectory, resourcesToProcess);
         }
 
         /**

Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/PropertyAccessor.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/PropertyAccessor.java?rev=1519814&r1=1519813&r2=1519814&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/PropertyAccessor.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/PropertyAccessor.java [UTF-8] Tue Sep  3 19:52:27 2013
@@ -50,7 +50,7 @@ import org.apache.sis.xml.IdentifiedObje
 
 import static org.apache.sis.metadata.PropertyComparator.*;
 import static org.apache.sis.metadata.ValueExistencePolicy.isNullOrEmpty;
-import static org.apache.sis.internal.util.Utilities.floatEpsilonEqual;
+import static org.apache.sis.internal.util.Numerics.floatEpsilonEqual;
 import static org.apache.sis.internal.util.CollectionsExt.snapshot;
 import static org.apache.sis.internal.util.CollectionsExt.modifiableCopy;
 import static org.apache.sis.util.collection.Containers.hashMapCapacity;

Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/ImmutableIdentifier.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/ImmutableIdentifier.java?rev=1519814&r1=1519813&r2=1519814&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/ImmutableIdentifier.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/ImmutableIdentifier.java [UTF-8] Tue Sep  3 19:52:27 2013
@@ -472,8 +472,8 @@ public class ImmutableIdentifier impleme
      *        behavior, in order to be compliant with the contract of the <code>GenericName</code>
      *        interface.}
      *
-     * @see IdentifiedObjects#toString(Identifier)
-     * @see NamedIdentifier#toString()
+     * @see org.apache.sis.referencing.IdentifiedObjects#toString(Identifier)
+     * @see org.apache.sis.referencing.NamedIdentifier#toString()
      */
     @Override
     public String toString() {

Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/DefaultExtent.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/DefaultExtent.java?rev=1519814&r1=1519813&r2=1519814&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/DefaultExtent.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/DefaultExtent.java [UTF-8] Tue Sep  3 19:52:27 2013
@@ -56,6 +56,8 @@ import org.apache.sis.internal.metadata.
  * @module
  *
  * @see Extents#getGeographicBoundingBox(Extent)
+ * @see org.apache.sis.referencing.AbstractReferenceSystem#getDomainOfValidity()
+ * @see org.apache.sis.referencing.datum.AbstractDatum#getDomainOfValidity()
  */
 @XmlType(name = "EX_Extent_Type", propOrder = {
     "description",

Modified: sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/MetadataTestCase.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/MetadataTestCase.java?rev=1519814&r1=1519813&r2=1519814&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/MetadataTestCase.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/MetadataTestCase.java [UTF-8] Tue Sep  3 19:52:27 2013
@@ -185,6 +185,7 @@ public abstract strictfp class MetadataT
                 }
             }
         }
+        done();
     }
 
     /**

Modified: sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/geometry/AbstractEnvelope.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/geometry/AbstractEnvelope.java?rev=1519814&r1=1519813&r2=1519814&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/geometry/AbstractEnvelope.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/geometry/AbstractEnvelope.java [UTF-8] Tue Sep  3 19:52:27 2013
@@ -38,7 +38,7 @@ import org.apache.sis.util.ComparisonMod
 import org.apache.sis.util.resources.Errors;
 
 import static java.lang.Double.doubleToLongBits;
-import static org.apache.sis.internal.util.Utilities.SIGN_BIT_MASK;
+import static org.apache.sis.internal.util.Numerics.SIGN_BIT_MASK;
 import static org.apache.sis.util.ArgumentChecks.ensureNonNull;
 import static org.apache.sis.util.ArgumentChecks.ensureDimensionMatches;
 import static org.apache.sis.util.StringBuilders.trimFractionalPart;

Modified: sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/io/wkt/Convention.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/io/wkt/Convention.java?rev=1519814&r1=1519813&r2=1519814&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/io/wkt/Convention.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/io/wkt/Convention.java [UTF-8] Tue Sep  3 19:52:27 2013
@@ -19,6 +19,7 @@ package org.apache.sis.io.wkt;
 import javax.measure.unit.SI;
 import javax.measure.unit.Unit;
 import javax.measure.quantity.Angle;
+import javax.measure.quantity.Quantity;
 import org.opengis.metadata.citation.Citation;
 import org.opengis.referencing.cs.CartesianCS;
 import org.opengis.referencing.cs.CoordinateSystem;
@@ -221,7 +222,7 @@ public enum Convention {
      * which means that the angular units are inferred from the context as required by the
      * <a href="http://www.geoapi.org/3.0/javadoc/org/opengis/referencing/doc-files/WKT.html#PRIMEM">WKT specification</a>.
      *
-     * @see ReferencingParser#getForcedAngularUnit()
+     * @see #getForcedUnit(Class)
      */
     final Unit<Angle> forcedAngularUnit;
 
@@ -241,9 +242,9 @@ public enum Convention {
      * Creates a new enumeration value.
      */
     private Convention(final Citation authority, final Unit<Angle> angularUnit, final boolean unitUS) {
-        this.authority = authority;
+        this.authority         = authority;
         this.forcedAngularUnit = angularUnit;
-        this.unitUS = unitUS;
+        this.unitUS            = unitUS;
     }
 
     /**
@@ -258,6 +259,25 @@ public enum Convention {
     }
 
     /**
+     * If non-null, {@code PRIMEM} and {@code PARAMETER} values shall unconditionally use the returned units.
+     * The standard value is {@code null}, which means that units are inferred from the context as required by the
+     * <a href="http://www.geoapi.org/3.0/javadoc/org/opengis/referencing/doc-files/WKT.html#PRIMEM">WKT specification</a>.
+     * However some conventions ignore the above WKT specification and use hard-coded units instead.
+     *
+     * @param  <T>       The compile-time type specified by the {@code quantity} argument.
+     * @param  quantity  The kind of quantity for which to get the unit.
+     *                   The most typical value for this argument is <code>{@linkplain Angle}.class</code>.
+     * @return The unit to use for the given kind of quantity, or {@code null} for inferring the unit in the standard way.
+     */
+    @SuppressWarnings("unchecked")
+    public <T extends Quantity> Unit<T> getForcedUnit(final Class<T> quantity) {
+        if (quantity == Angle.class) {
+            return (Unit) forcedAngularUnit;
+        }
+        return null;
+    }
+
+    /**
      * Returns the convention for the organization, standard or project specified by the given citation.
      *
      * @param  authority The organization, standard or project for which to get the convention, or {@code null}.

Modified: sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/AbstractIdentifiedObject.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/AbstractIdentifiedObject.java?rev=1519814&r1=1519813&r2=1519814&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/AbstractIdentifiedObject.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/AbstractIdentifiedObject.java [UTF-8] Tue Sep  3 19:52:27 2013
@@ -39,7 +39,6 @@ import org.opengis.referencing.Identifie
 import org.opengis.referencing.ReferenceIdentifier;
 import org.apache.sis.io.wkt.FormattableObject;
 import org.apache.sis.xml.Namespaces;
-import org.apache.sis.util.Classes;
 import org.apache.sis.util.Immutable;
 import org.apache.sis.util.ThreadSafe;
 import org.apache.sis.util.Deprecable;
@@ -452,16 +451,18 @@ public class AbstractIdentifiedObject ex
 
     /**
      * Returns {@code true} if either the {@linkplain #getName() primary name} or at least
-     * one {@linkplain #getAlias alias} matches the specified string.
-     * This method performs the search in the following order, regardless of any authority:
+     * one {@linkplain #getAlias() alias} matches the specified string.
+     * This method returns {@code true} if the given name is equal to one of the following names,
+     * regardless of any authority:
      *
      * <ul>
-     *   <li>The {@linkplain #getName() primary name} of this object</li>
-     *   <li>The {@linkplain ScopedName fully qualified name} of an alias</li>
-     *   <li>The {@linkplain LocalName local name} of an alias</li>
+     *   <li>The {@linkplain #getName() primary name} of this object.</li>
+     *   <li>The {@linkplain org.opengis.util.GenericName#toFullyQualifiedName() fully qualified name} of an alias.</li>
+     *   <li>The {@linkplain org.opengis.util.ScopedName#tail() tail} of an alias.</li>
+     *   <li>The tail of the previous tail, recursively up to the {@linkplain org.opengis.util.ScopedName#tip() tip}.</li>
      * </ul>
      *
-     * @param  name The name to compare.
+     * @param  name The name to compare with the object name or aliases.
      * @return {@code true} if the primary name of at least one alias matches the specified {@code name}.
      *
      * @see IdentifiedObjects#nameMatches(IdentifiedObject, String)
@@ -471,25 +472,6 @@ public class AbstractIdentifiedObject ex
     }
 
     /**
-     * Compares the specified object with this object for equality.
-     * This method is implemented as below (omitting assertions):
-     *
-     * {@preformat java
-     *     return equals(other, ComparisonMode.STRICT);
-     * }
-     *
-     * @param  object The other object (may be {@code null}).
-     * @return {@code true} if both objects are equal.
-     */
-    @Override
-    public final boolean equals(final Object object) {
-        final boolean eq = equals(object, ComparisonMode.STRICT);
-        // If objects are equal, then they must have the same hash code value.
-        assert !eq || hashCode() == object.hashCode() : this;
-        return eq;
-    }
-
-    /**
      * Compares this object with the specified object for equality.
      * The strictness level is controlled by the second argument:
      *
@@ -498,9 +480,9 @@ public class AbstractIdentifiedObject ex
      *       are compared including {@linkplain #getName() name}, {@linkplain #getRemarks() remarks},
      *       {@linkplain #getIdentifiers() identifiers code}, <i>etc.</i></li>
      *   <li>If {@code mode} is {@link ComparisonMode#IGNORE_METADATA IGNORE_METADATA},
-     *       then this method compare only the properties needed for computing transformations.
-     *       In other words, {@code sourceCS.equals(targetCS, IGNORE_METADATA)} returns {@code true}
-     *       if the transformation from {@code sourceCS} to {@code targetCS} is likely to be the
+     *       then this method compares only the properties needed for computing transformations.
+     *       In other words, {@code sourceCRS.equals(targetCRS, IGNORE_METADATA)} returns {@code true}
+     *       if the transformation from {@code sourceCRS} to {@code targetCRS} is likely to be the
      *       identity transform, no matter what {@link #getName()} said.</li>
      * </ul>
      *
@@ -517,6 +499,9 @@ public class AbstractIdentifiedObject ex
      *         {@link ComparisonMode#IGNORE_METADATA IGNORE_METADATA} for comparing only properties
      *         relevant to transformations.
      * @return {@code true} if both objects are equal.
+     *
+     * @see #hashCode(ComparisonMode)
+     * @see org.apache.sis.util.Utilities#deepEquals(Object, Object, ComparisonMode)
      */
     @Override
     public boolean equals(final Object object, final ComparisonMode mode) {
@@ -575,51 +560,88 @@ public class AbstractIdentifiedObject ex
     }
 
     /**
-     * Returns a hash value for this identified object.
-     * This method invokes {@link #computeHashCode()} when first needed and caches the value for future invocations.
-     * Subclasses shall override {@code computeHashCode()} instead than this method.
+     * Computes a hash value consistent with the given comparison mode.
+     * This method accepts only the following enumeration values:
      *
-     * {@section Implementation specific feature}
-     * In the Apache SIS implementation, the {@linkplain #getName() name}, {@linkplain #getIdentifiers() identifiers}
-     * and {@linkplain #getRemarks() remarks} are not used for hash code computation.
-     * Consequently two identified objects will return the same hash value if they are equal in the sense of
-     * <code>{@linkplain #equals(Object, ComparisonMode) equals}(…, {@linkplain ComparisonMode#IGNORE_METADATA})</code>.
+     * <ul>
+     *   <li>{@link ComparisonMode#STRICT} (the default): this method may use any property,
+     *       including implementation-specific ones if any, at implementation choice.</li>
+     *   <li>{@link ComparisonMode#BY_CONTRACT}: this method can use any property defined
+     *       in the implemented interface (typically a GeoAPI interface).</li>
+     *   <li>{@link ComparisonMode#IGNORE_METADATA}: this method ignores the metadata that do not affect
+     *       coordinate operations. By default, the ignored properties are the {@linkplain #getName() name},
+     *       {@linkplain #getIdentifiers() identifiers} and {@linkplain #getRemarks() remarks}.
+     *       However subclasses may ignore a different list of properties.</li>
+     * </ul>
+     *
+     * In the later case, two identified objects will return the same hash value if they are equal in the sense of
+     * <code>{@linkplain #equals(Object, ComparisonMode) equals}(object, {@linkplain ComparisonMode#IGNORE_METADATA})</code>.
      * This feature allows users to implement metadata-insensitive {@link java.util.HashMap}.
      *
+     * @param  mode Specifies the set of properties that can be used for hash code computation.
      * @return The hash code value. This value may change between different execution of the Apache SIS library.
+     * @throws IllegalArgumentException If the given {@code mode} is not one of {@code STRICT}, {@code BY_CONTRACT}
+     *         or {@code IGNORE_METADATA} enumeration values.
      */
-    @Override
-    public final int hashCode() { // No need to synchronize; ok if invoked twice.
-        int hash = hashCode;
-        if (hash == 0) {
-            hash = computeHashCode();
-            if (hash == 0) {
-                hash = -1;
+    public int hashCode(final ComparisonMode mode) throws IllegalArgumentException {
+        int code = (int) serialVersionUID;
+        switch (mode) {
+            case STRICT: {
+                code ^= Objects.hash(name, nonNull(alias), nonNull(identifiers), remarks);
+                break;
+            }
+            case BY_CONTRACT: {
+                code ^= Objects.hash(getName(), getAlias(), getIdentifiers(), getRemarks());
+                break;
+            }
+            case IGNORE_METADATA: {
+                break;
+            }
+            default: {
+                throw new IllegalArgumentException(Errors.format(Errors.Keys.IllegalArgumentValue_2, "mode", mode));
             }
-            hashCode = hash;
         }
-        assert hash == -1 || hash == computeHashCode() : this;
-        return hash;
+        return code;
     }
 
     /**
-     * Computes a hash value for this identified object.
-     * This method is invoked by {@link #hashCode()} when first needed.
+     * Compares the specified object with this object for equality.
+     * This method is implemented as below (omitting assertions):
      *
-     * <p>The default implementation computes a code derived from the list of {@link IdentifiedObject} interfaces
-     * implemented by this instance. The {@linkplain #getName() name}, {@linkplain #getIdentifiers() identifiers}
-     * and {@linkplain #getRemarks() remarks} are intentionally <strong>not</strong> used for hash code computation.
-     * See the <cite>Implementation specific feature</cite> section in {@link #hashCode()} for more information.</p>
+     * {@preformat java
+     *     return equals(other, ComparisonMode.STRICT);
+     * }
+     *
+     * @param  object The other object (may be {@code null}).
+     * @return {@code true} if both objects are equal.
+     */
+    @Override
+    public final boolean equals(final Object object) {
+        final boolean eq = equals(object, ComparisonMode.STRICT);
+        // If objects are equal, then they must have the same hash code value.
+        assert !eq || hashCode() == object.hashCode() : this;
+        return eq;
+    }
+
+    /**
+     * Returns a hash value for this identified object.
+     * This method invokes <code>{@linkplain #hashCode(ComparisonMode) hashCode}(ComparisonMode.STRICT)</code>
+     * when first needed and caches the value for future invocations.
+     * Subclasses shall override {@link #hashCode(ComparisonMode)} instead than this method.
      *
      * @return The hash code value. This value may change between different execution of the Apache SIS library.
      */
-    protected int computeHashCode() {
-        // Subclasses need to overrides this!!!!
-        int code = (int) serialVersionUID;
-        for (final Class<?> type : Classes.getLeafInterfaces(getClass(), IdentifiedObject.class)) {
-            // Use a plain addition in order to be insensitive to array element order.
-            code += type.hashCode();
+    @Override
+    public final int hashCode() { // No need to synchronize; ok if invoked twice.
+        int hash = hashCode;
+        if (hash == 0) {
+            hash = hashCode(ComparisonMode.STRICT);
+            if (hash == 0) {
+                hash = -1;
+            }
+            hashCode = hash;
         }
-        return code;
+        assert hash == -1 || hash == hashCode(ComparisonMode.STRICT) : this;
+        return hash;
     }
 }

Modified: sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/AbstractReferenceSystem.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/AbstractReferenceSystem.java?rev=1519814&r1=1519813&r2=1519814&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/AbstractReferenceSystem.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/AbstractReferenceSystem.java [UTF-8] Tue Sep  3 19:52:27 2013
@@ -61,12 +61,16 @@ public class AbstractReferenceSystem ext
 
     /**
      * Area for which the (coordinate) reference system is valid.
+     *
+     * @see #getDomainOfValidity()
      */
     private final Extent domainOfValidity;
 
     /**
      * Description of domain of usage, or limitations of usage,
      * for which this (coordinate) reference system object is valid.
+     *
+     * @see #getScope()
      */
     @XmlElement(required = true)
     private final InternationalString scope;
@@ -123,6 +127,8 @@ public class AbstractReferenceSystem ext
      * or {@code null} if unspecified.
      *
      * @return Area or region or timeframe in which this (coordinate) reference system is valid, or {@code null}.
+     *
+     * @see org.apache.sis.metadata.iso.extent.DefaultExtent
      */
     @Override
     public Extent getDomainOfValidity() {
@@ -176,4 +182,27 @@ public class AbstractReferenceSystem ext
         }
         return false;
     }
+
+    /**
+     * Computes a hash value consistent with the given comparison mode.
+     * If the given argument is {@link ComparisonMode#IGNORE_METADATA IGNORE_METADATA}, then the
+     * {@linkplain #getDomainOfValidity() domain of validity} and the {@linkplain #getScope() scope}
+     * properties are ignored, in addition to other ignored properties documented in the
+     * {@linkplain AbstractIdentifiedObject#hashCode(ComparisonMode) super-class}.
+     */
+    @Override
+    public int hashCode(final ComparisonMode mode) throws IllegalArgumentException {
+        int code = super.hashCode(mode) ^ (int) serialVersionUID;
+        switch (mode) {
+            case STRICT: {
+                code ^= Objects.hash(domainOfValidity, scope);
+                break;
+            }
+            case BY_CONTRACT: {
+                code ^= Objects.hash(getDomainOfValidity(), getScope());
+                break;
+            }
+        }
+        return code;
+    }
 }

Modified: sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/IdentifiedObjects.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/IdentifiedObjects.java?rev=1519814&r1=1519813&r2=1519814&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/IdentifiedObjects.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/IdentifiedObjects.java [UTF-8] Tue Sep  3 19:52:27 2013
@@ -89,7 +89,7 @@ public final class IdentifiedObjects ext
      *
      *   <li><p>Otherwise, if the alias implements the {@link GenericName} interface, then this method
      *       compares the {@linkplain GenericName#scope() name scope} against the specified citation
-     *       using the {@linkplain Citations#identifierMatches(Citation, String)} method.
+     *       using the {@link Citations#identifierMatches(Citation, String)} method.
      *       If a matching is found, then this method returns the
      *       {@linkplain GenericName#tip() name tip} of that object.</p></li>
      * </ul>
@@ -291,18 +291,22 @@ public final class IdentifiedObjects ext
     /**
      * Returns {@code true} if either the {@linkplain IdentifiedObject#getName() primary name} or
      * at least one {@linkplain IdentifiedObject#getAlias() alias} matches the specified string.
-     * This method performs the search in the following order, regardless of any authority:
+     * This method returns {@code true} if the given name is equal to one of the following names,
+     * regardless of any authority:
      *
-     * <ol>
+     * <ul>
      *   <li>The {@linkplain IdentifiedObject#getName() primary name} of the object.</li>
-     *   <li>The {@linkplain ScopedName fully qualified name} of an alias.</li>
-     *   <li>The {@linkplain LocalName local name} of an alias.</li>
-     * </ol>
+     *   <li>The {@linkplain GenericName#toFullyQualifiedName() fully qualified name} of an alias.</li>
+     *   <li>The {@linkplain ScopedName#tail() tail} of an alias.</li>
+     *   <li>The tail of the previous tail, recursively up to the {@linkplain ScopedName#tip() tip}.</li>
+     * </ul>
+     *
+     * If the given object is an instance of {@link AbstractIdentifiedObject}, then this method delegates
+     * to its {@code nameMatches(String)} method. Otherwise this method fallbacks on a generic algorithm.
      *
      * @param  object The object for which to check the name or alias.
-     * @param  name The name.
-     * @return {@code true} if the primary name of at least one alias
-     *         matches the specified {@code name}.
+     * @param  name The name to compare with the object name or aliases.
+     * @return {@code true} if the primary name of at least one alias matches the specified {@code name}.
      *
      * @see AbstractIdentifiedObject#nameMatches(String)
      */
@@ -390,7 +394,7 @@ public final class IdentifiedObjects ext
      * @param  identifier The identifier, or {@code null}.
      * @return A string representation of the given identifier, or {@code null}.
      *
-     * @see DefaultIdentifier#toString()
+     * @see org.apache.sis.metadata.iso.ImmutableIdentifier#toString()
      * @see NamedIdentifier#toString()
      */
     public static String toString(final Identifier identifier) {

Modified: sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/AbstractDatum.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/AbstractDatum.java?rev=1519814&r1=1519810&r2=1519814&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/AbstractDatum.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/AbstractDatum.java [UTF-8] Tue Sep  3 19:52:27 2013
@@ -41,7 +41,7 @@ import static org.apache.sis.util.Utilit
 import static org.apache.sis.util.collection.Containers.property;
 
 // Related to JDK7
-import java.util.Objects;
+import org.apache.sis.internal.jdk7.Objects;
 
 
 /**
@@ -166,7 +166,7 @@ public class AbstractDatum extends Abstr
      * the {@link #equals(Object, ComparisonMode)} method.
      */
     static Map<String,Object> name(final int key) {
-        final Map<String,Object> properties = new HashMap<>(4);
+        final Map<String,Object> properties = new HashMap<String,Object>(4);
         final InternationalString name = Vocabulary.formatInternational(key);
         properties.put(NAME_KEY,  name.toString(Locale.ROOT));
         properties.put(ALIAS_KEY, name);

Modified: sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultImageDatum.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultImageDatum.java?rev=1519814&r1=1519810&r2=1519814&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultImageDatum.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultImageDatum.java [UTF-8] Tue Sep  3 19:52:27 2013
@@ -29,7 +29,7 @@ import org.apache.sis.util.Immutable;
 import static org.apache.sis.util.ArgumentChecks.ensureNonNull;
 
 // Related to JDK7
-import java.util.Objects;
+import org.apache.sis.internal.jdk7.Objects;
 
 
 /**

Modified: sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultPrimeMeridian.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultPrimeMeridian.java?rev=1519814&r1=1519810&r2=1519814&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultPrimeMeridian.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultPrimeMeridian.java [UTF-8] Tue Sep  3 19:52:27 2013
@@ -38,7 +38,7 @@ import static org.apache.sis.util.Argume
 import static org.apache.sis.util.ArgumentChecks.ensureNonNull;
 
 // Related to JDK7
-import java.util.Objects;
+import org.apache.sis.internal.jdk7.Objects;
 
 
 /**
@@ -64,7 +64,7 @@ public class DefaultPrimeMeridian extend
      */
     public static final DefaultPrimeMeridian GREENWICH;
     static {
-        final Map<String,Object> properties = new HashMap<>(4);
+        final Map<String,Object> properties = new HashMap<String,Object>(4);
         properties.put(NAME_KEY, "Greenwich"); // Name is fixed by ISO 19111.
         properties.put(IDENTIFIERS_KEY, new NamedIdentifier(Citations.EPSG, "8901"));
         GREENWICH = new DefaultPrimeMeridian(properties, 0, NonSI.DEGREE_ANGLE);

Modified: sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/AbstractIdentifiedObjectTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/AbstractIdentifiedObjectTest.java?rev=1519814&r1=1519813&r2=1519814&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/AbstractIdentifiedObjectTest.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/AbstractIdentifiedObjectTest.java [UTF-8] Tue Sep  3 19:52:27 2013
@@ -45,12 +45,9 @@ public final strictfp class AbstractIden
     @Test
     public void testCreateFromMap() {
         final Map<String,Object> properties = new HashMap<String,Object>(10);
-        assertNull(properties.put("name",             "This is a name"));
-        assertNull(properties.put("remarks",          "There is remarks"));
-        assertNull(properties.put("remarks_fr",       "Voici des remarques"));
-        assertNull(properties.put("anchorPoint",      "Anchor point"));
-        assertNull(properties.put("realizationEpoch", "Realization epoch"));
-        assertNull(properties.put("validArea",        "Valid area"));
+        assertNull(properties.put("name",       "This is a name"));
+        assertNull(properties.put("remarks",    "There is remarks"));
+        assertNull(properties.put("remarks_fr", "Voici des remarques"));
 
         final AbstractIdentifiedObject object = new AbstractIdentifiedObject(properties);
         Validators.validate(object);

Modified: sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/util/Utilities.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/util/Utilities.java?rev=1519814&r1=1519813&r2=1519814&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/util/Utilities.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/util/Utilities.java [UTF-8] Tue Sep  3 19:52:27 2013
@@ -22,9 +22,6 @@ import org.apache.sis.util.Static;
 import org.apache.sis.util.Classes;
 import org.apache.sis.util.CharSequences;
 
-import static java.lang.Math.abs;
-import static java.lang.Math.max;
-
 
 /**
  * Miscellaneous utilities which should not be put in public API.
@@ -35,49 +32,6 @@ import static java.lang.Math.max;
  * @module
  */
 public final class Utilities extends Static {
-    /**
-     * Relative difference tolerated when comparing floating point numbers using
-     * {@link org.apache.sis.util.ComparisonMode#APPROXIMATIVE}.
-     *
-     * <p>Historically, this was the relative tolerance threshold for considering two
-     * matrixes as equal. This value has been determined empirically in order to allow
-     * {@link org.apache.sis.referencing.operation.transform.ConcatenatedTransform} to
-     * detect the cases where two {@link org.apache.sis.referencing.operation.transform.LinearTransform}
-     * are equal for practical purpose. This threshold can be used as below:</p>
-     *
-     * {@preformat java
-     *     Matrix m1 = ...;
-     *     Matrix m2 = ...;
-     *     if (Matrices.epsilonEqual(m1, m2, EQUIVALENT_THRESHOLD, true)) {
-     *         // Consider that matrixes are equal.
-     *     }
-     * }
-     *
-     * By extension, the same threshold value is used for comparing other floating point values.
-     *
-     * @see org.apache.sis.internal.referencing.Utilities#LINEAR_TOLERANCE
-     * @see org.apache.sis.internal.referencing.Utilities#ANGULAR_TOLERANCE
-     */
-    public static final double COMPARISON_THRESHOLD = 1E-14;
-
-    /**
-     * Bit mask to isolate the sign bit of non-{@linkplain Double#isNaN(double) NaN} values in a
-     * {@code double}. For any real value, the following code evaluate to 0 if the given value is
-     * positive:
-     *
-     * {@preformat java
-     *     Double.doubleToRawLongBits(value) & SIGN_BIT_MASK;
-     * }
-     *
-     * Note that this idiom differentiates positive zero from negative zero.
-     * It should be used only when such difference matter.
-     *
-     * @see org.apache.sis.math.MathFunctions#isPositive(double)
-     * @see org.apache.sis.math.MathFunctions#isNegative(double)
-     * @see org.apache.sis.math.MathFunctions#isSameSign(double, double)
-     * @see org.apache.sis.math.MathFunctions#xorSign(double, double)
-     */
-    public static final long SIGN_BIT_MASK = Long.MIN_VALUE;
 
     /**
      * Do not allow instantiation of this class.
@@ -86,38 +40,6 @@ public final class Utilities extends Sta
     }
 
     /**
-     * Returns {@code true} if the given values are approximatively equal,
-     * up to the {@linkplain #COMPARISON_THRESHOLD comparison threshold}.
-     *
-     * @param  v1 The first value to compare.
-     * @param  v2 The second value to compare.
-     * @return {@code true} If both values are approximatively equal.
-     */
-    public static boolean epsilonEqual(final double v1, final double v2) {
-        final double threshold = COMPARISON_THRESHOLD * max(abs(v1), abs(v2));
-        if (threshold == Double.POSITIVE_INFINITY || Double.isNaN(threshold)) {
-            return Double.doubleToLongBits(v1) == Double.doubleToLongBits(v2);
-        }
-        return abs(v1 - v2) <= threshold;
-    }
-
-    /**
-     * Returns {@code true} if the following objects are floating point numbers ({@link Float} or
-     * {@link Double} types) and approximatively equal. If the given object are not floating point
-     * numbers, then this method returns {@code false} unconditionally on the assumption that
-     * strict equality has already been checked before this method call.
-     *
-     * @param  v1 The first value to compare.
-     * @param  v2 The second value to compare.
-     * @return {@code true} If both values are real number and approximatively equal.
-     */
-    public static boolean floatEpsilonEqual(final Object v1, final Object v2) {
-        return (v1 instanceof Float || v1 instanceof Double) &&
-               (v2 instanceof Float || v2 instanceof Double) &&
-               epsilonEqual(((Number) v1).doubleValue(), ((Number) v2).doubleValue());
-    }
-
-    /**
      * Returns a string representation of an instance of the given class having the given properties.
      * This is a convenience method for implementation of {@link Object#toString()} methods that are
      * used mostly for debugging purpose.

Modified: sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/math/MathFunctions.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/math/MathFunctions.java?rev=1519814&r1=1519813&r2=1519814&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/math/MathFunctions.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/math/MathFunctions.java [UTF-8] Tue Sep  3 19:52:27 2013
@@ -27,7 +27,7 @@ import static java.lang.Float.intBitsToF
 import static java.lang.Float.floatToRawIntBits;
 import static java.lang.Double.longBitsToDouble;
 import static java.lang.Double.doubleToRawLongBits;
-import static org.apache.sis.internal.util.Utilities.SIGN_BIT_MASK;
+import static org.apache.sis.internal.util.Numerics.SIGN_BIT_MASK;
 
 
 /**

Modified: sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/internal/util/UtilitiesTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/internal/util/UtilitiesTest.java?rev=1519814&r1=1519813&r2=1519814&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/internal/util/UtilitiesTest.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/internal/util/UtilitiesTest.java [UTF-8] Tue Sep  3 19:52:27 2013
@@ -19,10 +19,6 @@ package org.apache.sis.internal.util;
 import org.apache.sis.test.TestCase;
 import org.junit.Test;
 
-import static java.lang.Double.NaN;
-import static java.lang.Double.POSITIVE_INFINITY;
-import static java.lang.Double.NEGATIVE_INFINITY;
-import static org.apache.sis.internal.util.Utilities.*;
 import static org.apache.sis.test.Assert.*;
 
 
@@ -36,23 +32,6 @@ import static org.apache.sis.test.Assert
  */
 public final strictfp class UtilitiesTest extends TestCase {
     /**
-     * Tests the {@link Utilities#epsilonEqual(double, double)} method.
-     */
-    @Test
-    public void testEpsilonEqual() {
-        assertTrue (epsilonEqual(POSITIVE_INFINITY, POSITIVE_INFINITY));
-        assertTrue (epsilonEqual(NEGATIVE_INFINITY, NEGATIVE_INFINITY));
-        assertFalse(epsilonEqual(POSITIVE_INFINITY, NEGATIVE_INFINITY));
-        assertFalse(epsilonEqual(POSITIVE_INFINITY, NaN));
-        assertTrue (epsilonEqual(NaN,               NaN));
-        assertFalse(epsilonEqual(   0,        COMPARISON_THRESHOLD / 2));
-        assertTrue (epsilonEqual(   1,    1 + COMPARISON_THRESHOLD / 2));
-        assertFalse(epsilonEqual(   1,    1 + COMPARISON_THRESHOLD * 2));
-        assertTrue (epsilonEqual(-100, -100 + COMPARISON_THRESHOLD * 50));
-        assertFalse(epsilonEqual( 100,  100 + COMPARISON_THRESHOLD * 150));
-    }
-
-    /**
      * Tests the {@link Utilities#toString(Class, Object[])} method.
      */
     @Test

Modified: sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/test/AnnotationsTestCase.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/test/AnnotationsTestCase.java?rev=1519814&r1=1519813&r2=1519814&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/test/AnnotationsTestCase.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/test/AnnotationsTestCase.java [UTF-8] Tue Sep  3 19:52:27 2013
@@ -638,7 +638,7 @@ public abstract strictfp class Annotatio
      * Shall be invoked after every successful test in order
      * to disable the report of failed class or method.
      */
-    private void done() {
+    protected final void done() {
         testingClass  = null;
         testingMethod = null;
     }

Modified: sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/test/suite/UtilityTestSuite.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/test/suite/UtilityTestSuite.java?rev=1519814&r1=1519813&r2=1519814&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/test/suite/UtilityTestSuite.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/test/suite/UtilityTestSuite.java [UTF-8] Tue Sep  3 19:52:27 2013
@@ -57,6 +57,7 @@ import org.junit.BeforeClass;
     org.apache.sis.math.StatisticsTest.class,
     org.apache.sis.math.StatisticsFormatTest.class,
     org.apache.sis.internal.util.UtilitiesTest.class,
+    org.apache.sis.internal.util.NumericsTest.class,
     org.apache.sis.internal.jdk8.JDK8Test.class,
 
     // Collections.

Modified: sis/branches/JDK6/ide-project/NetBeans/build.xml
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/ide-project/NetBeans/build.xml?rev=1519814&r1=1519813&r2=1519814&view=diff
==============================================================================
--- sis/branches/JDK6/ide-project/NetBeans/build.xml (original)
+++ sis/branches/JDK6/ide-project/NetBeans/build.xml Tue Sep  3 19:52:27 2013
@@ -33,7 +33,7 @@
   -->
   <target name="-post-compile">
     <copy todir="${build.classes.dir}/org/apache/sis/util/resources">
-      <fileset dir="${project.root}/core/sis-utility/target/classes/org/apache/sis/util/resources">
+      <fileset dir="${project.root}/core/sis-utility/target/generated-resources/org/apache/sis/util/resources">
         <include name="*.utf"/>
       </fileset>
     </copy>

Modified: sis/branches/JDK6/pom.xml
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/pom.xml?rev=1519814&r1=1519813&r2=1519814&view=diff
==============================================================================
--- sis/branches/JDK6/pom.xml (original)
+++ sis/branches/JDK6/pom.xml Tue Sep  3 19:52:27 2013
@@ -443,6 +443,7 @@ Apache SIS is a free software, Java lang
         <artifactId>maven-jar-plugin</artifactId>
         <configuration>
           <archive>
+            <addMavenDescriptor>false</addMavenDescriptor>
             <index>false</index>
             <manifest>
               <addClasspath>true</addClasspath>



Mime
View raw message