sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1649819 - in /sis/branches/JDK8/core: sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/ sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/ sis-referencing/src/main/java/org/apache/sis/internal/referencing/ sis-ref...
Date Tue, 06 Jan 2015 15:07:47 GMT
Author: desruisseaux
Date: Tue Jan  6 15:07:46 2015
New Revision: 1649819

URL: http://svn.apache.org/r1649819
Log:
Added test, documentation update, tuned error message.

Modified:
    sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultCoverageDescription.java
    sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/DefaultGeographicBoundingBox.java
    sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/DefaultTemporalExtent.java
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/ReferencingUtilities.java
    sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/ReferencingUtilitiesTest.java

Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultCoverageDescription.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultCoverageDescription.java?rev=1649819&r1=1649818&r2=1649819&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultCoverageDescription.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultCoverageDescription.java
[UTF-8] Tue Jan  6 15:07:46 2015
@@ -286,7 +286,7 @@ public class DefaultCoverageDescription
      *
      * @return Dimensions of the cell measurement value.
      *
-     * @deprecated As of ISO 19115:2014, moved to {@link DefaultAttributeGroup#getGroupAttributes()}.
+     * @deprecated As of ISO 19115:2014, moved to {@link DefaultAttributeGroup#getAttributes()}.
      */
     @Override
     @Deprecated
@@ -323,7 +323,7 @@ public class DefaultCoverageDescription
      *
      * @param newValues The new dimensions.
      *
-     * @deprecated As of ISO 19115:2014, moved to {@link DefaultAttributeGroup#setGroupAttributes(Collection)}.
+     * @deprecated As of ISO 19115:2014, moved to {@link DefaultAttributeGroup#setAttributes(Collection)}.
      */
     @Deprecated
     public void setDimensions(final Collection<? extends RangeDimension> newValues)
{

Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/DefaultGeographicBoundingBox.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/DefaultGeographicBoundingBox.java?rev=1649819&r1=1649818&r2=1649819&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/DefaultGeographicBoundingBox.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/DefaultGeographicBoundingBox.java
[UTF-8] Tue Jan  6 15:07:46 2015
@@ -29,6 +29,7 @@ import org.apache.sis.math.MathFunctions
 import org.apache.sis.util.ComparisonMode;
 import org.apache.sis.util.ArgumentChecks;
 import org.apache.sis.util.resources.Errors;
+import org.apache.sis.util.resources.Vocabulary;
 import org.apache.sis.internal.metadata.MetadataUtilities;
 import org.apache.sis.internal.metadata.ReferencingServices;
 
@@ -381,8 +382,9 @@ public class DefaultGeographicBoundingBo
             throws IllegalArgumentException
     {
         if (southBoundLatitude > northBoundLatitude) { // Accept NaN.
-            throw new IllegalArgumentException(Errors.format(Errors.Keys.IllegalRange_2,
-                    new Latitude(southBoundLatitude), new Latitude(northBoundLatitude)));
+            throw new IllegalArgumentException(Errors.format(Errors.Keys.IllegalOrdinateRange_3,
+                    new Latitude(southBoundLatitude), new Latitude(northBoundLatitude),
+                    Vocabulary.format(Vocabulary.Keys.Latitude)));
         }
     }
 

Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/DefaultTemporalExtent.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/DefaultTemporalExtent.java?rev=1649819&r1=1649818&r2=1649819&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/DefaultTemporalExtent.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/DefaultTemporalExtent.java
[UTF-8] Tue Jan  6 15:07:46 2015
@@ -226,7 +226,7 @@ public class DefaultTemporalExtent exten
      * available on the classpath.</p>
      *
      * @param  envelope The envelope to use for setting this temporal extent.
-     * @throws UnsupportedOperationException if the referencing module is not on the classpath.
+     * @throws UnsupportedOperationException if the referencing module or the temporal module
is not on the classpath.
      * @throws TransformException if the envelope can not be transformed to a temporal extent.
      *
      * @see DefaultExtent#addElements(Envelope)

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/ReferencingUtilities.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/ReferencingUtilities.java?rev=1649819&r1=1649818&r2=1649819&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/ReferencingUtilities.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/ReferencingUtilities.java
[UTF-8] Tue Jan  6 15:07:46 2015
@@ -69,19 +69,19 @@ public final class ReferencingUtilities
      * Greenwich longitude of the {@code expected} prime meridian. The comparison is performed
in unit of the
      * expected prime meridian.
      *
+     * <p>A {@code null} argument is interpreted as "unknown prime meridian". Consequently
this method
+     * unconditionally returns {@code false} if one or both arguments is {@code null}.</p>
+     *
      * @param expected The expected prime meridian, or {@code null}.
      * @param actual The actual prime meridian, or {@code null}.
      * @return {@code true} if both prime meridian have the same Greenwich longitude,
      *         in unit of the expected prime meridian.
      */
     public static boolean isGreenwichLongitudeEquals(final PrimeMeridian expected, final
PrimeMeridian actual) {
-        if (expected == actual) {
-            return true;
-        }
         if (expected == null || actual == null) {
-            return false;
+            return false; // See method javadoc.
         }
-        return epsilonEqual(expected.getGreenwichLongitude(),
+        return (expected == actual) || epsilonEqual(expected.getGreenwichLongitude(),
                 getGreenwichLongitude(actual, expected.getAngularUnit()));
     }
 

Modified: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/ReferencingUtilitiesTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/ReferencingUtilitiesTest.java?rev=1649819&r1=1649818&r2=1649819&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/ReferencingUtilitiesTest.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/ReferencingUtilitiesTest.java
[UTF-8] Tue Jan  6 15:07:46 2015
@@ -54,9 +54,13 @@ public final strictfp class ReferencingU
      */
     @Test
     public void testIsGreenwichLongitudeEquals() {
+        assertFalse(isGreenwichLongitudeEquals(null, null)); // "null" interpreted as "unknown".
+        assertFalse(isGreenwichLongitudeEquals(null, HardCodedDatum.GREENWICH));
+        assertFalse(isGreenwichLongitudeEquals(HardCodedDatum.GREENWICH, null));
         assertFalse(isGreenwichLongitudeEquals(HardCodedDatum.GREENWICH, HardCodedDatum.PARIS));
         assertFalse(isGreenwichLongitudeEquals(HardCodedDatum.PARIS, HardCodedDatum.PARIS_RGS));
         assertFalse(isGreenwichLongitudeEquals(HardCodedDatum.PARIS_RGS, HardCodedDatum.PARIS));
+        assertTrue (isGreenwichLongitudeEquals(HardCodedDatum.PARIS, HardCodedDatum.PARIS));
         /*
          * Test two prime meridians using different units (Paris in grade and Paris in degrees).
          */
@@ -103,6 +107,7 @@ public final strictfp class ReferencingU
         assertNormalizedEqualsWGS84("Shall extract the 2D component.", false, HardCodedCRS.GEOID_4D);
         assertNormalizedEqualsWGS84("Shall build a the 2D component.", true,  HardCodedCRS.WGS84_3D);
         assertNormalizedEqualsWGS84("Shall normalize axis order.",     true,  HardCodedCRS.WGS84_φλ);
+        assertNull(toNormalizedGeographicCRS(null));
     }
 
     /**



Mime
View raw message