@ -168,25 +171,22 @@ public class BasicAclEntryAfterInvocationCollectionFilteringProvider
@@ -168,25 +171,22 @@ public class BasicAclEntryAfterInvocationCollectionFilteringProvider
returnnull;
}
if(!(returnedObjectinstanceofCollection)){
Filtererfilterer=null;
if(returnedObjectinstanceofCollection){
Collectioncollection=(Collection)returnedObject;
filterer=newCollectionFilterer(collection);
}elseif(returnedObject.getClass().isArray()){
Object[]array=(Object[])returnedObject;
filterer=newArrayFilterer(array);
}else{
thrownewAuthorizationServiceException(
"A Collection (or null) was required as the returnedObject, but the returnedObject was: "
"A Collection or an array (or null) was required as the returnedObject, but the returnedObject was: "
+returnedObject);
}
Collectioncollection=(Collection)returnedObject;
// We create a Set of objects to be removed from the Collection,
// as ConcurrentModificationException prevents removal during
// iteration, and making a new Collection to be returned is
// problematic as the original Collection implementation passed
// to the method may not necessarily be re-constructable (as
// the Collection(collection) constructor is not guaranteed and
// manually adding may lose sort order or other capabilities)
SetremoveList=newHashSet();
// Locate unauthorised Collection elements
IteratorcollectionIter=collection.iterator();
IteratorcollectionIter=filterer.iterator();
while(collectionIter.hasNext()){
ObjectdomainObject=collectionIter.next();
@ -228,7 +228,7 @@ public class BasicAclEntryAfterInvocationCollectionFilteringProvider
@@ -228,7 +228,7 @@ public class BasicAclEntryAfterInvocationCollectionFilteringProvider
}
if(!hasPermission){
removeList.add(domainObject);
filterer.remove(domainObject);
if(logger.isDebugEnabled()){
logger.debug(
@ -238,22 +238,7 @@ public class BasicAclEntryAfterInvocationCollectionFilteringProvider
@@ -238,22 +238,7 @@ public class BasicAclEntryAfterInvocationCollectionFilteringProvider
}
}
// Now the Iterator has ended, remove Objects from Collection
IteratorremoveIter=removeList.iterator();
intoriginalSize=collection.size();
while(removeIter.hasNext()){
collection.remove(removeIter.next());
}
if(logger.isDebugEnabled()){
logger.debug("Original collection contained "
+originalSize+" elements; now contains "
+collection.size()+" elements");
}
returncollection;
returnfilterer.getFilteredObject();
}
}
@ -281,3 +266,170 @@ public class BasicAclEntryAfterInvocationCollectionFilteringProvider
@@ -281,3 +266,170 @@ public class BasicAclEntryAfterInvocationCollectionFilteringProvider
@ -167,6 +167,44 @@ public class BasicAclEntryAfterInvocationCollectionFilteringProviderTests
@@ -167,6 +167,44 @@ public class BasicAclEntryAfterInvocationCollectionFilteringProviderTests