Author: desruisseaux
Date: Thu Apr 21 22:14:10 2016
New Revision: 1740419

URL: http://svn.apache.org/viewvc?rev=1740419&view=rev
Log:
Safety against a discrepancy between older and newer ISO 19111 model.

Modified:
    
sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/jaxb/referencing/CC_CoordinateOperation.java

Modified: 
sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/jaxb/referencing/CC_CoordinateOperation.java
URL: 
http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/jaxb/referencing/CC_CoordinateOperation.java?rev=1740419&r1=1740418&r2=1740419&view=diff
==============================================================================
--- 
sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/jaxb/referencing/CC_CoordinateOperation.java
 [UTF-8] (original)
+++ 
sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/jaxb/referencing/CC_CoordinateOperation.java
 [UTF-8] Thu Apr 21 22:14:10 2016
@@ -90,8 +90,17 @@ public final class CC_CoordinateOperatio
      */
     public void setElement(final AbstractCoordinateOperation operation) {
         metadata = operation;
-        if ((operation instanceof PassThroughOperation) && 
((PassThroughOperation) operation).getOperation() == null) {
-            incomplete("coordOperation");
+        /*
+         * In an older ISO 19111 model, PassThroughOperation extended 
SingleOperation.
+         * It was forcing us to provide a dummy value or null for the 'method' 
property.
+         * This has been fixed in newer ISO 19111 model, but for safety with 
object following the older model
+         * (e.g. when using GeoAPI 3.0) we are better to skip the check for 
the SingleOperation case when the
+         * operation is a PassThroughOperation.
+         */
+        if (operation instanceof PassThroughOperation) {
+            if (((PassThroughOperation) operation).getOperation() == null) {
+                incomplete("coordOperation");
+            }
         } else if ((operation instanceof SingleOperation) && 
((SingleOperation) operation).getMethod() == null) {
             incomplete("method");
         }


Reply via email to