polygene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From paulmer...@apache.org
Subject [2/2] polygene-java git commit: POLYGENE-248 Add ManyAssociation.clear() & NamedAssociation.clear()
Date Sun, 23 Apr 2017 13:01:12 GMT
POLYGENE-248 Add ManyAssociation.clear() & NamedAssociation.clear()


Project: http://git-wip-us.apache.org/repos/asf/polygene-java/repo
Commit: http://git-wip-us.apache.org/repos/asf/polygene-java/commit/3d33ead7
Tree: http://git-wip-us.apache.org/repos/asf/polygene-java/tree/3d33ead7
Diff: http://git-wip-us.apache.org/repos/asf/polygene-java/diff/3d33ead7

Branch: refs/heads/develop
Commit: 3d33ead72bad04555bd44ec5850259dd2e4849ac
Parents: e661108
Author: Paul Merlin <paulmerlin@apache.org>
Authored: Sun Apr 23 14:51:35 2017 +0200
Committer: Paul Merlin <paulmerlin@apache.org>
Committed: Sun Apr 23 14:51:35 2017 +0200

----------------------------------------------------------------------
 .../api/association/ManyAssociation.java        |  9 +++++++
 .../api/association/ManyAssociationWrapper.java |  6 +++++
 .../api/association/NamedAssociation.java       |  8 +++++-
 .../association/NamedAssociationWrapper.java    |  6 +++++
 .../association/ManyAssociationInstance.java    |  7 +++++
 .../association/NamedAssociationInstance.java   |  7 +++++
 .../composite/FunctionStateResolver.java        |  4 +--
 .../unitofwork/BuilderManyAssociationState.java | 11 ++++++++
 .../BuilderNamedAssociationState.java           | 11 ++++++++
 .../value/ManyAssociationValueState.java        | 14 ++++++++--
 .../value/NamedAssociationValueState.java       | 11 ++++++++
 .../spi/entity/ManyAssociationState.java        |  2 ++
 .../spi/entity/NamedAssociationState.java       |  2 ++
 .../helpers/DefaultManyAssociationState.java    | 17 +++++++++++-
 .../helpers/DefaultNamedAssociationState.java   | 12 +++++++++
 .../entitystore/helpers/JSONEntityState.java    | 28 ++++++++++++++++++++
 .../helpers/JSONManyAssociationState.java       | 11 ++++++++
 .../helpers/JSONNamedAssociationState.java      | 11 ++++++++
 .../library/rest/admin/EntityResource.java      | 10 ++-----
 .../binding/internal/BoundManyAssociation.java  |  6 +++++
 .../binding/internal/BoundNamedAssociation.java |  6 +++++
 21 files changed, 185 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/polygene-java/blob/3d33ead7/core/api/src/main/java/org/apache/polygene/api/association/ManyAssociation.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/apache/polygene/api/association/ManyAssociation.java
b/core/api/src/main/java/org/apache/polygene/api/association/ManyAssociation.java
index cac7613..b7b7f7f 100644
--- a/core/api/src/main/java/org/apache/polygene/api/association/ManyAssociation.java
+++ b/core/api/src/main/java/org/apache/polygene/api/association/ManyAssociation.java
@@ -68,6 +68,15 @@ public interface ManyAssociation<T> extends Iterable<T>, AbstractAssociation
      */
     boolean remove( T entity );
 
+    /**
+     * Clear all entities from this {@code ManyAssociation}.
+     * <p>
+     *     All entity references present is removed from this collection.
+     * </p>
+     * @return true if any entity reference was removed, otherwise false
+     */
+    boolean clear();
+
     /** Fetch the entity refrence at the given index and fetch the entity from the entity
store.
      *
      * @param index The index location in the collection of the entity reference to be fetched.

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/3d33ead7/core/api/src/main/java/org/apache/polygene/api/association/ManyAssociationWrapper.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/apache/polygene/api/association/ManyAssociationWrapper.java
b/core/api/src/main/java/org/apache/polygene/api/association/ManyAssociationWrapper.java
index 8465995..e2f95e1 100644
--- a/core/api/src/main/java/org/apache/polygene/api/association/ManyAssociationWrapper.java
+++ b/core/api/src/main/java/org/apache/polygene/api/association/ManyAssociationWrapper.java
@@ -76,6 +76,12 @@ public class ManyAssociationWrapper
     }
 
     @Override
+    public boolean clear()
+    {
+        return next.clear();
+    }
+
+    @Override
     public Object get( int i )
     {
         return next.get( i );

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/3d33ead7/core/api/src/main/java/org/apache/polygene/api/association/NamedAssociation.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/apache/polygene/api/association/NamedAssociation.java
b/core/api/src/main/java/org/apache/polygene/api/association/NamedAssociation.java
index 6b5f7a6..b8a62da 100644
--- a/core/api/src/main/java/org/apache/polygene/api/association/NamedAssociation.java
+++ b/core/api/src/main/java/org/apache/polygene/api/association/NamedAssociation.java
@@ -44,7 +44,7 @@ public interface NamedAssociation<T>
     boolean containsName( String name );
 
     /**
-     * Adds a named assocation.
+     * Adds a named association.
      * @param name The name of the association.
      * @param entity The entity for this named association.
      * @return true if putted, false otherwise
@@ -59,6 +59,12 @@ public interface NamedAssociation<T>
     boolean remove( String name );
 
     /**
+     * Clear all named associations.
+     * @return true if cleared, false otherwise
+     */
+    boolean clear();
+
+    /**
      * Retrieves a named association.
      * @param name The name of the association.
      * @return The entity that has previously been associated.

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/3d33ead7/core/api/src/main/java/org/apache/polygene/api/association/NamedAssociationWrapper.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/apache/polygene/api/association/NamedAssociationWrapper.java
b/core/api/src/main/java/org/apache/polygene/api/association/NamedAssociationWrapper.java
index 4a2dcf1..1f92767 100644
--- a/core/api/src/main/java/org/apache/polygene/api/association/NamedAssociationWrapper.java
+++ b/core/api/src/main/java/org/apache/polygene/api/association/NamedAssociationWrapper.java
@@ -75,6 +75,12 @@ public class NamedAssociationWrapper
     }
 
     @Override
+    public boolean clear()
+    {
+        return next.clear();
+    }
+
+    @Override
     public Object get( String name )
     {
         return next.get( name );

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/3d33ead7/core/runtime/src/main/java/org/apache/polygene/runtime/association/ManyAssociationInstance.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/polygene/runtime/association/ManyAssociationInstance.java
b/core/runtime/src/main/java/org/apache/polygene/runtime/association/ManyAssociationInstance.java
index a30acf7..e8dd66c 100644
--- a/core/runtime/src/main/java/org/apache/polygene/runtime/association/ManyAssociationInstance.java
+++ b/core/runtime/src/main/java/org/apache/polygene/runtime/association/ManyAssociationInstance.java
@@ -92,6 +92,13 @@ public class ManyAssociationInstance<T>
     }
 
     @Override
+    public boolean clear()
+    {
+        checkImmutable();
+        return manyAssociationState.clear();
+    }
+
+    @Override
     public T get( int i )
     {
         return getEntity( manyAssociationState.get( i ) );

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/3d33ead7/core/runtime/src/main/java/org/apache/polygene/runtime/association/NamedAssociationInstance.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/polygene/runtime/association/NamedAssociationInstance.java
b/core/runtime/src/main/java/org/apache/polygene/runtime/association/NamedAssociationInstance.java
index c351e0f..536a6ca 100644
--- a/core/runtime/src/main/java/org/apache/polygene/runtime/association/NamedAssociationInstance.java
+++ b/core/runtime/src/main/java/org/apache/polygene/runtime/association/NamedAssociationInstance.java
@@ -89,6 +89,13 @@ public class NamedAssociationInstance<T>
     }
 
     @Override
+    public boolean clear()
+    {
+        checkImmutable();
+        return namedAssociationState.clear();
+    }
+
+    @Override
     public T get( String name )
     {
         return getEntity( namedAssociationState.get( name ) );

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/3d33ead7/core/runtime/src/main/java/org/apache/polygene/runtime/composite/FunctionStateResolver.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/polygene/runtime/composite/FunctionStateResolver.java
b/core/runtime/src/main/java/org/apache/polygene/runtime/composite/FunctionStateResolver.java
index 0b2a2ce..3f0d3bc 100644
--- a/core/runtime/src/main/java/org/apache/polygene/runtime/composite/FunctionStateResolver.java
+++ b/core/runtime/src/main/java/org/apache/polygene/runtime/composite/FunctionStateResolver.java
@@ -95,7 +95,7 @@ public class FunctionStateResolver
             {
                 ManyAssociationState associationState = state.manyAssociationValueOf( manyAssDesc.qualifiedName()
);
                 // First clear existing ones
-                associationState.forEach( associationState::remove );
+                associationState.clear();
                 // then add the new ones.
                 getManyAssociationState( manyAssDesc ).forEach( ref -> associationState.add(
0, ref ) );
             } );
@@ -104,7 +104,7 @@ public class FunctionStateResolver
             {
                 NamedAssociationState associationState = state.namedAssociationValueOf( namedAssDesc.qualifiedName()
);
                 // First clear existing ones
-                associationState.forEach( associationState::remove );
+                associationState.clear();
                 // then add the new ones.
                 getNamedAssociationState( namedAssDesc )
                     .forEach( entry -> associationState.put( entry.getKey(), entry.getValue()
) );

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/3d33ead7/core/runtime/src/main/java/org/apache/polygene/runtime/unitofwork/BuilderManyAssociationState.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/polygene/runtime/unitofwork/BuilderManyAssociationState.java
b/core/runtime/src/main/java/org/apache/polygene/runtime/unitofwork/BuilderManyAssociationState.java
index 3b482d7..35ad938 100644
--- a/core/runtime/src/main/java/org/apache/polygene/runtime/unitofwork/BuilderManyAssociationState.java
+++ b/core/runtime/src/main/java/org/apache/polygene/runtime/unitofwork/BuilderManyAssociationState.java
@@ -71,6 +71,17 @@ public final class BuilderManyAssociationState
     }
 
     @Override
+    public boolean clear()
+    {
+        if( !references.isEmpty() )
+        {
+            references.clear();
+            return true;
+        }
+        return false;
+    }
+
+    @Override
     public EntityReference get( int i )
     {
         return references.get( i );

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/3d33ead7/core/runtime/src/main/java/org/apache/polygene/runtime/unitofwork/BuilderNamedAssociationState.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/polygene/runtime/unitofwork/BuilderNamedAssociationState.java
b/core/runtime/src/main/java/org/apache/polygene/runtime/unitofwork/BuilderNamedAssociationState.java
index d50d79b..f7882be 100644
--- a/core/runtime/src/main/java/org/apache/polygene/runtime/unitofwork/BuilderNamedAssociationState.java
+++ b/core/runtime/src/main/java/org/apache/polygene/runtime/unitofwork/BuilderNamedAssociationState.java
@@ -64,6 +64,17 @@ public final class BuilderNamedAssociationState
     }
 
     @Override
+    public boolean clear()
+    {
+        if( !references.isEmpty() )
+        {
+            references.clear();
+            return true;
+        }
+        return false;
+    }
+
+    @Override
     public EntityReference get( String name )
     {
         return references.get( name );

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/3d33ead7/core/runtime/src/main/java/org/apache/polygene/runtime/value/ManyAssociationValueState.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/polygene/runtime/value/ManyAssociationValueState.java
b/core/runtime/src/main/java/org/apache/polygene/runtime/value/ManyAssociationValueState.java
index c386802..590f25d 100644
--- a/core/runtime/src/main/java/org/apache/polygene/runtime/value/ManyAssociationValueState.java
+++ b/core/runtime/src/main/java/org/apache/polygene/runtime/value/ManyAssociationValueState.java
@@ -64,8 +64,18 @@ public class ManyAssociationValueState
     @Override
     public boolean remove( EntityReference entity )
     {
-        boolean removed = references.remove( entity );
-        return removed;
+        return references.remove( entity );
+    }
+
+    @Override
+    public boolean clear()
+    {
+        if( !references.isEmpty() )
+        {
+            references.clear();
+            return true;
+        }
+        return false;
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/3d33ead7/core/runtime/src/main/java/org/apache/polygene/runtime/value/NamedAssociationValueState.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/polygene/runtime/value/NamedAssociationValueState.java
b/core/runtime/src/main/java/org/apache/polygene/runtime/value/NamedAssociationValueState.java
index 50c20ca..c15b950 100644
--- a/core/runtime/src/main/java/org/apache/polygene/runtime/value/NamedAssociationValueState.java
+++ b/core/runtime/src/main/java/org/apache/polygene/runtime/value/NamedAssociationValueState.java
@@ -59,6 +59,17 @@ public class NamedAssociationValueState
     }
 
     @Override
+    public boolean clear()
+    {
+        if( !references.isEmpty() )
+        {
+            references.clear();
+            return true;
+        }
+        return false;
+    }
+
+    @Override
     public EntityReference get( String name )
     {
         return references.get( name );

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/3d33ead7/core/spi/src/main/java/org/apache/polygene/spi/entity/ManyAssociationState.java
----------------------------------------------------------------------
diff --git a/core/spi/src/main/java/org/apache/polygene/spi/entity/ManyAssociationState.java
b/core/spi/src/main/java/org/apache/polygene/spi/entity/ManyAssociationState.java
index a578c10..5f3b32a 100644
--- a/core/spi/src/main/java/org/apache/polygene/spi/entity/ManyAssociationState.java
+++ b/core/spi/src/main/java/org/apache/polygene/spi/entity/ManyAssociationState.java
@@ -39,6 +39,8 @@ public interface ManyAssociationState
 
     boolean remove( EntityReference entityReference );
 
+    boolean clear();
+
     EntityReference get( int index );
 
     default Stream<EntityReference> stream() {

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/3d33ead7/core/spi/src/main/java/org/apache/polygene/spi/entity/NamedAssociationState.java
----------------------------------------------------------------------
diff --git a/core/spi/src/main/java/org/apache/polygene/spi/entity/NamedAssociationState.java
b/core/spi/src/main/java/org/apache/polygene/spi/entity/NamedAssociationState.java
index 23a1073..c2a6030 100644
--- a/core/spi/src/main/java/org/apache/polygene/spi/entity/NamedAssociationState.java
+++ b/core/spi/src/main/java/org/apache/polygene/spi/entity/NamedAssociationState.java
@@ -42,6 +42,8 @@ public interface NamedAssociationState
 
     boolean remove( String name );
 
+    boolean clear();
+
     EntityReference get( String name );
 
     String nameOf( EntityReference entityReference );

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/3d33ead7/core/spi/src/main/java/org/apache/polygene/spi/entitystore/helpers/DefaultManyAssociationState.java
----------------------------------------------------------------------
diff --git a/core/spi/src/main/java/org/apache/polygene/spi/entitystore/helpers/DefaultManyAssociationState.java
b/core/spi/src/main/java/org/apache/polygene/spi/entitystore/helpers/DefaultManyAssociationState.java
index 67e715c..9e95188 100644
--- a/core/spi/src/main/java/org/apache/polygene/spi/entitystore/helpers/DefaultManyAssociationState.java
+++ b/core/spi/src/main/java/org/apache/polygene/spi/entitystore/helpers/DefaultManyAssociationState.java
@@ -69,11 +69,26 @@ public final class DefaultManyAssociationState
     public boolean remove( EntityReference entity )
     {
         boolean removed = references.remove( entity );
-        entityState.markUpdated();
+        if( removed )
+        {
+            entityState.markUpdated();
+        }
         return removed;
     }
 
     @Override
+    public boolean clear()
+    {
+        if( !references.isEmpty() )
+        {
+            references.clear();
+            entityState.markUpdated();
+            return true;
+        }
+        return false;
+    }
+
+    @Override
     public EntityReference get( int i )
     {
         return references.get( i );

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/3d33ead7/core/spi/src/main/java/org/apache/polygene/spi/entitystore/helpers/DefaultNamedAssociationState.java
----------------------------------------------------------------------
diff --git a/core/spi/src/main/java/org/apache/polygene/spi/entitystore/helpers/DefaultNamedAssociationState.java
b/core/spi/src/main/java/org/apache/polygene/spi/entitystore/helpers/DefaultNamedAssociationState.java
index a85e1d9..94f30ca 100644
--- a/core/spi/src/main/java/org/apache/polygene/spi/entitystore/helpers/DefaultNamedAssociationState.java
+++ b/core/spi/src/main/java/org/apache/polygene/spi/entitystore/helpers/DefaultNamedAssociationState.java
@@ -75,6 +75,18 @@ public final class DefaultNamedAssociationState
     }
 
     @Override
+    public boolean clear()
+    {
+        if( !references.isEmpty() )
+        {
+            references.clear();
+            entityState.markUpdated();
+            return true;
+        }
+        return false;
+    }
+
+    @Override
     public EntityReference get( String name )
     {
         return references.get( name );

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/3d33ead7/core/spi/src/main/java/org/apache/polygene/spi/entitystore/helpers/JSONEntityState.java
----------------------------------------------------------------------
diff --git a/core/spi/src/main/java/org/apache/polygene/spi/entitystore/helpers/JSONEntityState.java
b/core/spi/src/main/java/org/apache/polygene/spi/entitystore/helpers/JSONEntityState.java
index 0c38436..7bb6c2e 100644
--- a/core/spi/src/main/java/org/apache/polygene/spi/entitystore/helpers/JSONEntityState.java
+++ b/core/spi/src/main/java/org/apache/polygene/spi/entitystore/helpers/JSONEntityState.java
@@ -307,6 +307,20 @@ public final class JSONEntityState
         }
     }
 
+    void stateCloneClearManyAssociation( String stateName )
+    {
+        JsonObject valueState = state.getJsonObject( JSONKeys.VALUE );
+        if( valueState.containsKey( stateName ) )
+        {
+            valueState = jsonFactories.cloneBuilderExclude( valueState, stateName )
+                                      .add( stateName, jsonFactories.builderFactory().createArrayBuilder().build()
)
+                                      .build();
+            state = jsonFactories.cloneBuilderExclude( state, JSONKeys.VALUE )
+                                 .add( JSONKeys.VALUE, valueState )
+                                 .build();
+        }
+    }
+
     void stateCloneAddNamedAssociation( String stateName, String name, EntityReference ref
)
     {
         JsonObject valueState = state.getJsonObject( JSONKeys.VALUE );
@@ -337,4 +351,18 @@ public final class JSONEntityState
                                  .build();
         }
     }
+
+    void stateCloneClearNamedAssociation( String stateName )
+    {
+        JsonObject valueState = state.getJsonObject( JSONKeys.VALUE );
+        if( valueState.containsKey( stateName ) )
+        {
+            valueState = jsonFactories.cloneBuilderExclude( valueState, stateName )
+                                      .add( stateName, jsonFactories.builderFactory().createObjectBuilder().build()
)
+                                      .build();
+            state = jsonFactories.cloneBuilderExclude( state, JSONKeys.VALUE )
+                                 .add( JSONKeys.VALUE, valueState )
+                                 .build();
+        }
+    }
 }

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/3d33ead7/core/spi/src/main/java/org/apache/polygene/spi/entitystore/helpers/JSONManyAssociationState.java
----------------------------------------------------------------------
diff --git a/core/spi/src/main/java/org/apache/polygene/spi/entitystore/helpers/JSONManyAssociationState.java
b/core/spi/src/main/java/org/apache/polygene/spi/entitystore/helpers/JSONManyAssociationState.java
index 3bdd047..275da51 100644
--- a/core/spi/src/main/java/org/apache/polygene/spi/entitystore/helpers/JSONManyAssociationState.java
+++ b/core/spi/src/main/java/org/apache/polygene/spi/entitystore/helpers/JSONManyAssociationState.java
@@ -104,6 +104,17 @@ public final class JSONManyAssociationState
     }
 
     @Override
+    public boolean clear()
+    {
+        if( count() > 0 )
+        {
+            entityState.stateCloneClearManyAssociation( stateName );
+            entityState.markUpdated();
+        }
+        return false;
+    }
+
+    @Override
     public EntityReference get( int i )
     {
         return EntityReference.parseEntityReference( getReferences().getString( i ) );

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/3d33ead7/core/spi/src/main/java/org/apache/polygene/spi/entitystore/helpers/JSONNamedAssociationState.java
----------------------------------------------------------------------
diff --git a/core/spi/src/main/java/org/apache/polygene/spi/entitystore/helpers/JSONNamedAssociationState.java
b/core/spi/src/main/java/org/apache/polygene/spi/entitystore/helpers/JSONNamedAssociationState.java
index a59f50d..1981eb9 100644
--- a/core/spi/src/main/java/org/apache/polygene/spi/entitystore/helpers/JSONNamedAssociationState.java
+++ b/core/spi/src/main/java/org/apache/polygene/spi/entitystore/helpers/JSONNamedAssociationState.java
@@ -106,6 +106,17 @@ public final class JSONNamedAssociationState
     }
 
     @Override
+    public boolean clear()
+    {
+        if( count() > 0 )
+        {
+            entityState.stateCloneClearNamedAssociation( stateName );
+            entityState.markUpdated();
+        }
+        return false;
+    }
+
+    @Override
     public EntityReference get( String name )
     {
         String stringRef = getReferences().getString( name, null );

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/3d33ead7/libraries/rest/src/main/java/org/apache/polygene/library/rest/admin/EntityResource.java
----------------------------------------------------------------------
diff --git a/libraries/rest/src/main/java/org/apache/polygene/library/rest/admin/EntityResource.java
b/libraries/rest/src/main/java/org/apache/polygene/library/rest/admin/EntityResource.java
index 9eb3c17..99a538c 100644
--- a/libraries/rest/src/main/java/org/apache/polygene/library/rest/admin/EntityResource.java
+++ b/libraries/rest/src/main/java/org/apache/polygene/library/rest/admin/EntityResource.java
@@ -401,10 +401,7 @@ public class EntityResource
                 if( newStringAssociation == null )
                 {
                     // Remove "left-overs"
-                    for( EntityReference entityReference : manyAssociation )
-                    {
-                        manyAssociation.remove( entityReference );
-                    }
+                    manyAssociation.clear();
                 }
                 else
                 {
@@ -455,10 +452,7 @@ public class EntityResource
                 if( newStringAssociation == null )
                 {
                     // Remove "left-overs"
-                    for( String name : namedAssociation )
-                    {
-                        namedAssociation.remove( name );
-                    }
+                    namedAssociation.clear();
                 }
                 else
                 {

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/3d33ead7/samples/swing/src/main/java/org/apache/polygene/sample/swing/binding/internal/BoundManyAssociation.java
----------------------------------------------------------------------
diff --git a/samples/swing/src/main/java/org/apache/polygene/sample/swing/binding/internal/BoundManyAssociation.java
b/samples/swing/src/main/java/org/apache/polygene/sample/swing/binding/internal/BoundManyAssociation.java
index 862a683..4f9cee1 100644
--- a/samples/swing/src/main/java/org/apache/polygene/sample/swing/binding/internal/BoundManyAssociation.java
+++ b/samples/swing/src/main/java/org/apache/polygene/sample/swing/binding/internal/BoundManyAssociation.java
@@ -62,6 +62,12 @@ public class BoundManyAssociation<T> extends AbstractBinding<T>
         return actualAssociations.remove( o );
     }
 
+    @Override
+    public boolean clear()
+    {
+        return actualAssociations.clear();
+    }
+
     public T get( int index )
     {
         return actualAssociations.get( index );

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/3d33ead7/samples/swing/src/main/java/org/apache/polygene/sample/swing/binding/internal/BoundNamedAssociation.java
----------------------------------------------------------------------
diff --git a/samples/swing/src/main/java/org/apache/polygene/sample/swing/binding/internal/BoundNamedAssociation.java
b/samples/swing/src/main/java/org/apache/polygene/sample/swing/binding/internal/BoundNamedAssociation.java
index 3afca07..e7116e6 100644
--- a/samples/swing/src/main/java/org/apache/polygene/sample/swing/binding/internal/BoundNamedAssociation.java
+++ b/samples/swing/src/main/java/org/apache/polygene/sample/swing/binding/internal/BoundNamedAssociation.java
@@ -78,6 +78,12 @@ public class BoundNamedAssociation<T>
     }
 
     @Override
+    public boolean clear()
+    {
+        return actualAssociations.clear();
+    }
+
+    @Override
     public T get( String name )
     {
         return actualAssociations.get( name );


Mime
View raw message