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:
parent
557a922698
commit
379fe5f3d4
|
@ -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();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue