sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1635941 [2/2] - in /sis/trunk: ./ core/sis-feature/src/test/java/org/apache/sis/feature/ core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/ core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/ core/sis-meta...
Date Sat, 01 Nov 2014 12:25:48 GMT
Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultResolution.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultResolution.java?rev=1635941&r1=1635940&r2=1635941&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultResolution.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultResolution.java [UTF-8] Sat Nov  1 12:25:46 2014
@@ -24,12 +24,15 @@ import org.opengis.annotation.UML;
 import org.opengis.util.InternationalString;
 import org.opengis.metadata.identification.RepresentativeFraction;
 import org.opengis.metadata.identification.Resolution;
+import org.apache.sis.internal.jaxb.Context;
 import org.apache.sis.internal.jaxb.gco.GO_Distance;
-import org.apache.sis.internal.metadata.MetadataUtilities;
 import org.apache.sis.metadata.iso.ISOMetadata;
 import org.apache.sis.measure.ValueRange;
 import org.apache.sis.util.resources.Messages;
 
+import static org.apache.sis.internal.metadata.MetadataUtilities.warnNonPositiveArgument;
+
+// Branch-specific imports
 import static org.opengis.annotation.Obligation.CONDITIONAL;
 import static org.opengis.annotation.Specification.ISO_19115;
 
@@ -57,7 +60,7 @@ import static org.opengis.annotation.Spe
  * @author  Touraïvane (IRD)
  * @author  Cédric Briançon (Geomatys)
  * @since   0.3 (derived from geotk-2.1)
- * @version 0.3
+ * @version 0.5
  * @module
  *
  * @see AbstractIdentification#getSpatialResolutions()
@@ -139,6 +142,13 @@ public class DefaultResolution extends I
      * {@linkplain #getAngularDistance() angular distance} and {@linkplain #getLevelOfDetail() level of detail}
      * are specified, then the first of those values is taken and the other values are silently discarded.</p>
      *
+     * <div class="note"><b>Note on properties validation:</b>
+     * This constructor does not verify the property values of the given metadata (e.g. whether it contains
+     * unexpected negative values). This is because invalid metadata exist in practice, and verifying their
+     * validity in this copy constructor is often too late. Note that this is not the only hole, as invalid
+     * metadata instances can also be obtained by unmarshalling an invalid XML document.
+     * </div>
+     *
      * @param object The metadata to copy values from, or {@code null} if none.
      *
      * @see #castOrCopy(Resolution)
@@ -191,6 +201,19 @@ public class DefaultResolution extends I
     }
 
     /**
+     * Ensures that the given property is greater than zero.
+     *
+     * @param  property The name of the property to verify.
+     * @param  value The property value, or {@code null}.
+     * @throws IllegalArgumentException if the property is zero or negative and the problem has not been logged.
+     */
+    private static void ensurePositive(final String property, final Double value) throws IllegalArgumentException {
+        if (value != null && !(value > 0)) { // Use '!' for catching NaN.
+            warnNonPositiveArgument(DefaultResolution.class, property, true, value);
+        }
+    }
+
+    /**
      * Sets the properties identified by the {@code code} argument, if non-null.
      * This discards any other properties.
      *
@@ -203,8 +226,8 @@ public class DefaultResolution extends I
             if (newValue == null) {
                 return; // Do not erase the other property.
             }
-            MetadataUtilities.warning(DefaultResolution.class, SETTERS[code-1],
-                    Messages.Keys.DiscardedExclusiveProperty_2, NAMES[property-1], NAMES[code-1]);
+            Context.warningOccured(Context.current(), LOGGER, DefaultResolution.class, SETTERS[code-1],
+                    Messages.class, Messages.Keys.DiscardedExclusiveProperty_2, NAMES[property-1], NAMES[code-1]);
         }
         value = newValue;
         property = code;
@@ -254,9 +277,11 @@ public class DefaultResolution extends I
      * If and only if the {@code newValue} is non-null, then this method automatically
      * discards all other properties.
      *
-     * @param newValue The new distance.
+     * @param newValue The new distance, or {@code null}.
+     * @throws IllegalArgumentException if the given value is NaN, zero or negative.
      */
     public void setDistance(final Double newValue) {
+        ensurePositive("distance", newValue);
         setProperty(DISTANCE, newValue);
     }
 
@@ -280,11 +305,13 @@ public class DefaultResolution extends I
      * If and only if the {@code newValue} is non-null, then this method automatically
      * discards all other properties.
      *
-     * @param newValue The new distance.
+     * @param newValue The new distance, or {@code null}.
+     * @throws IllegalArgumentException if the given value is NaN, zero or negative.
      *
      * @since 0.5
      */
     public void setVertical(final Double newValue) {
+        ensurePositive("vertical", newValue);
         setProperty(VERTICAL, newValue);
     }
 
@@ -308,11 +335,13 @@ public class DefaultResolution extends I
      * If and only if the {@code newValue} is non-null, then this method automatically
      * discards all other properties.
      *
-     * @param newValue The new distance.
+     * @param newValue The new distance, or {@code null}.
+     * @throws IllegalArgumentException if the given value is NaN, zero or negative.
      *
      * @since 0.5
      */
     public void setAngularDistance(final Double newValue) {
+        ensurePositive("angular", newValue);
         setProperty(ANGULAR, newValue);
     }
 

Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/package-info.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/package-info.java?rev=1635941&r1=1635940&r2=1635941&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/package-info.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/package-info.java [UTF-8] Sat Nov  1 12:25:46 2014
@@ -96,7 +96,7 @@
  * @author  Touraïvane (IRD)
  * @author  Cédric Briançon (Geomatys)
  * @since   0.3 (derived from geotk-2.1)
- * @version 0.3
+ * @version 0.5
  * @module
  */
 @XmlSchema(elementFormDefault = XmlNsForm.QUALIFIED, namespace = Namespaces.GMD, xmlns = {

Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/DefaultNominalResolution.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/DefaultNominalResolution.java?rev=1635941&r1=1635940&r2=1635941&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/DefaultNominalResolution.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/DefaultNominalResolution.java [UTF-8] Sat Nov  1 12:25:46 2014
@@ -24,6 +24,8 @@ import org.apache.sis.metadata.iso.ISOMe
 import org.apache.sis.measure.ValueRange;
 import org.apache.sis.xml.Namespaces;
 
+import static org.apache.sis.internal.metadata.MetadataUtilities.warnNonPositiveArgument;
+
 
 /**
  * Distance between consistent parts of (centre, left side, right side) adjacent pixels.
@@ -40,7 +42,7 @@ import org.apache.sis.xml.Namespaces;
  * @author  Cédric Briançon (Geomatys)
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.3 (derived from geotk-3.03)
- * @version 0.3
+ * @version 0.5
  * @module
  */
 @XmlType(name = "LE_NominalResolution_Type", propOrder = {
@@ -77,6 +79,13 @@ public class DefaultNominalResolution ex
      * This is a <cite>shallow</cite> copy constructor, since the other metadata contained in the
      * given object are not recursively copied.
      *
+     * <div class="note"><b>Note on properties validation:</b>
+     * This constructor does not verify the property values of the given metadata (e.g. whether it contains
+     * unexpected negative values). This is because invalid metadata exist in practice, and verifying their
+     * validity in this copy constructor is often too late. Note that this is not the only hole, as invalid
+     * metadata instances can also be obtained by unmarshalling an invalid XML document.
+     * </div>
+     *
      * @param object The metadata to copy values from, or {@code null} if none.
      *
      * @see #castOrCopy(NominalResolution)
@@ -115,6 +124,19 @@ public class DefaultNominalResolution ex
     }
 
     /**
+     * Ensures that the given property is greater than zero.
+     *
+     * @param  property The name of the property to verify.
+     * @param  value The property value, or {@code null}.
+     * @throws IllegalArgumentException if the property is zero or negative and the problem has not been logged.
+     */
+    private static void ensurePositive(final String property, final Double value) throws IllegalArgumentException {
+        if (value != null && !(value > 0)) { // Use '!' for catching NaN.
+            warnNonPositiveArgument(DefaultNominalResolution.class, property, true, value);
+        }
+    }
+
+    /**
      * Returns the distance between consistent parts of (centre, left side, right side)
      * adjacent pixels in the scan plane.
      *
@@ -132,9 +154,11 @@ public class DefaultNominalResolution ex
      * pixels in the scan plane.
      *
      * @param newValue The new scanning resolution value.
+     * @throws IllegalArgumentException if the given value is NaN, zero or negative.
      */
     public void setScanningResolution(final Double newValue) {
         checkWritePermission();
+        ensurePositive("scanningResolution", newValue);
         scanningResolution = newValue;
     }
 
@@ -156,9 +180,11 @@ public class DefaultNominalResolution ex
      * in the object space.
      *
      * @param newValue The new ground resolution value.
+     * @throws IllegalArgumentException if the given value is NaN, zero or negative.
      */
     public void setGroundResolution(final Double newValue) {
         checkWritePermission();
+        ensurePositive("groundResolution", newValue);
         groundResolution = newValue;
     }
 }

Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/package-info.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/package-info.java?rev=1635941&r1=1635940&r2=1635941&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/package-info.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/package-info.java [UTF-8] Sat Nov  1 12:25:46 2014
@@ -66,7 +66,7 @@
  * @author  Touraïvane (IRD)
  * @author  Cédric Briançon (Geomatys)
  * @since   0.3 (derived from geotk-2.1)
- * @version 0.3
+ * @version 0.5
  * @module
  */
 @XmlSchema(elementFormDefault = XmlNsForm.QUALIFIED, namespace = Namespaces.GMD, xmlns = {

Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/maintenance/DefaultScopeDescription.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/maintenance/DefaultScopeDescription.java?rev=1635941&r1=1635940&r2=1635941&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/maintenance/DefaultScopeDescription.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/maintenance/DefaultScopeDescription.java [UTF-8] Sat Nov  1 12:25:46 2014
@@ -25,11 +25,11 @@ import org.opengis.metadata.maintenance.
 import org.opengis.metadata.maintenance.ScopeDescription;
 import org.apache.sis.metadata.iso.ISOMetadata;
 import org.apache.sis.internal.metadata.ExcludedSet;
-import org.apache.sis.internal.metadata.MetadataUtilities;
+import org.apache.sis.internal.jaxb.Context;
+import org.apache.sis.internal.system.Semaphores;
 import org.apache.sis.util.collection.CheckedContainer;
 import org.apache.sis.util.resources.Messages;
 
-import static org.apache.sis.internal.jaxb.Context.isMarshalling;
 import static org.apache.sis.util.collection.Containers.isNullOrEmpty;
 
 // Branch-dependent imports
@@ -224,7 +224,8 @@ public class DefaultScopeDescription ext
             if (property == code) {
                 return cast(value, type);
             } else if (!(value instanceof Set) || !((Set<?>) value).isEmpty()) {
-                return isMarshalling() ? null : new ExcludedSet<E>(NAMES[code-1], NAMES[property-1]);
+                return Semaphores.query(Semaphores.NULL_COLLECTION)
+                       ? null : new ExcludedSet<E>(NAMES[code-1], NAMES[property-1]);
             }
         }
         // Unconditionally create a new set, because the
@@ -262,8 +263,8 @@ public class DefaultScopeDescription ext
      */
     private void warningOnOverwrite(final byte code) {
         if (value != null && property != code) {
-            MetadataUtilities.warning(DefaultScopeDescription.class, SETTERS[code-1],
-                    Messages.Keys.DiscardedExclusiveProperty_2, NAMES[property-1], NAMES[code-1]);
+            Context.warningOccured(Context.current(), LOGGER, DefaultScopeDescription.class, SETTERS[code-1],
+                    Messages.class, Messages.Keys.DiscardedExclusiveProperty_2, NAMES[property-1], NAMES[code-1]);
         }
     }
 

Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/maintenance/package-info.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/maintenance/package-info.java?rev=1635941&r1=1635940&r2=1635941&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/maintenance/package-info.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/maintenance/package-info.java [UTF-8] Sat Nov  1 12:25:46 2014
@@ -63,7 +63,7 @@
  * @author  Touraïvane (IRD)
  * @author  Cédric Briançon (Geomatys)
  * @since   0.3 (derived from geotk-2.1)
- * @version 0.3
+ * @version 0.5
  * @module
  */
 @XmlSchema(elementFormDefault = XmlNsForm.QUALIFIED, namespace = Namespaces.GMD, xmlns = {

Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractElement.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractElement.java?rev=1635941&r1=1635940&r2=1635941&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractElement.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractElement.java [UTF-8] Sat Nov  1 12:25:46 2014
@@ -38,11 +38,11 @@ import org.opengis.metadata.quality.Logi
 import org.opengis.metadata.quality.EvaluationMethodType;
 import org.opengis.util.InternationalString;
 import org.apache.sis.metadata.iso.ISOMetadata;
+import org.apache.sis.internal.system.Semaphores;
 import org.apache.sis.util.collection.CheckedContainer;
 import org.apache.sis.util.resources.Errors;
 
 import static org.apache.sis.util.collection.Containers.isNullOrEmpty;
-import static org.apache.sis.internal.jaxb.Context.isMarshalling;
 
 
 /**
@@ -517,7 +517,7 @@ public class AbstractElement extends ISO
     @Override
     @XmlElement(name = "dateTime")
     public Collection<Date> getDates() {
-        if (isMarshalling()) {
+        if (Semaphores.query(Semaphores.NULL_COLLECTION)) {
             return isNullOrEmpty(dates) ? null : dates;
         }
         if (dates == null) {

Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/DefaultDimension.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/DefaultDimension.java?rev=1635941&r1=1635940&r2=1635941&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/DefaultDimension.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/DefaultDimension.java [UTF-8] Sat Nov  1 12:25:46 2014
@@ -27,7 +27,11 @@ import org.opengis.metadata.spatial.Dime
 import org.apache.sis.internal.jaxb.gco.GO_Measure;
 import org.apache.sis.metadata.iso.ISOMetadata;
 import org.apache.sis.measure.ValueRange;
+import org.apache.sis.util.ArgumentChecks;
 
+import static org.apache.sis.internal.metadata.MetadataUtilities.warnNonPositiveArgument;
+
+// Branch-specific imports
 import static org.opengis.annotation.Obligation.OPTIONAL;
 import static org.opengis.annotation.Specification.ISO_19115;
 
@@ -102,10 +106,12 @@ public class DefaultDimension extends IS
     /**
      * Creates a dimension initialized to the given type and size.
      *
-     * @param dimensionName The name of the axis, or {@code null} if none, or {@code null} if none.
-     * @param dimensionSize The number of elements along the axis, or {@code null} if none.
+     * @param  dimensionName The name of the axis, or {@code null} if none, or {@code null} if none.
+     * @param  dimensionSize The number of elements along the axis, or {@code null} if none.
+     * @throws IllegalArgumentException if {@code dimensionSize} is negative.
      */
     public DefaultDimension(final DimensionNameType dimensionName, final int dimensionSize) {
+        ArgumentChecks.ensurePositive("dimensionSize", dimensionSize);
         this.dimensionName = dimensionName;
         this.dimensionSize = dimensionSize;
     }
@@ -115,6 +121,13 @@ public class DefaultDimension extends IS
      * This is a <cite>shallow</cite> copy constructor, since the other metadata contained in the
      * given object are not recursively copied.
      *
+     * <div class="note"><b>Note on properties validation:</b>
+     * This constructor does not verify the property values of the given metadata (e.g. whether it contains
+     * unexpected negative values). This is because invalid metadata exist in practice, and verifying their
+     * validity in this copy constructor is often too late. Note that this is not the only hole, as invalid
+     * metadata instances can also be obtained by unmarshalling an invalid XML document.
+     * </div>
+     *
      * @param object The metadata to copy values from, or {@code null} if none.
      *
      * @see #castOrCopy(Dimension)
@@ -184,7 +197,7 @@ public class DefaultDimension extends IS
      * @return Number of elements along the axis, or {@code null}.
      */
     @Override
-    @ValueRange(minimum=0)
+    @ValueRange(minimum = 0)
     @XmlElement(name = "dimensionSize", required = true)
     public Integer getDimensionSize() {
         return dimensionSize;
@@ -193,10 +206,14 @@ public class DefaultDimension extends IS
     /**
      * Sets the number of elements along the axis.
      *
-     * @param newValue The new dimension size.
+     * @param newValue The new dimension size, or {@code null}.
+     * @throws IllegalArgumentException if the given value is negative.
      */
     public void setDimensionSize(final Integer newValue) {
         checkWritePermission();
+        if (newValue != null && newValue < 0) {
+            warnNonPositiveArgument(DefaultDimension.class, "dimensionSize", false, newValue);
+        }
         dimensionSize = newValue;
     }
 
@@ -216,10 +233,14 @@ public class DefaultDimension extends IS
     /**
      * Sets the degree of detail in the grid dataset.
      *
-     * @param newValue The new resolution.
+     * @param newValue The new resolution, or {@code null}.
+     * @throws IllegalArgumentException if the given value is NaN, zero or negative.
      */
     public void setResolution(final Double newValue) {
         checkWritePermission();
+        if (newValue != null && !(newValue > 0)) { // Use '!' for catching NaN.
+            warnNonPositiveArgument(DefaultDimension.class, "dimensionSize", true, newValue);
+        }
         resolution = newValue;
     }
 

Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/DefaultGeometricObjects.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/DefaultGeometricObjects.java?rev=1635941&r1=1635940&r2=1635941&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/DefaultGeometricObjects.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/DefaultGeometricObjects.java [UTF-8] Sat Nov  1 12:25:46 2014
@@ -24,6 +24,8 @@ import org.opengis.metadata.spatial.Geom
 import org.apache.sis.measure.ValueRange;
 import org.apache.sis.metadata.iso.ISOMetadata;
 
+import static org.apache.sis.internal.metadata.MetadataUtilities.warnNonPositiveArgument;
+
 
 /**
  * Number of objects, listed by geometric object type, used in the dataset.
@@ -41,7 +43,7 @@ import org.apache.sis.metadata.iso.ISOMe
  * @author  Touraïvane (IRD)
  * @author  Cédric Briançon (Geomatys)
  * @since   0.3 (derived from geotk-2.1)
- * @version 0.3
+ * @version 0.5
  * @module
  */
 @XmlType(name = "MD_GeometricObjects_Type", propOrder = {
@@ -86,6 +88,13 @@ public class DefaultGeometricObjects ext
      * This is a <cite>shallow</cite> copy constructor, since the other metadata contained in the
      * given object are not recursively copied.
      *
+     * <div class="note"><b>Note on properties validation:</b>
+     * This constructor does not verify the property values of the given metadata (e.g. whether it contains
+     * unexpected negative values). This is because invalid metadata exist in practice, and verifying their
+     * validity in this copy constructor is often too late. Note that this is not the only hole, as invalid
+     * metadata instances can also be obtained by unmarshalling an invalid XML document.
+     * </div>
+     *
      * @param object The metadata to copy values from, or {@code null} if none.
      *
      * @see #castOrCopy(GeometricObjects)
@@ -159,10 +168,14 @@ public class DefaultGeometricObjects ext
     /**
      * Sets the total number of the point or vector object type occurring in the dataset.
      *
-     * @param newValue The geometric object count.
+     * @param newValue The geometric object count, or {@code null}.
+     * @throws IllegalArgumentException if the given value is zero or negative.
      */
     public void setGeometricObjectCount(final Integer newValue) {
         checkWritePermission();
+        if (newValue != null && newValue <= 0) {
+            warnNonPositiveArgument(DefaultGeometricObjects.class, "geometricObjectCount", true, newValue);
+        }
         geometricObjectCount = newValue;
     }
 }

Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/DefaultGeorectified.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/DefaultGeorectified.java?rev=1635941&r1=1635940&r2=1635941&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/DefaultGeorectified.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/DefaultGeorectified.java [UTF-8] Sat Nov  1 12:25:46 2014
@@ -27,7 +27,7 @@ import org.opengis.metadata.spatial.Geor
 import org.opengis.metadata.spatial.PixelOrientation;
 import org.opengis.geometry.primitive.Point;
 import org.opengis.util.InternationalString;
-import org.apache.sis.internal.metadata.MetadataUtilities;
+import org.apache.sis.internal.jaxb.Context;
 import org.apache.sis.util.resources.Messages;
 import org.apache.sis.xml.Namespaces;
 
@@ -211,8 +211,8 @@ public class DefaultGeorectified extends
             booleans |= CHECK_POINT_MASK;
         } else {
             if (checkPointDescription != null && (booleans & CHECK_POINT_MASK) != 0) {
-                MetadataUtilities.warning(DefaultGeorectified.class, "setCheckPointAvailable",
-                        Messages.Keys.PropertyHiddenBy_2, "checkPointDescription", "checkPointAvailability");
+                Context.warningOccured(Context.current(), LOGGER, DefaultGeorectified.class, "setCheckPointAvailable",
+                        Messages.class, Messages.Keys.PropertyHiddenBy_2, "checkPointDescription", "checkPointAvailability");
             }
             booleans &= ~CHECK_POINT_MASK;
         }

Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/DefaultGridSpatialRepresentation.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/DefaultGridSpatialRepresentation.java?rev=1635941&r1=1635940&r2=1635941&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/DefaultGridSpatialRepresentation.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/DefaultGridSpatialRepresentation.java [UTF-8] Sat Nov  1 12:25:46 2014
@@ -28,6 +28,8 @@ import org.opengis.metadata.spatial.Geor
 import org.opengis.metadata.spatial.GridSpatialRepresentation;
 import org.apache.sis.measure.ValueRange;
 
+import static org.apache.sis.internal.metadata.MetadataUtilities.warnNonPositiveArgument;
+
 
 /**
  * Basic information required to uniquely identify a resource or resources.
@@ -45,7 +47,7 @@ import org.apache.sis.measure.ValueRange
  * @author  Touraïvane (IRD)
  * @author  Cédric Briançon (Geomatys)
  * @since   0.3 (derived from geotk-2.1)
- * @version 0.3
+ * @version 0.5
  * @module
  */
 @XmlType(name = "MD_GridSpatialRepresentation_Type", propOrder = {
@@ -113,6 +115,13 @@ public class DefaultGridSpatialRepresent
      * This is a <cite>shallow</cite> copy constructor, since the other metadata contained in the
      * given object are not recursively copied.
      *
+     * <div class="note"><b>Note on properties validation:</b>
+     * This constructor does not verify the property values of the given metadata (e.g. whether it contains
+     * unexpected negative values). This is because invalid metadata exist in practice, and verifying their
+     * validity in this copy constructor is often too late. Note that this is not the only hole, as invalid
+     * metadata instances can also be obtained by unmarshalling an invalid XML document.
+     * </div>
+     *
      * @param object The metadata to copy values from, or {@code null} if none.
      *
      * @see #castOrCopy(GridSpatialRepresentation)
@@ -172,7 +181,7 @@ public class DefaultGridSpatialRepresent
      * @return Number of independent spatial-temporal axes, or {@code null}.
      */
     @Override
-    @ValueRange(minimum=0)
+    @ValueRange(minimum = 0)
     @XmlElement(name = "numberOfDimensions", required = true)
     public Integer getNumberOfDimensions() {
         return numberOfDimensions;
@@ -181,10 +190,14 @@ public class DefaultGridSpatialRepresent
     /**
      * Sets the number of independent spatial-temporal axes.
      *
-     * @param newValue The new number of dimension.
+     * @param newValue The new number of dimension, or {@code null}.
+     * @throws IllegalArgumentException if the given value is negative.
      */
     public void setNumberOfDimensions(final Integer newValue) {
         checkWritePermission();
+        if (newValue != null && newValue < 0) {
+            warnNonPositiveArgument(DefaultGridSpatialRepresentation.class, "numberOfDimensions", false, newValue);
+        }
         numberOfDimensions = newValue;
     }
 

Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/package-info.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/package-info.java?rev=1635941&r1=1635940&r2=1635941&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/package-info.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/package-info.java [UTF-8] Sat Nov  1 12:25:46 2014
@@ -84,7 +84,7 @@
  * @author  Touraïvane (IRD)
  * @author  Cédric Briançon (Geomatys)
  * @since   0.3 (derived from geotk-2.1)
- * @version 0.3
+ * @version 0.5
  * @module
  */
 @XmlSchema(elementFormDefault = XmlNsForm.QUALIFIED, namespace = Namespaces.GMD, xmlns = {

Modified: sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/metadata/PropertyAccessorTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/metadata/PropertyAccessorTest.java?rev=1635941&r1=1635940&r2=1635941&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/metadata/PropertyAccessorTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/metadata/PropertyAccessorTest.java [UTF-8] Sat Nov  1 12:25:46 2014
@@ -366,7 +366,6 @@ public final strictfp class PropertyAcce
      */
     @Test
     @DependsOnMethod("testSet")
-    @org.junit.Ignore("Pending completion of ISO 19115:2014 upgrade.")
     public void testSetDeprecated() {
         final PropertyAccessor accessor = new PropertyAccessor(HardCodedCitations.ISO_19115,
                 CoverageDescription.class, DefaultCoverageDescription.class);

Modified: sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/APIVerifier.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/APIVerifier.java?rev=1635941&r1=1635940&r2=1635941&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/APIVerifier.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/APIVerifier.java [UTF-8] Sat Nov  1 12:25:46 2014
@@ -152,20 +152,21 @@ public final strictfp class APIVerifier 
      *
      * @param  releasedJAR Path to the JAR file of the GeoAPI interfaces implemented by the stable version of Apache SIS.
      * @param  snapshotJAR Path to the JAR file of the GeoAPI interfaces that we would implement if it was released.
+     * @param  unitsJAR    Path to the JAR file containing the {@code Unit} class. This is a GeoAPI dependency.
      * @param  out Where to write the API differences between {@code releasedJAR} and {@code snapshotJAR}.
-     * @throws ReflectiveOperationException if an error occurred while processing the JAR file content.
-     * @throws IOException if an error occurred while reading the JAR files or writing to {@code out}.
+     * @throws Exception if an error occurred while processing the JAR file content.
      */
-    public static void listAPIChanges(final File releasedJAR, final File snapshotJAR, final Appendable out)
-            throws Exception
+    public static void listAPIChanges(final File releasedJAR, final File snapshotJAR, final File unitsJAR,
+            final Appendable out) throws Exception
     {
         final String lineSeparator = JDK7.lineSeparator();
         final Map<String,Boolean> methodChanges = new TreeMap<String,Boolean>();
         final List<String> incompatibleChanges = new ArrayList<String>();
-        final ClassLoader parent = APIVerifier.class.getClassLoader();
+        final ClassLoader parent = APIVerifier.class.getClassLoader().getParent();
+        final URL dependency = unitsJAR.toURI().toURL();
         final JarFile newJARContent = new JarFile(snapshotJAR);
-        final URLClassLoader oldAPI = new URLClassLoader(new URL[] {releasedJAR.toURI().toURL()}, parent);
-        final URLClassLoader newAPI = new URLClassLoader(new URL[] {snapshotJAR.toURI().toURL()}, parent);
+        final URLClassLoader oldAPI = new URLClassLoader(new URL[] {releasedJAR.toURI().toURL(), dependency}, parent);
+        final URLClassLoader newAPI = new URLClassLoader(new URL[] {snapshotJAR.toURI().toURL(), dependency}, parent);
         try {
             final Class<? extends Annotation> newUML = Class.forName("org.opengis.annotation.UML", false, newAPI).asSubclass(Annotation.class);
             final Method newIdentifier = newUML.getMethod("identifier", (Class[]) null);

Modified: sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/extent/DefaultGeographicBoundingBoxTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/extent/DefaultGeographicBoundingBoxTest.java?rev=1635941&r1=1635940&r2=1635941&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/extent/DefaultGeographicBoundingBoxTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/extent/DefaultGeographicBoundingBoxTest.java [UTF-8] Sat Nov  1 12:25:46 2014
@@ -16,7 +16,10 @@
  */
 package org.apache.sis.metadata.iso.extent;
 
+import java.util.Map;
 import org.opengis.metadata.extent.GeographicBoundingBox;
+import org.apache.sis.measure.Latitude;
+import org.apache.sis.measure.Longitude;
 import org.apache.sis.test.DependsOnMethod;
 import org.apache.sis.test.TestCase;
 import org.junit.Test;
@@ -30,7 +33,7 @@ import static org.junit.Assert.*;
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.4
- * @version 0.4
+ * @version 0.5
  * @module
  */
 public final strictfp class DefaultGeographicBoundingBoxTest extends TestCase {
@@ -394,4 +397,29 @@ public final strictfp class DefaultGeogr
             b1.intersect(b2);
         }
     }
+
+    /**
+     * Tests {@link DefaultGeographicBoundingBox#asMap()}. The longitude and latitude values are
+     * expected to be represented by {@link Longitude} and {@link Latitude} objects respectively.
+     *
+     * @since 0.5
+     */
+    @Test
+    public void testAsMap() {
+        final Map<String, Object> map = new DefaultGeographicBoundingBox(-40, 50, -20, 45).asMap();
+        assertArrayEquals(new String[] {
+            "westBoundLongitude",
+            "eastBoundLongitude",
+            "southBoundLatitude",
+            "northBoundLatitude",
+            "inclusion"
+        }, map.keySet().toArray());
+        assertArrayEquals(new Object[] {
+            new Longitude(-40),
+            new Longitude(+50),
+            new Latitude (-20),
+            new Latitude (+45),
+            Boolean.TRUE
+        }, map.values().toArray());
+    }
 }

Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/jaxb/referencing/SecondDefiningParameter.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/jaxb/referencing/SecondDefiningParameter.java?rev=1635941&r1=1635940&r2=1635941&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/jaxb/referencing/SecondDefiningParameter.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/jaxb/referencing/SecondDefiningParameter.java [UTF-8] Sat Nov  1 12:25:46 2014
@@ -23,6 +23,7 @@ import org.opengis.referencing.datum.Ell
 import org.apache.sis.xml.Namespaces;
 import org.apache.sis.internal.jaxb.Context;
 import org.apache.sis.internal.jaxb.gco.Measure;
+import org.apache.sis.internal.metadata.ReferencingUtilities;
 import org.apache.sis.util.resources.Errors;
 
 
@@ -131,7 +132,8 @@ public final class SecondDefiningParamet
      */
     public void setInverseFlattening(final Measure measure) {
         if (measure.setUnit(Unit.ONE)) {
-            Context.warningOccured(Context.current(), SecondDefiningParameter.class, "setInverseFlattening",
+            Context.warningOccured(Context.current(), ReferencingUtilities.LOGGER,
+                    SecondDefiningParameter.class, "setInverseFlattening",
                     Errors.class, Errors.Keys.IncompatiblePropertyValue_1, "uom");
         }
         this.measure = measure;

Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/AbstractIdentifiedObject.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/AbstractIdentifiedObject.java?rev=1635941&r1=1635940&r2=1635941&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/AbstractIdentifiedObject.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/AbstractIdentifiedObject.java [UTF-8] Sat Nov  1 12:25:46 2014
@@ -62,7 +62,7 @@ import static org.apache.sis.internal.ut
 import static org.apache.sis.internal.util.CollectionsExt.nonEmpty;
 import static org.apache.sis.internal.util.CollectionsExt.immutableSet;
 import static org.apache.sis.internal.util.Utilities.appendUnicodeIdentifier;
-import static org.apache.sis.internal.metadata.MetadataUtilities.canSetProperty;
+import static org.apache.sis.internal.metadata.ReferencingUtilities.canSetProperty;
 
 // Branch-dependent imports
 import org.apache.sis.internal.jdk7.Objects;
@@ -510,7 +510,9 @@ public class AbstractIdentifiedObject ex
     private void setIdentifier(final Code identifier) {
         if (identifier != null) {
             final ReferenceIdentifier id = identifier.getIdentifier();
-            if (id != null && canSetProperty("identifier", identifiers != null)) {
+            if (id != null && canSetProperty(AbstractIdentifiedObject.class,
+                    "setIdentifier", "identifier", identifiers != null))
+            {
                 identifiers = Collections.singleton(id);
             }
         }

Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/AbstractCRS.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/AbstractCRS.java?rev=1635941&r1=1635940&r2=1635941&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/AbstractCRS.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/AbstractCRS.java [UTF-8] Sat Nov  1 12:25:46 2014
@@ -39,7 +39,7 @@ import org.apache.sis.io.wkt.Formatter;
 import static org.apache.sis.util.Utilities.deepEquals;
 import static org.apache.sis.util.ArgumentChecks.ensureNonNull;
 import static org.apache.sis.internal.referencing.WKTUtilities.toFormattable;
-import static org.apache.sis.internal.metadata.MetadataUtilities.canSetProperty;
+import static org.apache.sis.internal.metadata.ReferencingUtilities.canSetProperty;
 
 // Branch-dependent imports
 import org.apache.sis.internal.jdk7.Objects;
@@ -312,7 +312,7 @@ public class AbstractCRS extends Abstrac
      * @throws IllegalStateException If the coordinate system has already been set.
      */
     final void setCoordinateSystem(final String name, final CoordinateSystem cs) {
-        if (cs != null && canSetProperty(name, coordinateSystem != null)) {
+        if (cs != null && canSetProperty(AbstractCRS.class, "setCoordinateSystem", name, coordinateSystem != null)) {
             coordinateSystem = cs;
         }
     }

Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultCoordinateSystemAxis.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultCoordinateSystemAxis.java?rev=1635941&r1=1635940&r2=1635941&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultCoordinateSystemAxis.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultCoordinateSystemAxis.java [UTF-8] Sat Nov  1 12:25:46 2014
@@ -48,6 +48,7 @@ import org.apache.sis.internal.jaxb.Cont
 import org.apache.sis.io.wkt.Formatter;
 import org.apache.sis.io.wkt.Convention;
 import org.apache.sis.io.wkt.ElementKind;
+import org.apache.sis.internal.metadata.ReferencingUtilities;
 
 import static java.lang.Double.doubleToLongBits;
 import static java.lang.Double.NEGATIVE_INFINITY;
@@ -55,7 +56,6 @@ import static java.lang.Double.POSITIVE_
 import static org.apache.sis.util.ArgumentChecks.*;
 import static org.apache.sis.util.CharSequences.trimWhitespaces;
 import static org.apache.sis.util.collection.Containers.property;
-import static org.apache.sis.internal.metadata.MetadataUtilities.canSetProperty;
 
 // Branch-dependent imports
 import org.apache.sis.internal.jdk7.Objects;
@@ -457,7 +457,9 @@ public class DefaultCoordinateSystemAxis
      * Invoked by JAXB at unmarshalling time for setting the minimum value.
      */
     private void setMinimum(final Double value) {
-        if (value != null && canSetProperty("minimumValue", minimumValue != NEGATIVE_INFINITY)) {
+        if (value != null && ReferencingUtilities.canSetProperty(DefaultCoordinateSystemAxis.class,
+                "setMinimum", "minimumValue", minimumValue != NEGATIVE_INFINITY))
+        {
             final double min = value; // Apply unboxing.
             if (min < maximumValue) {
                 minimumValue = min;
@@ -491,7 +493,9 @@ public class DefaultCoordinateSystemAxis
      * Invoked by JAXB at unmarshalling time for setting the maximum value.
      */
     private void setMaximum(final Double value) {
-        if (value != null && canSetProperty("maximumValue", maximumValue != POSITIVE_INFINITY)) {
+        if (value != null && ReferencingUtilities.canSetProperty(DefaultCoordinateSystemAxis.class,
+                "setMaximum", "maximumValue", maximumValue != POSITIVE_INFINITY))
+        {
             final double max = value; // Apply unboxing.
             if (max > minimumValue) {
                 maximumValue = max;
@@ -509,7 +513,7 @@ public class DefaultCoordinateSystemAxis
      * @param value The invalid value.
      */
     private static void outOfRange(final String name, final Double value) {
-        Context.warningOccured(Context.current(), DefaultCoordinateSystemAxis.class, name,
+        Context.warningOccured(Context.current(), ReferencingUtilities.LOGGER, DefaultCoordinateSystemAxis.class, name,
                 Errors.class, Errors.Keys.InconsistentAttribute_2, name, value);
     }
 

Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/AbstractDatum.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/AbstractDatum.java?rev=1635941&r1=1635940&r2=1635941&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/AbstractDatum.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/AbstractDatum.java [UTF-8] Sat Nov  1 12:25:46 2014
@@ -35,7 +35,7 @@ import org.apache.sis.internal.metadata.
 
 import static org.apache.sis.util.Utilities.deepEquals;
 import static org.apache.sis.util.collection.Containers.property;
-import static org.apache.sis.internal.metadata.MetadataUtilities.canSetProperty;
+import static org.apache.sis.internal.metadata.ReferencingUtilities.canSetProperty;
 
 // Branch-dependent imports
 import org.apache.sis.internal.jdk7.Objects;
@@ -306,7 +306,9 @@ public class AbstractDatum extends Abstr
      * Invoked by JAXB only at unmarshalling time.
      */
     private void setRealizationEpoch(final Date value) {
-        if (value != null && canSetProperty("realizationEpoch", realizationEpoch != Long.MIN_VALUE)) {
+        if (value != null && canSetProperty(AbstractDatum.class,
+                "setRealizationEpoch", "realizationEpoch", realizationEpoch != Long.MIN_VALUE))
+        {
             realizationEpoch = value.getTime();
         }
     }

Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultEllipsoid.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultEllipsoid.java?rev=1635941&r1=1635940&r2=1635941&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultEllipsoid.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultEllipsoid.java [UTF-8] Sat Nov  1 12:25:46 2014
@@ -33,6 +33,7 @@ import org.apache.sis.internal.util.Nume
 import org.apache.sis.internal.jaxb.Context;
 import org.apache.sis.internal.jaxb.gco.Measure;
 import org.apache.sis.internal.jaxb.referencing.SecondDefiningParameter;
+import org.apache.sis.internal.metadata.ReferencingUtilities;
 import org.apache.sis.internal.referencing.Formulas;
 import org.apache.sis.referencing.IdentifiedObjects;
 import org.apache.sis.referencing.AbstractIdentifiedObject;
@@ -579,7 +580,7 @@ public class DefaultEllipsoid extends Ab
      */
     private static void warnDuplicated(final String element) {
          // We cheat a bit for the "unmarshal" method name since there is not such method...
-        Context.warningOccured(Context.current(), DefaultEllipsoid.class, "unmarshal",
+        Context.warningOccured(Context.current(), ReferencingUtilities.LOGGER, DefaultEllipsoid.class, "unmarshal",
                 Errors.class, Errors.Keys.DuplicatedElement_1, element);
     }
 

Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultPrimeMeridian.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultPrimeMeridian.java?rev=1635941&r1=1635940&r2=1635941&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultPrimeMeridian.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultPrimeMeridian.java [UTF-8] Sat Nov  1 12:25:46 2014
@@ -36,7 +36,7 @@ import org.apache.sis.util.ComparisonMod
 
 import static org.apache.sis.util.ArgumentChecks.ensureFinite;
 import static org.apache.sis.util.ArgumentChecks.ensureNonNull;
-import static org.apache.sis.internal.metadata.MetadataUtilities.canSetProperty;
+import static org.apache.sis.internal.metadata.ReferencingUtilities.canSetProperty;
 
 // Branch-dependent imports
 import org.apache.sis.internal.jdk7.Objects;
@@ -262,7 +262,9 @@ public class DefaultPrimeMeridian extend
      * Invoked by JAXB for setting the Greenwich longitude and its unit of measurement.
      */
     private void setGreenwichMeasure(final Measure measure) {
-        if (measure != null && canSetProperty("greenwichLongitude", greenwichLongitude != 0 || angularUnit != null)) {
+        if (measure != null && canSetProperty(DefaultPrimeMeridian.class,
+                "setGreenwichMeasure", "greenwichLongitude", greenwichLongitude != 0 || angularUnit != null))
+        {
             greenwichLongitude = measure.value;
             angularUnit = measure.getUnit(Angle.class);
             if (angularUnit == null) {

Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultTemporalDatum.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultTemporalDatum.java?rev=1635941&r1=1635940&r2=1635941&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultTemporalDatum.java (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultTemporalDatum.java Sat Nov  1 12:25:46 2014
@@ -33,7 +33,7 @@ import org.apache.sis.io.wkt.Formatter;
 import org.apache.sis.io.wkt.FormattableObject;
 
 import static org.apache.sis.util.ArgumentChecks.ensureNonNull;
-import static org.apache.sis.internal.metadata.MetadataUtilities.canSetProperty;
+import static org.apache.sis.internal.metadata.ReferencingUtilities.canSetProperty;
 
 // Branch-dependent imports
 import org.apache.sis.internal.jdk7.Objects;
@@ -232,7 +232,9 @@ public class DefaultTemporalDatum extend
      * Invoked by JAXB only at unmarshalling time.
      */
     private void setOrigin(final Date value) {
-        if (value != null && canSetProperty("origin", origin != Long.MIN_VALUE)) {
+        if (value != null && canSetProperty(DefaultTemporalDatum.class,
+                "setOrigin", "origin", origin != Long.MIN_VALUE))
+        {
             origin = value.getTime();
         }
     }

Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultVerticalDatum.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultVerticalDatum.java?rev=1635941&r1=1635940&r2=1635941&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultVerticalDatum.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultVerticalDatum.java [UTF-8] Sat Nov  1 12:25:46 2014
@@ -32,7 +32,7 @@ import org.apache.sis.internal.jaxb.Lega
 import org.apache.sis.internal.referencing.VerticalDatumTypes;
 
 import static org.apache.sis.util.ArgumentChecks.ensureNonNull;
-import static org.apache.sis.internal.metadata.MetadataUtilities.canSetProperty;
+import static org.apache.sis.internal.metadata.ReferencingUtilities.canSetProperty;
 
 // Branch-dependent imports
 import org.apache.sis.internal.jdk7.Objects;
@@ -263,7 +263,7 @@ public class DefaultVerticalDatum extend
      * Invoked by JAXB only. The vertical datum type is set only if it has not already been specified.
      */
     private void setTypeElement(final VerticalDatumType t) {
-        if (t != null && canSetProperty("verticalDatumType", type != null)) {
+        if (t != null && canSetProperty(DefaultVerticalDatum.class, "setTypeElement", "verticalDatumType", type != null)) {
             type = t;
         }
     }

Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/ConcatenatedTransform.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/ConcatenatedTransform.java?rev=1635941&r1=1635940&r2=1635941&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/ConcatenatedTransform.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/ConcatenatedTransform.java [UTF-8] Sat Nov  1 12:25:46 2014
@@ -32,7 +32,7 @@ import org.opengis.referencing.operation
 import org.apache.sis.parameter.Parameterized;
 import org.apache.sis.referencing.operation.matrix.Matrices;
 import org.apache.sis.referencing.operation.matrix.MatrixSIS;
-import org.apache.sis.internal.referencing.Semaphores;
+import org.apache.sis.internal.system.Semaphores;
 import org.apache.sis.util.Classes;
 import org.apache.sis.util.LenientComparable;
 import org.apache.sis.util.ComparisonMode;

Modified: sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/Context.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/Context.java?rev=1635941&r1=1635940&r2=1635941&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/Context.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/Context.java [UTF-8] Sat Nov  1 12:25:46 2014
@@ -20,6 +20,7 @@ import java.util.Map;
 import java.util.Locale;
 import java.util.TimeZone;
 import java.util.logging.Level;
+import java.util.logging.Logger;
 import java.util.logging.LogRecord;
 import org.apache.sis.util.Version;
 import org.apache.sis.util.Exceptions;
@@ -28,6 +29,7 @@ import org.apache.sis.util.logging.Warni
 import org.apache.sis.util.resources.Errors;
 import org.apache.sis.util.resources.Messages;
 import org.apache.sis.util.resources.IndexedResourceBundle;
+import org.apache.sis.internal.system.Semaphores;
 import org.apache.sis.xml.MarshalContext;
 import org.apache.sis.xml.ValueConverter;
 import org.apache.sis.xml.ReferenceResolver;
@@ -46,7 +48,7 @@ import org.apache.sis.xml.ReferenceResol
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.3 (derived from geotk-3.07)
- * @version 0.4
+ * @version 0.5
  * @module
  */
 public final class Context extends MarshalContext {
@@ -85,6 +87,11 @@ public final class Context extends Marsh
     public static final int SUBSTITUTE_MIMETYPE = 16;
 
     /**
+     * Bit where to store whether {@link #finish()} shall invoke {@code Semaphores.clear(Semaphores.NULL_COLLECTION)}.
+     */
+    private static final int CLEAR_SEMAPHORE = 32;
+
+    /**
      * The thread-local context. Elements are created in the constructor, and removed in a
      * {@code finally} block by the {@link #finish()} method. This {@code ThreadLocal} shall
      * not contain any value when no (un)marshalling is in progress.
@@ -92,6 +99,13 @@ public final class Context extends Marsh
     private static final ThreadLocal<Context> CURRENT = new ThreadLocal<Context>();
 
     /**
+     * The logger to use for warnings that are specific to XML.
+     *
+     * @see org.apache.sis.metadata.iso.ISOMetadata#LOGGER
+     */
+    public static final Logger LOGGER = Logging.getLogger("org.apache.sis.xml");
+
+    /**
      * Various boolean attributes determines by the above static constants.
      */
     private int bitMasks;
@@ -178,6 +192,11 @@ public final class Context extends Marsh
         this.warningListener = warningListener;
         previous = current();
         CURRENT.set(this);
+        if ((bitMasks & MARSHALLING) != 0) {
+            if (!Semaphores.queryAndSet(Semaphores.NULL_COLLECTION)) {
+                this.bitMasks |= CLEAR_SEMAPHORE;
+            }
+        }
     }
 
     /**
@@ -255,23 +274,6 @@ public final class Context extends Marsh
     }
 
     /**
-     * Returns {@code true} if XML marshalling is under progress.
-     * This convenience method is implemented by:
-     *
-     * {@preformat java
-     *     return isFlagSet(current(), MARSHALLING);
-     * }
-     *
-     * Callers should use the {@link #isFlagSet(Context, int)} method instead if the
-     * {@code Context} instance is known, for avoiding a call to {@link #current()}.
-     *
-     * @return {@code true} if XML marshalling is under progress.
-     */
-    public static boolean isMarshalling() {
-        return isFlagSet(current(), MARSHALLING);
-    }
-
-    /**
      * Returns {@code true} if the given flag is set.
      *
      * @param  context The current context, or {@code null} if none.
@@ -381,31 +383,59 @@ public final class Context extends Marsh
     }
 
     /**
-     * Sends the given warning to the warning listener if there is one, or logs the warning otherwise.
-     * In the later case, this method logs to the logger specified by {@link LogRecord#getLoggerName()}
-     * if defined, or to the {@code "org.apache.sis.xml"} logger otherwise.
+     * Sends a warning to the warning listener if there is one, or logs the warning otherwise.
+     * In the later case, this method logs to the given logger.
      *
-     * @param context The current context, or {@code null} if none.
-     * @param warning The warning.
+     * <p>If the given {@code resources} is {@code null}, then this method will build the log
+     * message from the {@code exception}.</p>
+     *
+     * @param context   The current context, or {@code null} if none.
+     * @param logger    The logger where to send the warning.
+     * @param level     The logging level.
+     * @param classe    The class to declare as the warning source.
+     * @param method    The name of the method to declare as the warning source.
+     * @param exception The exception thrown, or {@code null} if none.
+     * @param resources Either {@code Errors.class}, {@code Messages.class} or {@code null} for the exception message.
+     * @param key       The resource keys as one of the constants defined in the {@code Keys} inner class.
+     * @param arguments The arguments to be given to {@code MessageFormat} for formatting the log message.
+     *
+     * @since 0.5
      */
-    public static void warningOccured(final Context context, final LogRecord warning) {
-        String logger = warning.getLoggerName();
-        if (logger == null) {
-            warning.setLoggerName(logger = "org.apache.sis.xml");
+    public static void warningOccured(final Context context, final Logger logger,
+            final Level level, final Class<?> classe, final String method, final Throwable exception,
+            final Class<? extends IndexedResourceBundle> resources, final short key, final Object... arguments)
+    {
+        final Locale locale = (context != null) ? context.getLocale() : null;
+        final LogRecord record;
+        if (resources != null) {
+            final IndexedResourceBundle bundle;
+            if (resources == Errors.class) {
+                bundle = Errors.getResources(locale);
+            } else if (resources == Messages.class) {
+                bundle = Messages.getResources(locale);
+            } else {
+                throw new IllegalArgumentException(String.valueOf(resources));
+            }
+            record = bundle.getLogRecord(level, key, arguments);
+        } else {
+            record = new LogRecord(level, Exceptions.formatChainedMessages(locale, null, exception));
         }
+        record.setSourceClassName(classe.getCanonicalName());
+        record.setSourceMethodName(method);
+        record.setLoggerName(logger.getName());
         if (context != null) {
             final WarningListener<?> warningListener = context.warningListener;
             if (warningListener != null) {
-                warningListener.warningOccured(null, warning);
+                record.setThrown(exception);
+                warningListener.warningOccured(null, record);
                 return;
             }
         }
         /*
-         * Log the warning without stack-trace, since this method shall be used only for non-fatal warnings
-         * and we want to avoid polluting the logs.
+         * Log the warning without stack-trace, since this method shall be used
+         * only for non-fatal warnings and we want to avoid polluting the logs.
          */
-        warning.setThrown(null);
-        Logging.getLogger(logger).log(warning);
+        logger.log(record);
     }
 
     /**
@@ -413,28 +443,20 @@ public final class Context extends Marsh
      * resources. The message will be logged at {@link Level#WARNING}.
      *
      * @param context   The current context, or {@code null} if none.
+     * @param logger    The logger where to send the warning.
      * @param classe    The class to declare as the warning source.
      * @param method    The name of the method to declare as the warning source.
      * @param resources Either {@code Errors.class} or {@code Messages.class}.
      * @param key       The resource keys as one of the constants defined in the {@code Keys} inner class.
      * @param arguments The arguments to be given to {@code MessageFormat} for formatting the log message.
+     *
+     * @since 0.5
      */
-    public static void warningOccured(final Context context, final Class<?> classe, final String method,
+    public static void warningOccured(final Context context, final Logger logger,
+            final Class<?> classe, final String method,
             final Class<? extends IndexedResourceBundle> resources, final short key, final Object... arguments)
     {
-        final Locale locale = context != null ? context.getLocale() : null;
-        final IndexedResourceBundle bundle;
-        if (resources == Errors.class) {
-            bundle = Errors.getResources(locale);
-        } else if (resources == Messages.class) {
-            bundle = Messages.getResources(locale);
-        } else {
-            throw new IllegalArgumentException(String.valueOf(resources));
-        }
-        final LogRecord warning = bundle.getLogRecord(Level.WARNING, key, arguments);
-        warning.setSourceClassName(classe.getCanonicalName());
-        warning.setSourceMethodName(method);
-        warningOccured(context, warning);
+        warningOccured(context, logger, Level.WARNING, classe, method, null, resources, key, arguments);
     }
 
     /**
@@ -450,12 +472,8 @@ public final class Context extends Marsh
     public static void warningOccured(final Context context, final Class<?> classe,
             final String method, final Exception cause, final boolean warning)
     {
-        final LogRecord record = new LogRecord(warning ? Level.WARNING : Level.FINE,
-                Exceptions.formatChainedMessages(context != null ? context.getLocale() : null, null, cause));
-        record.setSourceClassName(classe.getCanonicalName());
-        record.setSourceMethodName(method);
-        record.setThrown(cause);
-        warningOccured(context, record);
+        warningOccured(context, LOGGER, warning ? Level.WARNING : Level.FINE, classe, method, cause,
+                null, (short) 0, (Object[]) null);
     }
 
     /**
@@ -500,6 +518,9 @@ public final class Context extends Marsh
      * Invoked in a {@code finally} block when a unmarshalling process is finished.
      */
     public final void finish() {
+        if ((bitMasks & CLEAR_SEMAPHORE) != 0) {
+            Semaphores.clear(Semaphores.NULL_COLLECTION);
+        }
         if (previous != null) {
             CURRENT.set(previous);
         } else {

Modified: sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/NonMarshalledAuthority.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/NonMarshalledAuthority.java?rev=1635941&r1=1635940&r2=1635941&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/NonMarshalledAuthority.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/NonMarshalledAuthority.java [UTF-8] Sat Nov  1 12:25:46 2014
@@ -185,7 +185,7 @@ public final class NonMarshalledAuthorit
      * @return The identifiers to marshal, or {@code null} if none.
      */
     public static Collection<Identifier> excludeOnMarshalling(Collection<Identifier> identifiers) {
-        if (identifiers != null && Context.isMarshalling()) {
+        if (identifiers != null && Context.isFlagSet(Context.current(), Context.MARSHALLING)) {
             int count = identifiers.size();
             if (count != 0) {
                 final Identifier[] copy = identifiers.toArray(new Identifier[count]);

Modified: sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/SpecializedIdentifier.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/SpecializedIdentifier.java?rev=1635941&r1=1635940&r2=1635941&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/SpecializedIdentifier.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/SpecializedIdentifier.java [UTF-8] Sat Nov  1 12:25:46 2014
@@ -21,7 +21,6 @@ import java.net.URISyntaxException;
 import java.util.UUID;
 import java.io.Serializable;
 import java.util.logging.Level;
-import java.util.logging.LogRecord;
 import org.opengis.metadata.Identifier;
 import org.opengis.metadata.citation.Citation;
 import org.apache.sis.xml.XLink;
@@ -151,12 +150,8 @@ public final class SpecializedIdentifier
      * @param cause   The exception that occurred during the parsing process.
      */
     static void parseFailure(final Context context, final String value, final Class<?> type, final Exception cause) {
-        final Messages resources = Messages.getResources(context != null ? context.getLocale() : null);
-        final LogRecord record = resources.getLogRecord(Level.WARNING, Messages.Keys.UnparsableValueStoredAsText_2, type, value);
-        record.setSourceClassName(IdentifierMap.class.getCanonicalName());
-        record.setSourceMethodName("put");
-        record.setThrown(cause);
-        Context.warningOccured(context, record);
+        Context.warningOccured(context, Context.LOGGER, Level.WARNING, IdentifierMap.class, "put", cause,
+                Messages.class, Messages.Keys.UnparsableValueStoredAsText_2, type, value);
     }
 
     /**

Modified: sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gco/GO_CharacterString.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gco/GO_CharacterString.java?rev=1635941&r1=1635940&r2=1635941&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gco/GO_CharacterString.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gco/GO_CharacterString.java [UTF-8] Sat Nov  1 12:25:46 2014
@@ -138,7 +138,7 @@ public class GO_CharacterString {
                 property  = type;
                 noset     = true;
             }
-            Context.warningOccured(Context.current(), getClass(), "setText", Messages.class,
+            Context.warningOccured(Context.current(), Context.LOGGER, getClass(), "setText", Messages.class,
                     Messages.Keys.DiscardedExclusiveProperty_2, nameOf(discarded), nameOf(property));
             if (noset) {
                 return;

Modified: sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gco/Measure.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gco/Measure.java?rev=1635941&r1=1635940&r2=1635941&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gco/Measure.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gco/Measure.java [UTF-8] Sat Nov  1 12:25:46 2014
@@ -206,7 +206,7 @@ public final class Measure {
      * @param methodName The name of the method invoking this method.
      */
     public static void missingUOM(final Class<?> caller, final String methodName) {
-        Context.warningOccured(Context.current(), caller, methodName,
+        Context.warningOccured(Context.current(), Context.LOGGER, caller, methodName,
                 Errors.class, Errors.Keys.MandatoryAttribute_2, "uom", "Measure");
     }
 }

Modified: sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gco/ObjectReference.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gco/ObjectReference.java?rev=1635941&r1=1635940&r2=1635941&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gco/ObjectReference.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gco/ObjectReference.java [UTF-8] Sat Nov  1 12:25:46 2014
@@ -148,7 +148,7 @@ final class ObjectReference {
         if (value != null) {
             final T previous = map.putSpecialized(authority, value);
             if (previous != null && !previous.equals(value)) {
-                Context.warningOccured(context, IdentifierMap.class, "putSpecialized",
+                Context.warningOccured(context, Context.LOGGER, IdentifierMap.class, "putSpecialized",
                         Errors.class, Errors.Keys.InconsistentAttribute_2, authority.getName(), value);
                 map.putSpecialized(authority, previous);
             }

Modified: sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gmd/Country.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gmd/Country.java?rev=1635941&r1=1635940&r2=1635941&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gmd/Country.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gmd/Country.java [UTF-8] Sat Nov  1 12:25:46 2014
@@ -148,7 +148,7 @@ public final class Country extends GO_Ch
                     if (++i == code.length() || code.charAt(i) == '_') {
                         code = new StringBuilder().append(code, 0, i).append(c).append(code, i, length).toString();
                     } else if (!c.equals(CharSequences.token(code, i))) {
-                        Context.warningOccured(context, caller, "unmarshal", Errors.class,
+                        Context.warningOccured(context, Context.LOGGER, caller, "unmarshal", Errors.class,
                                 Errors.Keys.IncompatiblePropertyValue_1, "country");
                     }
                 }

Modified: sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gml/SC_VerticalCRS.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gml/SC_VerticalCRS.java?rev=1635941&r1=1635940&r2=1635941&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gml/SC_VerticalCRS.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gml/SC_VerticalCRS.java [UTF-8] Sat Nov  1 12:25:46 2014
@@ -116,7 +116,7 @@ public class SC_VerticalCRS extends Prop
      */
     @XmlAnyElement(lax = true)
     public Object getElement() {
-        Context.warningOccured(Context.current(), SC_VerticalCRS.class, "getElement",
+        Context.warningOccured(Context.current(), Context.LOGGER, SC_VerticalCRS.class, "getElement",
                 Errors.class, Errors.Keys.MissingRequiredModule_1, "sis-referencing");
         return null;
     }

Modified: sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gml/TM_Primitive.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gml/TM_Primitive.java?rev=1635941&r1=1635940&r2=1635941&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gml/TM_Primitive.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gml/TM_Primitive.java [UTF-8] Sat Nov  1 12:25:46 2014
@@ -121,8 +121,8 @@ public final class TM_Primitive extends 
                      * TemporalPrimitive as the source class, since it is the closest we can get
                      * to a public API.
                      */
-                    Context.warningOccured(context, TemporalPrimitive.class, "setTimePeriod",
-                            Errors.class, Errors.Keys.IllegalRange_2, begin, end);
+                    Context.warningOccured(context, Context.LOGGER, TemporalPrimitive.class,
+                            "setTimePeriod", Errors.class, Errors.Keys.IllegalRange_2, begin, end);
                 } else try {
                     metadata = TemporalUtilities.createPeriod(begin, end);
                     period.copyIdTo(metadata);

Modified: sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/system/Supervisor.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/system/Supervisor.java?rev=1635941&r1=1635940&r2=1635941&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/system/Supervisor.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/system/Supervisor.java [UTF-8] Sat Nov  1 12:25:46 2014
@@ -151,6 +151,8 @@ public final class Supervisor extends St
 
     /**
      * Returns the operations impact, which is {@code INFO}.
+     *
+     * @return {@code INFO}.
      */
     @Override
     protected int getImpact(final MBeanOperationInfo info) {
@@ -159,6 +161,8 @@ public final class Supervisor extends St
 
     /**
      * Returns the localized description for this MBean.
+     *
+     * @return A localized description.
      */
     @Override
     protected String getDescription(final MBeanInfo info) {
@@ -167,6 +171,8 @@ public final class Supervisor extends St
 
     /**
      * Returns the localized description for the given constructor, attribute or operation.
+     *
+     * @return A localized description for the given attribute or operation.
      */
     @Override
     protected String getDescription(final MBeanFeatureInfo info) {
@@ -179,6 +185,7 @@ public final class Supervisor extends St
      * @param info     The constructor.
      * @param param    The constructor parameter.
      * @param sequence The parameter number (0 for the first parameter, 1 for the second, etc.)
+     * @return A localized description for the specified constructor parameter.
      */
     @Override
     protected String getDescription(MBeanConstructorInfo info, MBeanParameterInfo param, int sequence) {
@@ -191,6 +198,7 @@ public final class Supervisor extends St
      * @param info     The constructor.
      * @param param    The constructor parameter.
      * @param sequence The parameter number (0 for the first parameter, 1 for the second, etc.)
+     * @return The name of the specified constructor parameter.
      */
     @Override
     protected String getParameterName(MBeanConstructorInfo info, MBeanParameterInfo param, int sequence) {

Modified: sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/util/CheckedArrayList.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/util/CheckedArrayList.java?rev=1635941&r1=1635940&r2=1635941&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/util/CheckedArrayList.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/util/CheckedArrayList.java [UTF-8] Sat Nov  1 12:25:46 2014
@@ -160,7 +160,7 @@ public final class CheckedArrayList<E> e
         }
         final Context context = Context.current();
         if (context != null) {
-            Context.warningOccured(context, collection.getClass(), "add", Errors.class, key, arguments);
+            Context.warningOccured(context, Context.LOGGER, collection.getClass(), "add", Errors.class, key, arguments);
             return null;
         } else {
             return Errors.format(key, arguments);



Mime
View raw message