Closed emopers closed 8 years ago
The Random_OverrideNext property has a typo! It used a wrong data type: it used Integer instead of int, for the data type of the parameter of the method next(int bits).
A quick fix is modifying the only statement in the try block.
Method nextmethod = klass.getDeclaredMethod("next", int.class
);
@emopers what do you think?
@xiaohe27 Thanks for the feedback! That fix looks good for us
The Random_OverrideNext property should only be violated if a subclass of
java.util.Random
does not override thenext(int bits)
method. Howerver, I have seen it violated in two perfectly legal scenarios, including PassphraseBasedPRNG.java which is a subclass ofjava.util.Random
and clearly overridesnext(int bits)
. Can someone please explain this?