HHH-2749 : direct use of LinkedHashSet/LinkedHashMap

git-svn-id: https://svn.jboss.org/repos/hibernate/core/trunk@12931 1b8cb986-b30d-0410-93ca-fae66ebed9b2
This commit is contained in:
Steve Ebersole 2007-08-13 22:38:26 +00:00
parent 557a922698
commit 379fe5f3d4
2 changed files with 6 additions and 2 deletions

View File

@ -24,7 +24,9 @@ public class OrderedMapType extends MapType {
* {@inheritDoc}
*/
public Object instantiate(int anticipatedSize) {
return new LinkedHashMap( anticipatedSize );
return anticipatedSize > 0
? new LinkedHashMap( anticipatedSize )
: new LinkedHashMap();
}
}

View File

@ -24,7 +24,9 @@ public class OrderedSetType extends SetType {
* {@inheritDoc}
*/
public Object instantiate(int anticipatedSize) {
return new LinkedHashSet( anticipatedSize );
return anticipatedSize > 0
? new LinkedHashSet( anticipatedSize )
: new LinkedHashSet();
}
}