sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1767858 - in /sis/branches/JDK8: core/sis-feature/src/main/java/org/apache/sis/feature/builder/ core/sis-feature/src/test/java/org/apache/sis/feature/builder/ storage/sis-xmlstore/src/main/java/org/apache/sis/internal/gpx/
Date Thu, 03 Nov 2016 10:36:58 GMT
Author: desruisseaux
Date: Thu Nov  3 10:36:58 2016
New Revision: 1767858

URL: http://svn.apache.org/viewvc?rev=1767858&view=rev
Log:
Remove the deprecated 'setCardinality' method.

Modified:
    sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/builder/OperationWrapper.java
    sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/builder/PropertyTypeBuilder.java
    sis/branches/JDK8/core/sis-feature/src/test/java/org/apache/sis/feature/builder/AttributeTypeBuilderTest.java
    sis/branches/JDK8/core/sis-feature/src/test/java/org/apache/sis/feature/builder/FeatureTypeBuilderTest.java
    sis/branches/JDK8/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/gpx/GPXConstants.java

Modified: sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/builder/OperationWrapper.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/builder/OperationWrapper.java?rev=1767858&r1=1767857&r2=1767858&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/builder/OperationWrapper.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/builder/OperationWrapper.java
[UTF-8] Thu Nov  3 10:36:58 2016
@@ -62,13 +62,6 @@ final class OperationWrapper extends Pro
      */
     @Override public PropertyTypeBuilder setMinimumOccurs(int occurs) {if (occurs == 1) return
this; throw readOnly();}
     @Override public PropertyTypeBuilder setMaximumOccurs(int occurs) {if (occurs == 1) return
this; throw readOnly();}
-    @Override @Deprecated
-    public PropertyTypeBuilder setCardinality(final int minimumOccurs, final int maximumOccurs)
{
-        if (minimumOccurs != 1 || maximumOccurs != 1) {
-            throw readOnly();
-        }
-        return this;
-    }
 
     /**
      * Do not allow modifications.

Modified: sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/builder/PropertyTypeBuilder.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/builder/PropertyTypeBuilder.java?rev=1767858&r1=1767857&r2=1767858&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/builder/PropertyTypeBuilder.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/builder/PropertyTypeBuilder.java
[UTF-8] Thu Nov  3 10:36:58 2016
@@ -179,33 +179,6 @@ public abstract class PropertyTypeBuilde
     }
 
     /**
-     * Sets the minimum and maximum number of property values. Those numbers must be equal
or greater than zero.
-     *
-     * <p>If this method is not invoked, then the default values are the cardinality
specified by the last call
-     * to {@link FeatureTypeBuilder#setDefaultCardinality(int, int)} at the time this instance
has been created.
-     * If the later method has not been invoked, then the default cardinality is [1 … 1].</p>
-     *
-     * @param  minimumOccurs  new minimum number of property values.
-     * @param  maximumOccurs  new maximum number of property values.
-     * @return {@code this} for allowing method calls chaining.
-     *
-     * @deprecated Replaced by {@link #setMinimumOccurs(int)} and {@link #setMaximumOccurs(int)}.
-     */
-    @Deprecated
-    @SuppressWarnings("unchecked")
-    public PropertyTypeBuilder setCardinality(final int minimumOccurs, final int maximumOccurs)
{
-        if (this.minimumOccurs != minimumOccurs || this.maximumOccurs != maximumOccurs) {
-            if (minimumOccurs < 0 || maximumOccurs < minimumOccurs) {
-                throw new IllegalArgumentException(errors().getString(Errors.Keys.IllegalRange_2,
minimumOccurs, maximumOccurs));
-            }
-            this.minimumOccurs = minimumOccurs;
-            this.maximumOccurs = maximumOccurs;
-            clearCache();
-        }
-        return this;
-    }
-
-    /**
      * Returns {@code true} if {@link AttributeRole#IDENTIFIER_COMPONENT} has been associated
to this property.
      */
     boolean isIdentifier() {

Modified: sis/branches/JDK8/core/sis-feature/src/test/java/org/apache/sis/feature/builder/AttributeTypeBuilderTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-feature/src/test/java/org/apache/sis/feature/builder/AttributeTypeBuilderTest.java?rev=1767858&r1=1767857&r2=1767858&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-feature/src/test/java/org/apache/sis/feature/builder/AttributeTypeBuilderTest.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-feature/src/test/java/org/apache/sis/feature/builder/AttributeTypeBuilderTest.java
[UTF-8] Thu Nov  3 10:36:58 2016
@@ -79,7 +79,7 @@ public final strictfp class AttributeTyp
         assertSame(builder, builder.setDesignation ("test designation"));
         assertSame(builder, builder.setDescription ("test description"));
         assertSame(builder, builder.setDefaultValue("test default value."));
-        assertSame(builder, builder.setCardinality(10, 60));
+        assertSame(builder, builder.setMinimumOccurs(10).setMaximumOccurs(60));
         assertSame(builder, builder.setMaximalLength(80));
         final AttributeType<?> att = builder.build();
 

Modified: sis/branches/JDK8/core/sis-feature/src/test/java/org/apache/sis/feature/builder/FeatureTypeBuilderTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-feature/src/test/java/org/apache/sis/feature/builder/FeatureTypeBuilderTest.java?rev=1767858&r1=1767857&r2=1767858&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-feature/src/test/java/org/apache/sis/feature/builder/FeatureTypeBuilderTest.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-feature/src/test/java/org/apache/sis/feature/builder/FeatureTypeBuilderTest.java
[UTF-8] Thu Nov  3 10:36:58 2016
@@ -84,7 +84,7 @@ public final strictfp class FeatureTypeB
         builder.addAttribute(String .class).setName("name");
         builder.addAttribute(Integer.class).setName("age");
         builder.addAttribute(Point  .class).setName("location").setCRS(HardCodedCRS.WGS84);
-        builder.addAttribute(Double .class).setName("score").setDefaultValue(10.0).setCardinality(5,
50);
+        builder.addAttribute(Double .class).setName("score").setDefaultValue(10.0).setMinimumOccurs(5).setMaximumOccurs(50);
 
         final FeatureType type = builder.build();
         assertEquals("name",        "myScope:myName",   type.getName().toString());

Modified: sis/branches/JDK8/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/gpx/GPXConstants.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/gpx/GPXConstants.java?rev=1767858&r1=1767857&r2=1767858&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/gpx/GPXConstants.java
[UTF-8] (original)
+++ sis/branches/JDK8/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/gpx/GPXConstants.java
[UTF-8] Thu Nov  3 10:36:58 2016
@@ -277,7 +277,7 @@ public final class GPXConstants extends
         builder.addAttribute(String  .class).setName(TAG_CMT);
         builder.addAttribute(String  .class).setName(TAG_DESC);
         builder.addAttribute(String  .class).setName(TAG_SRC);
-        builder.addAttribute(URI     .class).setName(TAG_LINK).setCardinality(0, Integer.MAX_VALUE);
+        builder.addAttribute(URI     .class).setName(TAG_LINK).setMaximumOccurs(Integer.MAX_VALUE);
         builder.addAttribute(String  .class).setName(TAG_WPT_SYM);
         builder.addAttribute(String  .class).setName(TAG_TYPE);
         builder.addAttribute(String  .class).setName(TAG_WPT_FIX);



Mime
View raw message