sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1631777 - in /sis/branches/JDK8/core: sis-feature/src/main/java/org/apache/sis/feature/ sis-feature/src/test/java/org/apache/sis/feature/ sis-utility/src/main/java/org/apache/sis/util/resources/
Date Tue, 14 Oct 2014 14:49:51 GMT
Author: desruisseaux
Date: Tue Oct 14 14:49:51 2014
New Revision: 1631777

URL: http://svn.apache.org/r1631777
Log:
Partial implementation of bidirectional feature association.
Still work in progress.

Added:
    sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/NamedFeatureType.java
  (with props)
Modified:
    sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/AbstractAssociation.java
    sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/DefaultAssociationRole.java
    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
    sis/branches/JDK8/core/sis-feature/src/test/java/org/apache/sis/feature/DefaultAssociationRoleTest.java
    sis/branches/JDK8/core/sis-feature/src/test/java/org/apache/sis/feature/FeatureTestCase.java
    sis/branches/JDK8/core/sis-feature/src/test/java/org/apache/sis/feature/SingletonAssociationTest.java
    sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.java
    sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.properties
    sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors_fr.properties

Modified: sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/AbstractAssociation.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/AbstractAssociation.java?rev=1631777&r1=1631776&r2=1631777&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/AbstractAssociation.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/AbstractAssociation.java
[UTF-8] Tue Oct 14 14:49:51 2014
@@ -223,7 +223,7 @@ public abstract class AbstractAssociatio
     public String toString() {
         final String pt = DefaultAssociationRole.getTitleProperty(role);
         final Iterator<Feature> it = getValues().iterator();
-        return FieldType.toString("FeatureAssociation", role, role.getValueType().getName(),
new Iterator<Object>() {
+        return FieldType.toString("FeatureAssociation", role, DefaultAssociationRole.getValueTypeName(role),
new Iterator<Object>() {
             @Override public boolean hasNext() {
                 return it.hasNext();
             }

Modified: sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/DefaultAssociationRole.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/DefaultAssociationRole.java?rev=1631777&r1=1631776&r2=1631777&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/DefaultAssociationRole.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/DefaultAssociationRole.java
[UTF-8] Tue Oct 14 14:49:51 2014
@@ -19,6 +19,7 @@ package org.apache.sis.feature;
 import java.util.Map;
 import org.opengis.util.GenericName;
 import org.opengis.util.InternationalString;
+import org.apache.sis.util.resources.Errors;
 import org.apache.sis.util.Debug;
 
 import static org.apache.sis.util.ArgumentChecks.*;
@@ -65,7 +66,7 @@ public class DefaultAssociationRole exte
      *
      * @see #getValueType()
      */
-    private final FeatureType valueType;
+    private volatile FeatureType valueType;
 
     /**
      * The name of the property to use as a title for the associated feature, or an empty
string if none.
@@ -77,7 +78,7 @@ public class DefaultAssociationRole exte
     private volatile transient String titleProperty;
 
     /**
-     * Constructs an association role from the given properties. The properties map is given
unchanged to
+     * Constructs an association to the given feature type. The properties map is given unchanged
to
      * the {@linkplain AbstractIdentifiedType#AbstractIdentifiedType(Map) super-class constructor}.
      * The following table is a reminder of main (not all) recognized map entries:
      *
@@ -125,13 +126,80 @@ public class DefaultAssociationRole exte
     }
 
     /**
+     * Constructs an association to a feature type of the given name.
+     * This constructor shall be used only when creating a cyclic graph of {@link DefaultFeatureType}
instances.
+     *
+     * <div class="note"><b>Example:</b>
+     * A code first creates {@code FeatureType} <var>A</var>, then {@code FeatureType}
<var>B</var>.
+     * It is easy to define an association from <var>B</var> to <var>A</var>
since the later exists
+     * at <var>B</var> creation time. But if one wants to define also the converse
association, i.e.
+     * from <var>A</var> to <var>B</var>, then it is not possible
to create <var>A</var> with the
+     * {@linkplain #DefaultAssociationRole(Map, FeatureType, int, int) above constructor}
since
+     * <var>B</var> does not yet exist. We can only give the <em>name</em>
of <var>B</var> and
+     * let {@link DefaultFeatureType} substitutes that name by the actual instance when the
later
+     * will be known.
+     * </div>
+     *
+     * @param identification The name and other information to be given to this association
role.
+     * @param valueType      The name of the type of feature values.
+     * @param minimumOccurs  The minimum number of occurrences of the association within
its containing entity.
+     * @param maximumOccurs  The maximum number of occurrences of the association within
its containing entity,
+     *                       or {@link Integer#MAX_VALUE} if there is no restriction.
+     */
+    public DefaultAssociationRole(final Map<String,?> identification, final GenericName
valueType,
+            final int minimumOccurs, final int maximumOccurs)
+    {
+        super(identification, minimumOccurs, maximumOccurs);
+        ensureNonNull("valueType", valueType);
+        this.valueType = new NamedFeatureType(valueType);
+    }
+
+    /**
+     * If the associated feature type is a placeholder for a {@code FeatureType} to be defined
later,
+     * replaces the placeholder by the actual instance if available. Otherwise do nothing.
+     *
+     * This method is needed only in case of cyclic graph, e.g. feature <var>A</var>
has an association
+     * to feature <var>B</var> which has an association back to <var>A</var>.
It may also be <var>A</var>
+     * having an association to itself, <i>etc.</i>
+     *
+     * @param  features The features by their name.
+     * @return {@code true} if the feature type is still unresolved after this method call.
+     */
+    final boolean resolve(final Map<GenericName,FeatureType> features) {
+        final FeatureType type = valueType;
+        if (type instanceof NamedFeatureType) {
+            final FeatureType actual = features.get(type.getName());
+            if (actual == null) {
+                return true;
+            }
+            valueType = actual;
+        }
+        return false;
+    }
+
+    /**
      * Returns the type of feature values.
      *
      * @return The type of feature values.
+     * @throws IllegalStateException if the feature type has been specified
+     *         {@linkplain #DefaultAssociationRole(Map, GenericName, int, int) only by its
name}
+     *         and not yet resolved.
      */
     @Override
     public final FeatureType getValueType() {
-        return valueType;
+        final FeatureType type = valueType;
+        if (type instanceof NamedFeatureType) {
+            throw new IllegalStateException(Errors.format(Errors.Keys.UnresolvedFeatureName_1,
getName()));
+        }
+        return type;
+    }
+
+    /**
+     * Returns the name of the feature type. This information is always available
+     * even when the name has not yet been {@linkplain #resolve(Map) resolved}.
+     */
+    static GenericName getValueTypeName(final FeatureAssociationRole role) {
+        return (role instanceof DefaultAssociationRole ? ((DefaultAssociationRole) role).valueType
: role.getValueType()).getName();
     }
 
     /**
@@ -198,7 +266,12 @@ public class DefaultAssociationRole exte
      */
     @Override
     public int hashCode() {
-        return super.hashCode() + valueType.hashCode();
+        /*
+         * Do not use the full 'valueType' object for computing hash code,
+         * because it may change before and after 'resolve' is invoked. In
+         * addition, this avoid infinite recursivity in case of cyclic graph.
+         */
+        return super.hashCode() + valueType.getName().hashCode();
     }
 
     /**

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=1631777&r1=1631776&r2=1631777&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] Tue Oct 14 14:49:51 2014
@@ -211,14 +211,56 @@ public class DefaultFeatureType extends 
         super(identification);
         ArgumentChecks.ensureNonNull("properties", properties);
         this.isAbstract = isAbstract;
-        this.superTypes = (superTypes == null) ? Collections.<FeatureType>emptySet()
:
-                          CollectionsExt.<FeatureType>immutableSet(true, superTypes);
+        if (superTypes == null) {
+            this.superTypes = Collections.emptySet();
+        } else {
+            this.superTypes = CollectionsExt.immutableSet(true, superTypes);
+            for (final FeatureType type : this.superTypes) {
+                if (type instanceof NamedFeatureType) {
+                    // Hierarchy of feature types can not be cyclic.
+                    throw new IllegalArgumentException(Errors.format(Errors.Keys.UnresolvedFeatureName_1,
type.getName()));
+                }
+            }
+        }
         switch (properties.length) {
             case 0:  this.properties = Collections.emptyList(); break;
             case 1:  this.properties = Collections.singletonList(properties[0]); break;
             default: this.properties = UnmodifiableArrayList.wrap(Arrays.copyOf(properties,
properties.length, PropertyType[].class)); break;
         }
         computeTransientFields();
+        /*
+         * Replace NamedFeatureType by the actual object.
+         *
+         * TODO: current implementation checks only for 'this'.
+         * We need to perform a more extensive check.
+         */
+        resolve(Collections.singletonMap(getName(), this));
+    }
+
+    /**
+     * If an associated feature type is a placeholder for a {@code FeatureType} to be defined
later,
+     * replaces the placeholder by the actual instance if available. Otherwise do nothing.
+     *
+     * This method is needed only in case of cyclic graph, e.g. feature <var>A</var>
has an association
+     * to feature <var>B</var> which has an association back to <var>A</var>.
It may also be <var>A</var>
+     * having an association to itself, <i>etc.</i>
+     *
+     * @param  features The features by their name.
+     * @return {@code true} if the feature type is still unresolved after this method call.
+     */
+    final boolean resolve(final Map<GenericName,FeatureType> features) {
+        boolean incomplete = false;
+        for (final FeatureType type : superTypes) {
+            if (type instanceof DefaultFeatureType) {
+                incomplete |= ((DefaultFeatureType) type).resolve(features);
+            }
+        }
+        for (final PropertyType property : properties) {
+            if (property instanceof DefaultAssociationRole) {
+                incomplete |= ((DefaultAssociationRole) property).resolve(features);
+            }
+        }
+        return incomplete;
     }
 
     /**

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=1631777&r1=1631776&r2=1631777&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] Tue Oct 14 14:49:51 2014
@@ -236,7 +236,7 @@ header: for (int i=0; ; i++) {
                 final FeatureAssociationRole pt = (FeatureAssociationRole) propertyType;
                 minimumOccurs = pt.getMinimumOccurs();
                 maximumOccurs = pt.getMaximumOccurs();
-                valueType     = toString(pt.getValueType().getName());
+                valueType     = toString(DefaultAssociationRole.getValueTypeName(pt));
                 valueClass    = Feature.class;
             } else if (propertyType instanceof Operation) {
                 final IdentifiedType resultType = ((Operation) propertyType).getResult();

Added: sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/NamedFeatureType.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/NamedFeatureType.java?rev=1631777&view=auto
==============================================================================
--- sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/NamedFeatureType.java
(added)
+++ sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/NamedFeatureType.java
[UTF-8] Tue Oct 14 14:49:51 2014
@@ -0,0 +1,126 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sis.feature;
+
+import java.util.Set;
+import java.util.Collection;
+import java.util.Collections;
+import java.io.Serializable;
+import org.opengis.feature.FeatureType;
+import org.opengis.feature.PropertyType;
+import org.opengis.util.GenericName;
+import org.opengis.util.InternationalString;
+import org.apache.sis.util.resources.Errors;
+
+
+/**
+ * A feature type identified only by its name. Instances of {@code NamedFeatureType} shall
be used only as placeholder
+ * while building a cyclic graphs of {@link DefaultFeatureType}. Instances of {@code NamedFeatureType}
will be replaced
+ * by instances of the actual feature type when the later become known.
+ *
+ * @author  Martin Desruisseaux (Geomatys)
+ * @since   0.5
+ * @version 0.5
+ * @module
+ */
+final class NamedFeatureType implements FeatureType, Serializable {
+    /**
+     * For cross-version compatibility.
+     */
+    private static final long serialVersionUID = 178781891980017372L;
+
+    /**
+     * The name of the feature type for which this {@code NamedFeatureType} is a placeholder.
+     */
+    private final GenericName name;
+
+    /**
+     * Creates a new placeholder for a feature of the given name.
+     */
+    NamedFeatureType(final GenericName name) {
+        this.name = name;
+    }
+
+    /**
+     * Returns the name of this feature.
+     */
+    @Override
+    public GenericName getName() {
+        return name;
+    }
+
+    /** Undefined. */ @Override public InternationalString getDefinition()  {return null;}
+    /** Undefined. */ @Override public InternationalString getDesignation() {return null;}
+    /** Undefined. */ @Override public InternationalString getDescription() {return null;}
+
+    /**
+     * Declares that this feature shall not be instantiated.
+     */
+    @Override
+    public boolean isAbstract() {
+        return true;
+    }
+
+    /**
+     * Conservatively assumes that the feature is not simple,
+     * since we do not know what the actual feature will be.
+     */
+    @Override
+    public boolean isSimple() {
+        return false;
+    }
+
+    /**
+     * Always throws {@link IllegalArgumentException} since this feature type has no declared
property yet.
+     */
+    @Override
+    public PropertyType getProperty(final String name) throws IllegalArgumentException {
+        throw new IllegalArgumentException(Errors.format(Errors.Keys.PropertyNotFound_2,
getName(), name));
+    }
+
+    /**
+     * Returns an empty set since this feature has no declared property yet.
+     */
+    @Override
+    public Collection<? extends PropertyType> getProperties(final boolean includeSuperTypes)
{
+        return Collections.emptySet();
+    }
+
+    /**
+     * Returns an empty set since this feature has no declared parent yet.
+     */
+    @Override
+    public Set<? extends FeatureType> getSuperTypes() {
+        return Collections.emptySet();
+    }
+
+    /**
+     * This feature type is considered to all other features except itself.
+     */
+    @Override
+    public boolean isAssignableFrom(final FeatureType type) {
+        return (type instanceof NamedFeatureType);
+    }
+
+    /**
+     * Returns a string representation of this feature type.
+     */
+    @Override
+    public String toString() {
+        return "FeatureType[“" + name + "”]";
+    }
+}

Propchange: sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/NamedFeatureType.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/NamedFeatureType.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain;charset=UTF-8

Modified: sis/branches/JDK8/core/sis-feature/src/test/java/org/apache/sis/feature/DefaultAssociationRoleTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-feature/src/test/java/org/apache/sis/feature/DefaultAssociationRoleTest.java?rev=1631777&r1=1631776&r2=1631777&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-feature/src/test/java/org/apache/sis/feature/DefaultAssociationRoleTest.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-feature/src/test/java/org/apache/sis/feature/DefaultAssociationRoleTest.java
[UTF-8] Tue Oct 14 14:49:51 2014
@@ -16,11 +16,16 @@
  */
 package org.apache.sis.feature;
 
+import java.util.Map;
+import org.opengis.feature.FeatureAssociationRole;
+import org.opengis.util.GenericName;
+import org.apache.sis.internal.system.DefaultFactories;
 import org.apache.sis.test.DependsOn;
 import org.apache.sis.test.TestCase;
 import org.junit.Test;
 
 import static java.util.Collections.singletonMap;
+import static org.apache.sis.test.TestUtilities.getSingleton;
 import static org.apache.sis.test.Assert.*;
 
 // Branch-dependent imports
@@ -40,19 +45,45 @@ public final strictfp class DefaultAssoc
     /**
      * Creates an association to a twin town. We arbitrarily fix the maximum number
      * of occurrences to 1, even if in reality some cities have many twin towns.
+     *
+     * @param cyclic {@code true} if in addition to the association from <var>A</var>
to <var>B</var>,
+     *        we also want an association from <var>B</var> to <var>A</var>,
thus creating a cycle.
      */
-    static DefaultAssociationRole twinTown() {
-        return new DefaultAssociationRole(singletonMap(DefaultAssociationRole.NAME_KEY, "twin
town"),
-                DefaultFeatureTypeTest.city(), 0, 1);
+    static DefaultAssociationRole twinTown(final boolean cyclic) {
+        final Map<String,?> properties = singletonMap(DefaultAssociationRole.NAME_KEY,
"twin town");
+        if (cyclic) {
+            final GenericName valueType = DefaultFactories.SIS_NAMES.createTypeName(null,
"Twin town");
+            return new DefaultAssociationRole(properties, valueType, 0, 1);
+        } else {
+            final DefaultFeatureType valueType = DefaultFeatureTypeTest.city();
+            return new DefaultAssociationRole(properties, valueType, 0, 1);
+        }
     }
 
     /**
      * Returns a City feature type which may have a twin town.
+     *
+     * @param cyclic {@code true} if in addition to the association from <var>A</var>
to <var>B</var>,
+     *        we also want an association from <var>B</var> to <var>A</var>,
thus creating a cycle.
      */
-    static DefaultFeatureType twinTownCity() {
-        final DefaultAssociationRole twinTown = twinTown();
-        return new DefaultFeatureType(singletonMap(DefaultFeatureType.NAME_KEY, "Twin town"),
false,
-                new FeatureType[] {twinTown.getValueType()}, twinTown);
+    static DefaultFeatureType twinTownCity(final boolean cyclic) {
+        final DefaultAssociationRole twinTown = twinTown(cyclic);
+        final FeatureType parent = cyclic ? DefaultFeatureTypeTest.city() : twinTown.getValueType();
+        return createType("Twin town", parent, twinTown);
+    }
+
+    /**
+     * Convenience method creating a feature type of the given name, parent and property.
+     *
+     * @param name     The name as either a {@link String} or a {@link GenericName}.
+     * @param parent   A feature type created by {@link DefaultFeatureTypeTest#city()}, or
{@code null}.
+     * @param property The association to an other feature.
+     */
+    private static DefaultFeatureType createType(final Object name,
+            final FeatureType parent, final FeatureAssociationRole property)
+    {
+        return new DefaultFeatureType(singletonMap(DefaultFeatureType.NAME_KEY, name),
+                false, new FeatureType[] {parent}, property);
     }
 
     /**
@@ -60,7 +91,7 @@ public final strictfp class DefaultAssoc
      */
     @Test
     public void testSerialization() {
-        assertSerializedEquals(twinTown());
+        assertSerializedEquals(twinTown(false));
     }
 
     /**
@@ -68,7 +99,7 @@ public final strictfp class DefaultAssoc
      */
     @Test
     public void testGetTitleProperty() {
-        final DefaultAssociationRole twinTown = twinTown();
+        final DefaultAssociationRole twinTown = twinTown(false);
         assertEquals("city", DefaultAssociationRole.getTitleProperty(twinTown));
     }
 
@@ -77,7 +108,36 @@ public final strictfp class DefaultAssoc
      */
     @Test
     public void testToString() {
-        final DefaultAssociationRole twinTown = twinTown();
+        final DefaultAssociationRole twinTown = twinTown(false);
         assertEquals("FeatureAssociationRole[“twin town” : City]", twinTown.toString());
     }
+
+    /**
+     * Tests a bidirectional association (an feature having an association to itself).
+     */
+    @Test
+    public void testBidirectionalAssociation() {
+        final DefaultFeatureType twinTown = twinTownCity(true);
+        final FeatureAssociationRole association = (FeatureAssociationRole) twinTown.getProperty("twin
town");
+        assertSame("twinTown.property(“twin town”).valueType", twinTown, association.getValueType());
+        /*
+         * Creates a FeatureType copy containing the same properties. Used for verifying
+         * that 'DefaultFeatureType.equals(Object)' does not fall in an infinite loop.
+         */
+        final DefaultFeatureType copy = createType(twinTown.getName(),
+                getSingleton(twinTown.getSuperTypes()), association);
+
+        assertTrue("equals", copy.equals(twinTown));
+        assertEquals("hashCode", copy.hashCode(), twinTown.hashCode());
+    }
+
+    /**
+     * Tests {@link DefaultFeatureType#isAssignableFrom(FeatureType)} and {@link DefaultFeatureType#equals(Object)}
+     * on a feature type having a bidirectional association to an other feature. This test
will fall in an infinite
+     * loop if the implementation does not have proper guard against infinite recursivity.
+     */
+    @Test
+    public void testCyclicAssociation() {
+        // TODO
+    }
 }

Modified: sis/branches/JDK8/core/sis-feature/src/test/java/org/apache/sis/feature/FeatureTestCase.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-feature/src/test/java/org/apache/sis/feature/FeatureTestCase.java?rev=1631777&r1=1631776&r2=1631777&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-feature/src/test/java/org/apache/sis/feature/FeatureTestCase.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-feature/src/test/java/org/apache/sis/feature/FeatureTestCase.java
[UTF-8] Tue Oct 14 14:49:51 2014
@@ -63,7 +63,7 @@ public abstract strictfp class FeatureTe
      * Creates a feature for twin towns.
      */
     static AbstractFeature twinTown(final boolean isSparse) {
-        final DefaultFeatureType twinTown = DefaultAssociationRoleTest.twinTownCity();
+        final DefaultFeatureType twinTown = DefaultAssociationRoleTest.twinTownCity(false);
 
         final AbstractFeature leMans = isSparse ? new SparseFeature(twinTown) : new DenseFeature(twinTown);
         leMans.setPropertyValue("city", "Le Mans");

Modified: sis/branches/JDK8/core/sis-feature/src/test/java/org/apache/sis/feature/SingletonAssociationTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-feature/src/test/java/org/apache/sis/feature/SingletonAssociationTest.java?rev=1631777&r1=1631776&r2=1631777&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-feature/src/test/java/org/apache/sis/feature/SingletonAssociationTest.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-feature/src/test/java/org/apache/sis/feature/SingletonAssociationTest.java
[UTF-8] Tue Oct 14 14:49:51 2014
@@ -51,7 +51,7 @@ public final strictfp class SingletonAss
         final Feature twinTown = DefaultFeatureTypeTest.city().newInstance();
         twinTown.setPropertyValue("city", "Le Mans");
         twinTown.setPropertyValue("population", 143240); // In 2011.
-        final AbstractAssociation association = new SingletonAssociation(DefaultAssociationRoleTest.twinTown());
+        final AbstractAssociation association = new SingletonAssociation(DefaultAssociationRoleTest.twinTown(false));
         association.setValue(twinTown);
         return association;
     }

Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.java?rev=1631777&r1=1631776&r2=1631777&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.java
[UTF-8] Tue Oct 14 14:49:51 2014
@@ -848,6 +848,11 @@ public final class Errors extends Indexe
         public static final short UnparsableStringForClass_3 = 125;
 
         /**
+         * Feature named “{0}” has not yet been resolved.
+         */
+        public static final short UnresolvedFeatureName_1 = 164;
+
+        /**
          * No format is specified for objects of class ‘{0}’.
          */
         public static final short UnspecifiedFormatForClass_1 = 126;

Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.properties
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.properties?rev=1631777&r1=1631776&r2=1631777&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.properties
[ISO-8859-1] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.properties
[ISO-8859-1] Tue Oct 14 14:49:51 2014
@@ -181,6 +181,7 @@ UnmodifiableMetadata              = This
 UnmodifiableObject_1              = Object \u2018{0}\u2019 is unmodifiable.
 UnparsableStringForClass_2        = Text \u201c{1}\u201d can not be parsed as an object of
type \u2018{0}\u2019.
 UnparsableStringForClass_3        = Text \u201c{1}\u201d can not be parsed as an object of
type \u2018{0}\u2019, because of the \u201c{2}\u201d characters.
+UnresolvedFeatureName_1           = Feature named \u201c{0}\u201d has not yet been resolved.
 UnspecifiedFormatForClass_1       = No format is specified for objects of class \u2018{0}\u2019.
 UnsupportedImplementation_1       = Can not handle instances of \u2018{0}\u2019 because arbitrary
implementations are not yet supported.
 UnsupportedOperation_1            = The \u2018{0}\u2019 operation is unsupported.

Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors_fr.properties
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors_fr.properties?rev=1631777&r1=1631776&r2=1631777&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors_fr.properties
[ISO-8859-1] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors_fr.properties
[ISO-8859-1] Tue Oct 14 14:49:51 2014
@@ -171,6 +171,7 @@ UnmodifiableObject_1              = L\u2
 UnspecifiedFormatForClass_1       = Aucun format n\u2019est sp\u00e9cifi\u00e9 pour les objets
de classe \u2018{0}\u2019.
 UnparsableStringForClass_2        = Le texte \u00ab\u202f{1}\u202f\u00bb n\u2019est pas reconnu
comme un objet de type \u2018{0}\u2019.
 UnparsableStringForClass_3        = Le texte \u00ab\u202f{1}\u202f\u00bb n\u2019est pas reconnu
comme un objet de type \u2018{0}\u2019, \u00e0 cause des caract\u00e8res \u00ab\u202f{2}\u202f\u00bb.
+UnresolvedFeatureName_1           = L\u2019entit\u00e9 nomm\u00e9e \u00ab\u202f{0}\u202f\u00bb
n\u2019a pas encore \u00e9t\u00e9 r\u00e9solue.
 UnsupportedImplementation_1       = Les instances de \u2018{0}\u2019 ne peuvent pas \u00eatre
g\u00e9r\u00e9es parce que les impl\u00e9mentations arbitraires ne sont pas encore support\u00e9es.
 UnsupportedOperation_1            = L\u2019op\u00e9ration \u2018{0}\u2019 n\u2019est pas
support\u00e9e.
 UnsupportedType_1                 = Le type \u2018{0}\u2019 n\u2019est pas support\u00e9.



Mime
View raw message