commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gilles (JIRA)" <>
Subject [jira] [Commented] (MATH-963) Interface "RandomGenerator" is missing "nextLong(long)" method
Date Thu, 04 Apr 2013 22:22:16 GMT


Gilles commented on MATH-963:

bq. [...] RandomGenerator is supposed to be a straight replacement for j.u.Random.

In what sense?
"j.u.Random" not being an interface (CM's "RandomGenerator" is one, and thus cannot extend
the former), a user code cannot pass an instance of "RandomGenerator" in place of "j.u.Random".

If the goal is for "RandomGenerator" to provide identically named methods, this is fine but
nothing forbids CM to be more complete and add other methods.

If the goal (for whatever reason) is to exactly mimic the contents of "j.u.Random", I would
change this issue to ask for the removal of the additional "setSeed" methods that exist in
"RandomGenerator" but not in "j.u.Random".

bq. better to just add it to the abstract class

Then, what about removing the interface (i.e. merging) and keep only the abstract class?

> Interface "RandomGenerator" is missing "nextLong(long)" method
> --------------------------------------------------------------
>                 Key: MATH-963
>                 URL:
>             Project: Commons Math
>          Issue Type: Bug
>    Affects Versions: 3.2
>            Reporter: Gilles
>            Priority: Trivial
>              Labels: api-change
> There is a method "nextInt(int)" but not "nextLong(long)".
> The "BitsStreamGenerator" class already implements it.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:

View raw message