sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1499819 [3/3] - in /sis/branches/JDK6: ./ core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gml/ core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/ core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/acquisitio...
Date Thu, 04 Jul 2013 17:36:21 GMT
Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractResult.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractResult.java?rev=1499819&r1=1499818&r2=1499819&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractResult.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractResult.java [UTF-8] Thu Jul  4 17:36:19 2013
@@ -59,7 +59,7 @@ public class AbstractResult extends ISOM
      * This is a <cite>shallow</cite> copy constructor, since the other metadata contained in the
      * given object are not recursively copied.
      *
-     * @param object The metadata to copy values from.
+     * @param object The metadata to copy values from, or {@code null} if none.
      *
      * @see #castOrCopy(Result)
      */

Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractTemporalAccuracy.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractTemporalAccuracy.java?rev=1499819&r1=1499818&r2=1499819&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractTemporalAccuracy.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractTemporalAccuracy.java [UTF-8] Thu Jul  4 17:36:19 2013
@@ -58,7 +58,7 @@ public class AbstractTemporalAccuracy ex
      * This is a <cite>shallow</cite> copy constructor, since the other metadata contained in the
      * given object are not recursively copied.
      *
-     * @param object The metadata to copy values from.
+     * @param object The metadata to copy values from, or {@code null} if none.
      *
      * @see #castOrCopy(TemporalAccuracy)
      */

Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractThematicAccuracy.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractThematicAccuracy.java?rev=1499819&r1=1499818&r2=1499819&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractThematicAccuracy.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractThematicAccuracy.java [UTF-8] Thu Jul  4 17:36:19 2013
@@ -59,7 +59,7 @@ public class AbstractThematicAccuracy ex
      * This is a <cite>shallow</cite> copy constructor, since the other metadata contained in the
      * given object are not recursively copied.
      *
-     * @param object The metadata to copy values from.
+     * @param object The metadata to copy values from, or {@code null} if none.
      *
      * @see #castOrCopy(ThematicAccuracy)
      */

Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultAbsoluteExternalPositionalAccuracy.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultAbsoluteExternalPositionalAccuracy.java?rev=1499819&r1=1499818&r2=1499819&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultAbsoluteExternalPositionalAccuracy.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultAbsoluteExternalPositionalAccuracy.java [UTF-8] Thu Jul  4 17:36:19 2013
@@ -62,7 +62,7 @@ public class DefaultAbsoluteExternalPosi
      * This is a <cite>shallow</cite> copy constructor, since the other metadata contained in the
      * given object are not recursively copied.
      *
-     * @param object The metadata to copy values from.
+     * @param object The metadata to copy values from, or {@code null} if none.
      *
      * @see #castOrCopy(AbsoluteExternalPositionalAccuracy)
      */

Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultAccuracyOfATimeMeasurement.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultAccuracyOfATimeMeasurement.java?rev=1499819&r1=1499818&r2=1499819&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultAccuracyOfATimeMeasurement.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultAccuracyOfATimeMeasurement.java [UTF-8] Thu Jul  4 17:36:19 2013
@@ -51,7 +51,7 @@ public class DefaultAccuracyOfATimeMeasu
      * This is a <cite>shallow</cite> copy constructor, since the other metadata contained in the
      * given object are not recursively copied.
      *
-     * @param object The metadata to copy values from.
+     * @param object The metadata to copy values from, or {@code null} if none.
      *
      * @see #castOrCopy(AccuracyOfATimeMeasurement)
      */

Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultCompletenessCommission.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultCompletenessCommission.java?rev=1499819&r1=1499818&r2=1499819&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultCompletenessCommission.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultCompletenessCommission.java [UTF-8] Thu Jul  4 17:36:19 2013
@@ -49,7 +49,7 @@ public class DefaultCompletenessCommissi
      * This is a <cite>shallow</cite> copy constructor, since the other metadata contained in the
      * given object are not recursively copied.
      *
-     * @param object The metadata to copy values from.
+     * @param object The metadata to copy values from, or {@code null} if none.
      *
      * @see #castOrCopy(CompletenessCommission)
      */

Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultCompletenessOmission.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultCompletenessOmission.java?rev=1499819&r1=1499818&r2=1499819&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultCompletenessOmission.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultCompletenessOmission.java [UTF-8] Thu Jul  4 17:36:19 2013
@@ -49,7 +49,7 @@ public class DefaultCompletenessOmission
      * This is a <cite>shallow</cite> copy constructor, since the other metadata contained in the
      * given object are not recursively copied.
      *
-     * @param object The metadata to copy values from.
+     * @param object The metadata to copy values from, or {@code null} if none.
      *
      * @see #castOrCopy(CompletenessOmission)
      */

Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultConceptualConsistency.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultConceptualConsistency.java?rev=1499819&r1=1499818&r2=1499819&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultConceptualConsistency.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultConceptualConsistency.java [UTF-8] Thu Jul  4 17:36:19 2013
@@ -51,7 +51,7 @@ public class DefaultConceptualConsistenc
      * This is a <cite>shallow</cite> copy constructor, since the other metadata contained in the
      * given object are not recursively copied.
      *
-     * @param object The metadata to copy values from.
+     * @param object The metadata to copy values from, or {@code null} if none.
      *
      * @see #castOrCopy(ConceptualConsistency)
      */

Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultConformanceResult.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultConformanceResult.java?rev=1499819&r1=1499818&r2=1499819&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultConformanceResult.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultConformanceResult.java [UTF-8] Thu Jul  4 17:36:19 2013
@@ -94,15 +94,17 @@ public class DefaultConformanceResult ex
      * This is a <cite>shallow</cite> copy constructor, since the other metadata contained in the
      * given object are not recursively copied.
      *
-     * @param object The metadata to copy values from.
+     * @param object The metadata to copy values from, or {@code null} if none.
      *
      * @see #castOrCopy(ConformanceResult)
      */
     public DefaultConformanceResult(final ConformanceResult object) {
         super(object);
-        specification = object.getSpecification();
-        explanation   = object.getExplanation();
-        pass          = object.pass();
+        if (object != null) {
+            specification = object.getSpecification();
+            explanation   = object.getExplanation();
+            pass          = object.pass();
+        }
     }
 
     /**

Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultCoverageResult.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultCoverageResult.java?rev=1499819&r1=1499818&r2=1499819&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultCoverageResult.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultCoverageResult.java [UTF-8] Thu Jul  4 17:36:19 2013
@@ -88,17 +88,19 @@ public class DefaultCoverageResult exten
      * This is a <cite>shallow</cite> copy constructor, since the other metadata contained in the
      * given object are not recursively copied.
      *
-     * @param object The metadata to copy values from.
+     * @param object The metadata to copy values from, or {@code null} if none.
      *
      * @see #castOrCopy(CoverageResult)
      */
     public DefaultCoverageResult(final CoverageResult object) {
         super(object);
-        spatialRepresentationType   = object.getSpatialRepresentationType();
-        resultSpatialRepresentation = object.getResultSpatialRepresentation();
-        resultContentDescription    = object.getResultContentDescription();
-        resultFormat                = object.getResultFormat();
-        resultFile                  = object.getResultFile();
+        if (object != null) {
+            spatialRepresentationType   = object.getSpatialRepresentationType();
+            resultSpatialRepresentation = object.getResultSpatialRepresentation();
+            resultContentDescription    = object.getResultContentDescription();
+            resultFormat                = object.getResultFormat();
+            resultFile                  = object.getResultFile();
+        }
     }
 
     /**

Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultDataQuality.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultDataQuality.java?rev=1499819&r1=1499818&r2=1499819&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultDataQuality.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultDataQuality.java [UTF-8] Thu Jul  4 17:36:19 2013
@@ -91,15 +91,17 @@ public class DefaultDataQuality extends 
      * This is a <cite>shallow</cite> copy constructor, since the other metadata contained in the
      * given object are not recursively copied.
      *
-     * @param object The metadata to copy values from.
+     * @param object The metadata to copy values from, or {@code null} if none.
      *
      * @see #castOrCopy(DataQuality)
      */
     public DefaultDataQuality(final DataQuality object) {
         super(object);
-        scope   = object.getScope();
-        reports = copyCollection(object.getReports(), Element.class);
-        lineage = object.getLineage();
+        if (object != null) {
+            scope   = object.getScope();
+            reports = copyCollection(object.getReports(), Element.class);
+            lineage = object.getLineage();
+        }
     }
 
     /**

Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultDomainConsistency.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultDomainConsistency.java?rev=1499819&r1=1499818&r2=1499819&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultDomainConsistency.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultDomainConsistency.java [UTF-8] Thu Jul  4 17:36:19 2013
@@ -49,7 +49,7 @@ public class DefaultDomainConsistency ex
      * This is a <cite>shallow</cite> copy constructor, since the other metadata contained in the
      * given object are not recursively copied.
      *
-     * @param object The metadata to copy values from.
+     * @param object The metadata to copy values from, or {@code null} if none.
      *
      * @see #castOrCopy(DomainConsistency)
      */

Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultFormatConsistency.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultFormatConsistency.java?rev=1499819&r1=1499818&r2=1499819&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultFormatConsistency.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultFormatConsistency.java [UTF-8] Thu Jul  4 17:36:19 2013
@@ -50,7 +50,7 @@ public class DefaultFormatConsistency ex
      * This is a <cite>shallow</cite> copy constructor, since the other metadata contained in the
      * given object are not recursively copied.
      *
-     * @param object The metadata to copy values from.
+     * @param object The metadata to copy values from, or {@code null} if none.
      *
      * @see #castOrCopy(FormatConsistency)
      */

Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultGriddedDataPositionalAccuracy.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultGriddedDataPositionalAccuracy.java?rev=1499819&r1=1499818&r2=1499819&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultGriddedDataPositionalAccuracy.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultGriddedDataPositionalAccuracy.java [UTF-8] Thu Jul  4 17:36:19 2013
@@ -51,7 +51,7 @@ public class DefaultGriddedDataPositiona
      * This is a <cite>shallow</cite> copy constructor, since the other metadata contained in the
      * given object are not recursively copied.
      *
-     * @param object The metadata to copy values from.
+     * @param object The metadata to copy values from, or {@code null} if none.
      *
      * @see #castOrCopy(GriddedDataPositionalAccuracy)
      */

Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultNonQuantitativeAttributeAccuracy.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultNonQuantitativeAttributeAccuracy.java?rev=1499819&r1=1499818&r2=1499819&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultNonQuantitativeAttributeAccuracy.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultNonQuantitativeAttributeAccuracy.java [UTF-8] Thu Jul  4 17:36:19 2013
@@ -50,7 +50,7 @@ public class DefaultNonQuantitativeAttri
      * This is a <cite>shallow</cite> copy constructor, since the other metadata contained in the
      * given object are not recursively copied.
      *
-     * @param object The metadata to copy values from.
+     * @param object The metadata to copy values from, or {@code null} if none.
      *
      * @see #castOrCopy(NonQuantitativeAttributeAccuracy)
      */

Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultQuantitativeAttributeAccuracy.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultQuantitativeAttributeAccuracy.java?rev=1499819&r1=1499818&r2=1499819&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultQuantitativeAttributeAccuracy.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultQuantitativeAttributeAccuracy.java [UTF-8] Thu Jul  4 17:36:19 2013
@@ -51,7 +51,7 @@ public class DefaultQuantitativeAttribut
      * This is a <cite>shallow</cite> copy constructor, since the other metadata contained in the
      * given object are not recursively copied.
      *
-     * @param object The metadata to copy values from.
+     * @param object The metadata to copy values from, or {@code null} if none.
      *
      * @see #castOrCopy(QuantitativeAttributeAccuracy)
      */

Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultQuantitativeResult.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultQuantitativeResult.java?rev=1499819&r1=1499818&r2=1499819&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultQuantitativeResult.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultQuantitativeResult.java [UTF-8] Thu Jul  4 17:36:19 2013
@@ -79,16 +79,18 @@ public class DefaultQuantitativeResult e
      * This is a <cite>shallow</cite> copy constructor, since the other metadata contained in the
      * given object are not recursively copied.
      *
-     * @param object The metadata to copy values from.
+     * @param object The metadata to copy values from, or {@code null} if none.
      *
      * @see #castOrCopy(QuantitativeResult)
      */
     public DefaultQuantitativeResult(final QuantitativeResult object) {
         super(object);
-        valueType      = object.getValueType();
-        valueUnit      = object.getValueUnit();
-        errorStatistic = object.getErrorStatistic();
-        values         = copyList(object.getValues(), Record.class);
+        if (object != null) {
+            valueType      = object.getValueType();
+            valueUnit      = object.getValueUnit();
+            errorStatistic = object.getErrorStatistic();
+            values         = copyList(object.getValues(), Record.class);
+        }
     }
 
     /**

Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultRelativeInternalPositionalAccuracy.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultRelativeInternalPositionalAccuracy.java?rev=1499819&r1=1499818&r2=1499819&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultRelativeInternalPositionalAccuracy.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultRelativeInternalPositionalAccuracy.java [UTF-8] Thu Jul  4 17:36:19 2013
@@ -52,7 +52,7 @@ public class DefaultRelativeInternalPosi
      * This is a <cite>shallow</cite> copy constructor, since the other metadata contained in the
      * given object are not recursively copied.
      *
-     * @param object The metadata to copy values from.
+     * @param object The metadata to copy values from, or {@code null} if none.
      *
      * @see #castOrCopy(RelativeInternalPositionalAccuracy)
      */

Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultScope.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultScope.java?rev=1499819&r1=1499818&r2=1499819&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultScope.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultScope.java [UTF-8] Thu Jul  4 17:36:19 2013
@@ -83,15 +83,17 @@ public class DefaultScope extends ISOMet
      * This is a <cite>shallow</cite> copy constructor, since the other metadata contained in the
      * given object are not recursively copied.
      *
-     * @param object The metadata to copy values from.
+     * @param object The metadata to copy values from, or {@code null} if none.
      *
      * @see #castOrCopy(Scope)
      */
     public DefaultScope(final Scope object) {
         super(object);
-        level            = object.getLevel();
-        extent           = object.getExtent();
-        levelDescription = copyCollection(object.getLevelDescription(), ScopeDescription.class);
+        if (object != null) {
+            level            = object.getLevel();
+            extent           = object.getExtent();
+            levelDescription = copyCollection(object.getLevelDescription(), ScopeDescription.class);
+        }
     }
 
     /**

Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultTemporalConsistency.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultTemporalConsistency.java?rev=1499819&r1=1499818&r2=1499819&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultTemporalConsistency.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultTemporalConsistency.java [UTF-8] Thu Jul  4 17:36:19 2013
@@ -49,7 +49,7 @@ public class DefaultTemporalConsistency 
      * This is a <cite>shallow</cite> copy constructor, since the other metadata contained in the
      * given object are not recursively copied.
      *
-     * @param object The metadata to copy values from.
+     * @param object The metadata to copy values from, or {@code null} if none.
      *
      * @see #castOrCopy(TemporalConsistency)
      */

Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultTemporalValidity.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultTemporalValidity.java?rev=1499819&r1=1499818&r2=1499819&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultTemporalValidity.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultTemporalValidity.java [UTF-8] Thu Jul  4 17:36:19 2013
@@ -49,7 +49,7 @@ public class DefaultTemporalValidity ext
      * This is a <cite>shallow</cite> copy constructor, since the other metadata contained in the
      * given object are not recursively copied.
      *
-     * @param object The metadata to copy values from.
+     * @param object The metadata to copy values from, or {@code null} if none.
      *
      * @see #castOrCopy(TemporalValidity)
      */

Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultThematicClassificationCorrectness.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultThematicClassificationCorrectness.java?rev=1499819&r1=1499818&r2=1499819&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultThematicClassificationCorrectness.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultThematicClassificationCorrectness.java [UTF-8] Thu Jul  4 17:36:19 2013
@@ -51,7 +51,7 @@ public class DefaultThematicClassificati
      * This is a <cite>shallow</cite> copy constructor, since the other metadata contained in the
      * given object are not recursively copied.
      *
-     * @param object The metadata to copy values from.
+     * @param object The metadata to copy values from, or {@code null} if none.
      *
      * @see #castOrCopy(ThematicClassificationCorrectness)
      */

Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultTopologicalConsistency.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultTopologicalConsistency.java?rev=1499819&r1=1499818&r2=1499819&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultTopologicalConsistency.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultTopologicalConsistency.java [UTF-8] Thu Jul  4 17:36:19 2013
@@ -52,7 +52,7 @@ public class DefaultTopologicalConsisten
      * This is a <cite>shallow</cite> copy constructor, since the other metadata contained in the
      * given object are not recursively copied.
      *
-     * @param object The metadata to copy values from.
+     * @param object The metadata to copy values from, or {@code null} if none.
      *
      * @see #castOrCopy(TopologicalConsistency)
      */

Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultUsability.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultUsability.java?rev=1499819&r1=1499818&r2=1499819&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultUsability.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultUsability.java [UTF-8] Thu Jul  4 17:36:19 2013
@@ -50,7 +50,7 @@ public class DefaultUsability extends Ab
      * This is a <cite>shallow</cite> copy constructor, since the other metadata contained in the
      * given object are not recursively copied.
      *
-     * @param object The metadata to copy values from.
+     * @param object The metadata to copy values from, or {@code null} if none.
      *
      * @see #castOrCopy(Usability)
      */

Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/AbstractGeolocationInformation.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/AbstractGeolocationInformation.java?rev=1499819&r1=1499818&r2=1499819&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/AbstractGeolocationInformation.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/AbstractGeolocationInformation.java [UTF-8] Thu Jul  4 17:36:19 2013
@@ -62,13 +62,15 @@ public class AbstractGeolocationInformat
      * This is a <cite>shallow</cite> copy constructor, since the other metadata contained in the
      * given object are not recursively copied.
      *
-     * @param object The metadata to copy values from.
+     * @param object The metadata to copy values from, or {@code null} if none.
      *
      * @see #castOrCopy(GeolocationInformation)
      */
     public AbstractGeolocationInformation(final GeolocationInformation object) {
         super(object);
-        qualityInfo = copyCollection(object.getQualityInfo(), DataQuality.class);
+        if (object != null) {
+            qualityInfo = copyCollection(object.getQualityInfo(), DataQuality.class);
+        }
     }
 
     /**

Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/AbstractSpatialRepresentation.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/AbstractSpatialRepresentation.java?rev=1499819&r1=1499818&r2=1499819&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/AbstractSpatialRepresentation.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/AbstractSpatialRepresentation.java [UTF-8] Thu Jul  4 17:36:19 2013
@@ -58,7 +58,7 @@ public class AbstractSpatialRepresentati
      * This is a <cite>shallow</cite> copy constructor, since the other metadata contained in the
      * given object are not recursively copied.
      *
-     * @param object The metadata to copy values from.
+     * @param object The metadata to copy values from, or {@code null} if none.
      *
      * @see #castOrCopy(SpatialRepresentation)
      */

Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/DefaultDimension.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/DefaultDimension.java?rev=1499819&r1=1499818&r2=1499819&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/DefaultDimension.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/DefaultDimension.java [UTF-8] Thu Jul  4 17:36:19 2013
@@ -86,15 +86,17 @@ 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.
      *
-     * @param object The metadata to copy values from.
+     * @param object The metadata to copy values from, or {@code null} if none.
      *
      * @see #castOrCopy(Dimension)
      */
     public DefaultDimension(final Dimension object) {
         super(object);
-        dimensionName = object.getDimensionName();
-        dimensionSize = object.getDimensionSize();
-        resolution    = object.getResolution();
+        if (object != null) {
+            dimensionName = object.getDimensionName();
+            dimensionSize = object.getDimensionSize();
+            resolution    = object.getResolution();
+        }
     }
 
     /**

Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/DefaultGCP.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/DefaultGCP.java?rev=1499819&r1=1499818&r2=1499819&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/DefaultGCP.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/DefaultGCP.java [UTF-8] Thu Jul  4 17:36:19 2013
@@ -68,14 +68,16 @@ public class DefaultGCP extends ISOMetad
      * This is a <cite>shallow</cite> copy constructor, since the other metadata contained in the
      * given object are not recursively copied.
      *
-     * @param object The metadata to copy values from.
+     * @param object The metadata to copy values from, or {@code null} if none.
      *
      * @see #castOrCopy(GCP)
      */
     public DefaultGCP(final GCP object) {
         super(object);
-        accuracyReports       = copyCollection(object.getAccuracyReports(), Element.class);
-        geographicCoordinates = object.getGeographicCoordinates();
+        if (object != null) {
+            accuracyReports       = copyCollection(object.getAccuracyReports(), Element.class);
+            geographicCoordinates = object.getGeographicCoordinates();
+        }
     }
 
     /**

Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/DefaultGCPCollection.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/DefaultGCPCollection.java?rev=1499819&r1=1499818&r2=1499819&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/DefaultGCPCollection.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/DefaultGCPCollection.java [UTF-8] Thu Jul  4 17:36:19 2013
@@ -80,16 +80,18 @@ public class DefaultGCPCollection extend
      * This is a <cite>shallow</cite> copy constructor, since the other metadata contained in the
      * given object are not recursively copied.
      *
-     * @param object The metadata to copy values from.
+     * @param object The metadata to copy values from, or {@code null} if none.
      *
      * @see #castOrCopy(GCPCollection)
      */
     public DefaultGCPCollection(final GCPCollection object) {
         super(object);
-        collectionIdentification  = object.getCollectionIdentification();
-        collectionName            = object.getCollectionName();
-        coordinateReferenceSystem = object.getCoordinateReferenceSystem();
-        GCPs                      = copyCollection(object.getGCPs(), GCP.class);
+        if (object != null) {
+            collectionIdentification  = object.getCollectionIdentification();
+            collectionName            = object.getCollectionName();
+            coordinateReferenceSystem = object.getCoordinateReferenceSystem();
+            GCPs                      = copyCollection(object.getGCPs(), GCP.class);
+        }
     }
 
     /**

Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/DefaultGeometricObjects.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/DefaultGeometricObjects.java?rev=1499819&r1=1499818&r2=1499819&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/DefaultGeometricObjects.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/DefaultGeometricObjects.java [UTF-8] Thu Jul  4 17:36:19 2013
@@ -77,14 +77,16 @@ 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.
      *
-     * @param object The metadata to copy values from.
+     * @param object The metadata to copy values from, or {@code null} if none.
      *
      * @see #castOrCopy(GeometricObjects)
      */
     public DefaultGeometricObjects(final GeometricObjects object) {
         super(object);
-        geometricObjectType  = object.getGeometricObjectType();
-        geometricObjectCount = object.getGeometricObjectCount();
+        if (object != null) {
+            geometricObjectType  = object.getGeometricObjectType();
+            geometricObjectCount = object.getGeometricObjectCount();
+        }
     }
 
     /**

Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/DefaultGeorectified.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/DefaultGeorectified.java?rev=1499819&r1=1499818&r2=1499819&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/DefaultGeorectified.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/DefaultGeorectified.java [UTF-8] Thu Jul  4 17:36:19 2013
@@ -127,23 +127,25 @@ public class DefaultGeorectified extends
      * This is a <cite>shallow</cite> copy constructor, since the other metadata contained in the
      * given object are not recursively copied.
      *
-     * @param object The metadata to copy values from.
+     * @param object The metadata to copy values from, or {@code null} if none.
      *
      * @see #castOrCopy(Georectified)
      */
     public DefaultGeorectified(final Georectified object) {
         super(object);
-        checkPointDescription              = object.getCheckPointDescription();
-        cornerPoints                       = copyList(object.getCornerPoints(), Point.class);
-        centerPoint                        = object.getCenterPoint();
-        pointInPixel                       = object.getPointInPixel();
-        transformationDimensionDescription = object.getTransformationDimensionDescription();
-        transformationDimensionMapping     = copyCollection(object.getTransformationDimensionMapping(), InternationalString.class);
-        checkPoints                        = copyCollection(object.getCheckPoints(), GCP.class);
-
-        // checkPointAvailability is required to be 'true' if there is a description.
-        if (checkPointDescription != null || object.isCheckPointAvailable()) {
-            booleans |= CHECK_POINT_MASK;
+        if (object != null) {
+            checkPointDescription              = object.getCheckPointDescription();
+            cornerPoints                       = copyList(object.getCornerPoints(), Point.class);
+            centerPoint                        = object.getCenterPoint();
+            pointInPixel                       = object.getPointInPixel();
+            transformationDimensionDescription = object.getTransformationDimensionDescription();
+            transformationDimensionMapping     = copyCollection(object.getTransformationDimensionMapping(), InternationalString.class);
+            checkPoints                        = copyCollection(object.getCheckPoints(), GCP.class);
+
+            // checkPointAvailability is required to be 'true' if there is a description.
+            if (checkPointDescription != null || object.isCheckPointAvailable()) {
+                booleans |= CHECK_POINT_MASK;
+            }
         }
     }
 

Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/DefaultGeoreferenceable.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/DefaultGeoreferenceable.java?rev=1499819&r1=1499818&r2=1499819&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/DefaultGeoreferenceable.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/DefaultGeoreferenceable.java [UTF-8] Thu Jul  4 17:36:19 2013
@@ -101,22 +101,24 @@ public class DefaultGeoreferenceable ext
      * This is a <cite>shallow</cite> copy constructor, since the other metadata contained in the
      * given object are not recursively copied.
      *
-     * @param object The metadata to copy values from.
+     * @param object The metadata to copy values from, or {@code null} if none.
      *
      * @see #castOrCopy(Georeferenceable)
      */
     public DefaultGeoreferenceable(final Georeferenceable object) {
         super(object);
-        if (object.isControlPointAvailable()) {
-            booleans |= CONTROL_POINT_MASK;
-        }
-        if (object.isOrientationParameterAvailable()) {
-            booleans |= OPERATION_MASK;
+        if (object != null) {
+            if (object.isControlPointAvailable()) {
+                booleans |= CONTROL_POINT_MASK;
+            }
+            if (object.isOrientationParameterAvailable()) {
+                booleans |= OPERATION_MASK;
+            }
+            orientationParameterDescription = object.getOrientationParameterDescription();
+            parameterCitations              = copyCollection(object.getParameterCitations(), Citation.class);
+            geolocationInformation          = copyCollection(object.getGeolocationInformation(), GeolocationInformation.class);
+            georeferencedParameters         = object.getGeoreferencedParameters();
         }
-        orientationParameterDescription = object.getOrientationParameterDescription();
-        parameterCitations              = copyCollection(object.getParameterCitations(), Citation.class);
-        geolocationInformation          = copyCollection(object.getGeolocationInformation(), GeolocationInformation.class);
-        georeferencedParameters         = object.getGeoreferencedParameters();
     }
 
     /**

Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/DefaultGridSpatialRepresentation.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/DefaultGridSpatialRepresentation.java?rev=1499819&r1=1499818&r2=1499819&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/DefaultGridSpatialRepresentation.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/DefaultGridSpatialRepresentation.java [UTF-8] Thu Jul  4 17:36:19 2013
@@ -104,17 +104,19 @@ public class DefaultGridSpatialRepresent
      * This is a <cite>shallow</cite> copy constructor, since the other metadata contained in the
      * given object are not recursively copied.
      *
-     * @param object The metadata to copy values from.
+     * @param object The metadata to copy values from, or {@code null} if none.
      *
      * @see #castOrCopy(GridSpatialRepresentation)
      */
     public DefaultGridSpatialRepresentation(final GridSpatialRepresentation object) {
         super(object);
-        numberOfDimensions      = object.getNumberOfDimensions();
-        axisDimensionProperties = copyList(object.getAxisDimensionProperties(), Dimension.class);
-        cellGeometry            = object.getCellGeometry();
-        if (object.isTransformationParameterAvailable()) {
-            booleans = TRANSFORMATION_MASK;
+        if (object != null) {
+            numberOfDimensions      = object.getNumberOfDimensions();
+            axisDimensionProperties = copyList(object.getAxisDimensionProperties(), Dimension.class);
+            cellGeometry            = object.getCellGeometry();
+            if (object.isTransformationParameterAvailable()) {
+                booleans = TRANSFORMATION_MASK;
+            }
         }
     }
 

Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/DefaultVectorSpatialRepresentation.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/DefaultVectorSpatialRepresentation.java?rev=1499819&r1=1499818&r2=1499819&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/DefaultVectorSpatialRepresentation.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/DefaultVectorSpatialRepresentation.java [UTF-8] Thu Jul  4 17:36:19 2013
@@ -69,14 +69,16 @@ public class DefaultVectorSpatialReprese
      * This is a <cite>shallow</cite> copy constructor, since the other metadata contained in the
      * given object are not recursively copied.
      *
-     * @param object The metadata to copy values from.
+     * @param object The metadata to copy values from, or {@code null} if none.
      *
      * @see #castOrCopy(VectorSpatialRepresentation)
      */
     public DefaultVectorSpatialRepresentation(final VectorSpatialRepresentation object) {
         super(object);
-        topologyLevel    = object.getTopologyLevel();
-        geometricObjects = copyCollection(object.getGeometricObjects(), GeometricObjects.class);
+        if (object != null) {
+            topologyLevel    = object.getTopologyLevel();
+            geometricObjects = copyCollection(object.getGeometricObjects(), GeometricObjects.class);
+        }
     }
 
     /**

Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/package-info.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/package-info.java?rev=1499819&r1=1499818&r2=1499819&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/package-info.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/package-info.java [UTF-8] Thu Jul  4 17:36:19 2013
@@ -111,7 +111,6 @@
 
     // Java types, primitive types and basic OGC types handling
     @XmlJavaTypeAdapter(InternationalStringAdapter.class),
-    @XmlJavaTypeAdapter(GO_Decimal.class), @XmlJavaTypeAdapter(type=double.class,  value=GO_Decimal.class),
     @XmlJavaTypeAdapter(GO_Integer.class), @XmlJavaTypeAdapter(type=int.class,     value=GO_Integer.class),
     @XmlJavaTypeAdapter(GO_Boolean.class), @XmlJavaTypeAdapter(type=boolean.class, value=GO_Boolean.class)
 })

Modified: sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/identification/DefaultResolutionTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/identification/DefaultResolutionTest.java?rev=1499819&r1=1499818&r2=1499819&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/identification/DefaultResolutionTest.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/identification/DefaultResolutionTest.java [UTF-8] Thu Jul  4 17:36:19 2013
@@ -16,6 +16,8 @@
  */
 package org.apache.sis.metadata.iso.identification;
 
+import javax.xml.bind.JAXBException;
+import org.apache.sis.xml.XML;
 import org.apache.sis.metadata.iso.LoggingWatcher;
 import org.apache.sis.test.TestCase;
 import org.junit.Rule;
@@ -77,4 +79,65 @@ public final strictfp class DefaultResol
         assertNull("equivalentScale", metadata.getEquivalentScale());
         assertNull("distance", metadata.getDistance());
     }
+
+    /**
+     * Tests XML (un)marshalling of a resolution element. The main purpose of this method is to test our
+     * workaround for a strange JAXB behavior (bug?).  For an unknown reason, we are unable to annotate the
+     * {@link DefaultResolution#getDistance()} method directly. Doing so cause JAXB to randomly ignores the
+     * {@code <gmd:distance>} property. Annotating a separated method which in turn invokes the real method
+     * seems to work.
+     *
+     * <p>This test creates a {@link DefaultResolution} instance which is expected to be marshalled as below
+     * (ignoring namespace declarations):</p>
+     *
+     * {@preformat xml
+     *   <gmd:MD_Resolution>
+     *     <gmd:distance>
+     *       <gco:Distance uom=\"http://schemas.opengis.net/iso/19139/20070417/resources/uom/gmxUom.xml#xpointer(//*[@gml:id='m'])\">1000.0</gco:Distance>
+     *     </gmd:distance>
+     *   </gmd:MD_Resolution>
+     * }
+     *
+     * If we annotate the public {@code getDistance()} directly, JAXB will sometime marshals the resolution as
+     * expected, or sometime marshals an empty element as below:
+     *
+     * {@preformat xml
+     *   <gmd:MD_Resolution/>
+     * }
+     *
+     * In the later case, debugging shows that the {@code getDistance()} method is simply never invoked.
+     * Whether the distance is marshaled or not seems totally random: just executing this test many time
+     * make both cases to occur (however failures occur more often the successes).
+     *
+     * <p>Annotating an other method as a workaround seems to always work. See the {@link DefaultResolution#getValue()}
+     * javadoc for instructions about how to check if this workaround is still needed with more recent JAXB versions.</p>
+     *
+     * @throws JAXBException If an error occurred while marshalling the element.
+     *
+     * @see DefaultResolution#getValue()
+     */
+    @Test
+    public void testXML() throws JAXBException {
+        final DefaultResolution resolution = new DefaultResolution();
+        resolution.setDistance(1000.0);
+        final String xml = XML.marshal(resolution);
+        assertTrue("<gmd:distance> element is missing. If this test fails randomly, "
+                + "see DefaultResolutionTest.testXML() javadoc for more information", xml.contains("distance"));
+        /*
+         * Following test is done as a matter of principle, but should not be a problem.
+         * The real issue is the <gmd:distance> which happen to be randomly missing for
+         * an unknown reason.
+         */
+        assertXmlEquals(
+                "<gmd:MD_Resolution>\n" +
+                "  <gmd:distance>\n" +
+                "    <gco:Distance uom=\"http://schemas.opengis.net/iso/19139/20070417/resources/uom/gmxUom.xml#xpointer(//*[@gml:id='m'])\">1000.0</gco:Distance>\n" +
+                "  </gmd:distance>\n" +
+                "</gmd:MD_Resolution>", xml, "xmlns:*");
+        /*
+         * Unmarshal the element back to a Java object, as a safety.
+         * Should not be a problem neither.
+         */
+        assertEquals(resolution, XML.unmarshal(xml));
+    }
 }



Mime
View raw message