sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1607875 - in /sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature: DefaultFeatureType.java FeatureFormat.java
Date Fri, 04 Jul 2014 15:18:45 GMT
Author: desruisseaux
Date: Fri Jul  4 15:18:44 2014
New Revision: 1607875

URL: http://svn.apache.org/r1607875
Log:
Slight generalisation.

Modified:
    sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/DefaultFeatureType.java
    sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/FeatureFormat.java

Modified: sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/DefaultFeatureType.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/DefaultFeatureType.java?rev=1607875&r1=1607874&r2=1607875&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/DefaultFeatureType.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/DefaultFeatureType.java
[UTF-8] Fri Jul  4 15:18:44 2014
@@ -276,9 +276,9 @@ public class DefaultFeatureType extends 
                 minimumOccurs = ((AttributeType<?>) property).getMinimumOccurs();
                 maximumOccurs = ((AttributeType<?>) property).getMaximumOccurs();
                 isSimple &= (minimumOccurs == maximumOccurs);
-            } else if (property instanceof FieldType) { // TODO: check for AssociationRole
instead (after GeoAPI upgrade).
-                minimumOccurs = ((FieldType) property).getMinimumOccurs();
-                maximumOccurs = ((FieldType) property).getMaximumOccurs();
+            } else if (property instanceof FeatureAssociationRole) {
+                minimumOccurs = ((FeatureAssociationRole) property).getMinimumOccurs();
+                maximumOccurs = ((FeatureAssociationRole) property).getMaximumOccurs();
                 isSimple = false;
             } else {
                 continue; // For feature operations, maximumOccurs is implicitly 0.

Modified: sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/FeatureFormat.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/FeatureFormat.java?rev=1607875&r1=1607874&r2=1607875&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/FeatureFormat.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/FeatureFormat.java
[UTF-8] Fri Jul  4 15:18:44 2014
@@ -198,7 +198,14 @@ header: for (int i=0; ; i++) {
             if (feature != null) {
                 value = feature.getPropertyValue(propertyType.getName().toString());
                 if (value == null) {
-                    if (propertyType instanceof FieldType && ((FieldType) propertyType).getMinimumOccurs()
== 0) {
+                    if (propertyType instanceof AttributeType &&
+                            ((AttributeType) propertyType).getMinimumOccurs() == 0)
+                    {
+                        continue; // If no value, skip the full row.
+                    }
+                    if (propertyType instanceof FeatureAssociationRole &&
+                            ((FeatureAssociationRole) propertyType).getMinimumOccurs() ==
0)
+                    {
                         continue; // If no value, skip the full row.
                     }
                 }



Mime
View raw message