sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1755505 - in /sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/builder: CharacteristicTypeBuilder.java PropertyTypeBuilder.java RemoveOnlyList.java TypeBuilder.java
Date Mon, 08 Aug 2016 13:52:18 GMT
Author: desruisseaux
Date: Mon Aug  8 13:52:18 2016
New Revision: 1755505

URL: http://svn.apache.org/viewvc?rev=1755505&view=rev
Log:
RemoveOnlyList.remove(E) shall check if the removed property is the default geometry.
This check is done indirectly by AttributeTypeBuilder.remove().

Modified:
    sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/builder/CharacteristicTypeBuilder.java
    sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/builder/PropertyTypeBuilder.java
    sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/builder/RemoveOnlyList.java
    sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/builder/TypeBuilder.java

Modified: sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/builder/CharacteristicTypeBuilder.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/builder/CharacteristicTypeBuilder.java?rev=1755505&r1=1755504&r2=1755505&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/builder/CharacteristicTypeBuilder.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/builder/CharacteristicTypeBuilder.java
[UTF-8] Mon Aug  8 13:52:18 2016
@@ -216,7 +216,7 @@ public final class CharacteristicTypeBui
         final CharacteristicTypeBuilder<N> newb = new CharacteristicTypeBuilder<>(this,
type);
         owner.characteristics.set(owner.characteristics.lastIndexOf(this), newb);
         // Note: a negative lastIndexOf(old) would be a bug in our algorithm.
-        dispose();
+        owner = null;
         return newb;
     }
 
@@ -304,27 +304,18 @@ public final class CharacteristicTypeBui
     }
 
     /**
-     * Flags this builder as a disposed one. The builder should not be used anymore after
this method call.
-     *
-     * @see #remove()
-     */
-    @Override
-    final void dispose() {
-        owner = null;
-    }
-
-    /**
      * Removes this characteristics from the {@code AttributeTypeBuilder}.
      * After this method has been invoked, this {@code CharacteristicTypeBuilder} instance
      * is no longer in the list returned by {@link AttributeTypeBuilder#characteristics()}
      * and attempts to invoke any setter method on {@code this} will cause an
      * {@link IllegalStateException} to be thrown.
      */
+    @Override
     public void remove() {
         if (owner != null) {
             owner.characteristics.remove(owner.characteristics.lastIndexOf(this));
             // Note: a negative lastIndexOf(old) would be a bug in our algorithm.
-            dispose();
+            owner = null;
         }
     }
 }

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=1755505&r1=1755504&r2=1755505&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] Mon Aug  8 13:52:18 2016
@@ -246,7 +246,6 @@ public abstract class PropertyTypeBuilde
     /**
      * Flags this builder as a disposed one. The builder should not be used anymore after
this method call.
      */
-    @Override
     final void dispose() {
         owner = null;
     }
@@ -258,6 +257,7 @@ public abstract class PropertyTypeBuilde
      * and attempts to invoke any setter method on {@code this} will cause an
      * {@link IllegalStateException} to be thrown.
      */
+    @Override
     public void remove() {
         if (owner != null) {
             owner.replace(this, null);

Modified: sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/builder/RemoveOnlyList.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/builder/RemoveOnlyList.java?rev=1755505&r1=1755504&r2=1755505&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/builder/RemoveOnlyList.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/builder/RemoveOnlyList.java
[UTF-8] Mon Aug  8 13:52:18 2016
@@ -65,17 +65,8 @@ final class RemoveOnlyList<E extends Typ
     public E remove(int index) {
         final E element = elements.get(index);
         if (element != null) {
-            element.dispose();
+            element.remove();
         }
         return element;
     }
-
-    /**
-     * Flags all elements as not usable anymore, then remove all of them.
-     */
-    @Override
-    public void clear() {
-        elements.forEach(TypeBuilder::dispose);
-        elements.clear();
-    }
 }

Modified: sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/builder/TypeBuilder.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/builder/TypeBuilder.java?rev=1755505&r1=1755504&r2=1755505&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/builder/TypeBuilder.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/builder/TypeBuilder.java
[UTF-8] Mon Aug  8 13:52:18 2016
@@ -457,7 +457,7 @@ public abstract class TypeBuilder implem
      * Invoked when a type builder has been removed from its parent.
      * Subclasses should override this method in a way that flag the builder as not usable
anymore.
      */
-    void dispose() {
+    void remove() {
     }
 
     /**



Mime
View raw message