sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1677164 - in /sis/branches/JDK8/core/sis-feature/src: main/java/org/apache/sis/feature/DenseFeature.java test/java/org/apache/sis/feature/DefaultFeatureTypeTest.java test/java/org/apache/sis/test/suite/FeatureTestSuite.java
Date Fri, 01 May 2015 15:09:26 GMT
Author: desruisseaux
Date: Fri May  1 15:09:26 2015
New Revision: 1677164

URL: http://svn.apache.org/r1677164
Log:
Feature: added a test case for LinkOperation.

Modified:
    sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/DenseFeature.java
    sis/branches/JDK8/core/sis-feature/src/test/java/org/apache/sis/feature/DefaultFeatureTypeTest.java
    sis/branches/JDK8/core/sis-feature/src/test/java/org/apache/sis/test/suite/FeatureTestSuite.java

Modified: sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/DenseFeature.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/DenseFeature.java?rev=1677164&r1=1677163&r2=1677164&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/DenseFeature.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/DenseFeature.java
[UTF-8] Fri May  1 15:09:26 2015
@@ -158,10 +158,12 @@ final class DenseFeature extends Abstrac
         if (properties != null) {
             assert c.length == properties.length;
             for (final Map.Entry<String, Integer> entry : indices.entrySet()) {
-                final int   index  = entry.getValue();
-                final Object value = properties[index];
-                if (value != null) {
-                    c[index] = createProperty(entry.getKey(), value);
+                final int index = entry.getValue();
+                if (index >= 0) {
+                    final Object value = properties[index];
+                    if (value != null) {
+                        c[index] = createProperty(entry.getKey(), value);
+                    }
                 }
             }
         }

Modified: sis/branches/JDK8/core/sis-feature/src/test/java/org/apache/sis/feature/DefaultFeatureTypeTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-feature/src/test/java/org/apache/sis/feature/DefaultFeatureTypeTest.java?rev=1677164&r1=1677163&r2=1677164&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-feature/src/test/java/org/apache/sis/feature/DefaultFeatureTypeTest.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-feature/src/test/java/org/apache/sis/feature/DefaultFeatureTypeTest.java
[UTF-8] Fri May  1 15:09:26 2015
@@ -48,7 +48,7 @@ import org.opengis.feature.PropertyType;
 public final strictfp class DefaultFeatureTypeTest extends TestCase {
     /**
      * Creates a simple feature type without super-types.
-     * The feature contains the following attribute:
+     * The feature contains the following attributes:
      *
      * <ul>
      *   <li>{@code city}       as a  {@link String}  (mandatory)</li>
@@ -142,15 +142,14 @@ public final strictfp class DefaultFeatu
             final DefaultFeatureType universityCity, final DefaultAttributeType<?>
temperature, final Class<?> regionType)
     {
         return new DefaultFeatureType(singletonMap(DefaultFeatureType.NAME_KEY, "World metropolis"),
false,
-                new DefaultFeatureType[] {
+                new DefaultFeatureType[] {          // Super types
                     metropolis,
                     universityCity
                 },
-                new DefaultAttributeType<?>[] {
+                new DefaultAttributeType<?>[] {     // Properties
                     new DefaultAttributeType<>(singletonMap(DefaultAttributeType.NAME_KEY,
"region"), regionType, 1, 1, null),
                     temperature
                 });
-
     }
 
     /**

Modified: sis/branches/JDK8/core/sis-feature/src/test/java/org/apache/sis/test/suite/FeatureTestSuite.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-feature/src/test/java/org/apache/sis/test/suite/FeatureTestSuite.java?rev=1677164&r1=1677163&r2=1677164&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-feature/src/test/java/org/apache/sis/test/suite/FeatureTestSuite.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-feature/src/test/java/org/apache/sis/test/suite/FeatureTestSuite.java
[UTF-8] Fri May  1 15:09:26 2015
@@ -42,6 +42,7 @@ import org.junit.BeforeClass;
     org.apache.sis.feature.DefaultAssociationRoleTest.class,
     org.apache.sis.feature.SingletonAssociationTest.class,
     org.apache.sis.feature.AbstractOperationTest.class,
+    org.apache.sis.feature.LinkOperationTest.class,
     org.apache.sis.feature.FeatureFormatTest.class,
     org.apache.sis.feature.FeaturesTest.class
 })



Mime
View raw message