You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description: A rule that would make sure that you should only be using the primed static SecureRandom instance (this is mainly because the application, if the object is not being reused, is getting slow and I mean like 90 seconds slower to do the seeding and all other stuff that does in the background, so the solution is to create SecureRandom and reuse it if required, creating new SecureRandom impacts performance of the application dramatically).
Code Sample: This should include code, that should be flagged by the rule. If possible, the "correct" code
according to this new rule should also be demonstrated.
If I understand this correctly, the goal would be to reuse a instance of SecureRandom rather than always creating a fresh one when needed. This helps in performance, because then the reseeding (which may block on calls to nextBytes()) occurs less often.
With that, I'd suggest the category "performance" and a rule name like "ReuseSecureRandom" or "ShareSecureRandom". Making it static is just one implementation solution to share the secure random.
Proposed Rule Name: ReuseSecureRandom
Proposed Category: Performance
Description: A rule that would make sure that you should only be using the primed static SecureRandom instance (this is mainly because the application, if the object is not being reused, is getting slow and I mean like 90 seconds slower to do the seeding and all other stuff that does in the background, so the solution is to create SecureRandom and reuse it if required, creating new SecureRandom impacts performance of the application dramatically).
Code Sample: This should include code, that should be flagged by the rule. If possible, the "correct" code
according to this new rule should also be demonstrated.
Negative example:
Possible Properties:
Not sure about the properties, what do you think?
The text was updated successfully, but these errors were encountered: