asafbibas / jmonkeyengine

Automatically exported from code.google.com/p/jmonkeyengine
0 stars 0 forks source link

Argument validation in IntMap allows initialCapacity to be 0. #464

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
In the IntMap constructor, the argument validation allows initialCapacity to be 
0, but this does not appear to have been the intention given the error message.

------------------------------------------------------
if (initialCapacity < 0){
   throw new IllegalArgumentException("initialCapacity must be greater than zero.");
}
------------------------------------------------------

Also, the message in the exception thrown by the loadFactor check should be 
changed to "loadFactor must be...".

------------------------------------------------------
if (loadFactor <= 0){
   throw new IllegalArgumentException("initialCapacity must be greater than zero.");
}
------------------------------------------------------

Original issue reported on code.google.com by roja...@gmail.com on 12 Feb 2012 at 12:27

GoogleCodeExporter commented 8 years ago

Original comment by ShadowIs...@gmail.com on 1 Jun 2012 at 4:10