Author: max.andersen(a)jboss.com
Date: 2006-10-16 11:47:19 -0400 (Mon, 16 Oct 2006)
New Revision: 10588
Modified:
branches/Branch_3_2/Hibernate3/src/org/hibernate/collection/PersistentSet.java
branches/Branch_3_2/Hibernate3/test/org/hibernate/test/collection/set/PersistentSetTest.java
Log:
HHH-2145 set.retainAll calling set.addAll (with unittest)
Modified: branches/Branch_3_2/Hibernate3/src/org/hibernate/collection/PersistentSet.java
===================================================================
---
branches/Branch_3_2/Hibernate3/src/org/hibernate/collection/PersistentSet.java 2006-10-16
14:59:57 UTC (rev 10587)
+++
branches/Branch_3_2/Hibernate3/src/org/hibernate/collection/PersistentSet.java 2006-10-16
15:47:19 UTC (rev 10588)
@@ -260,7 +260,7 @@
*/
public boolean retainAll(Collection coll) {
initialize( true );
- if ( set.addAll( coll ) ) {
+ if ( set.retainAll( coll ) ) {
dirty();
return true;
}
Modified:
branches/Branch_3_2/Hibernate3/test/org/hibernate/test/collection/set/PersistentSetTest.java
===================================================================
---
branches/Branch_3_2/Hibernate3/test/org/hibernate/test/collection/set/PersistentSetTest.java 2006-10-16
14:59:57 UTC (rev 10587)
+++
branches/Branch_3_2/Hibernate3/test/org/hibernate/test/collection/set/PersistentSetTest.java 2006-10-16
15:47:19 UTC (rev 10588)
@@ -59,6 +59,10 @@
otherSet.add( otherChild );
assertFalse( children.removeAll( otherSet ) );
assertFalse( children.isDirty() );
+
+ assertTrue( children.retainAll( otherSet ));
+ assertTrue( children.isDirty() );
+ assertTrue( children.isEmpty() );
children.clear();
session.delete( child );
@@ -73,4 +77,5 @@
session.getTransaction().commit();
session.close();
}
+
}
Show replies by date