rspec/rules/S2119/java/comments-and-links.adoc

29 lines
1.0 KiB
Plaintext
Raw Normal View History

=== On 2014-10-08T18:10:47Z Ann Campbell Wrote:
\[~nicolas.peru] to what degree do we see/pay attention to "run once" annotations during analysis, e.g. @PostConstruct?
=== On 2014-10-22T19:14:36Z Nicolas Peru Wrote:
At the moment : none.
So this rule won't detect that your random object is initialized in an init method.
It might makes more sense to actually detect Random local variables.
=== On 2014-10-22T19:40:32Z Ann Campbell Wrote:
\[~nicolas.peru] you mean local ``++Random++`` variables, right? :-)
(I did actually have to read that twice & note the capital letter to understand your meaning :-) )
I'd say that as written, this rule is about local ``++Random++``s (did you assign it back to me because you don't agree?), but I was hoping to be able to make it smarter. Oh well.
=== On 2018-08-15T18:28:35Z Nicolas Harraudeau Wrote:
This RSPEC is for now limited to detecting local variables of type ``++java.util.Random++``.
It could later cover cases where the Random object is not even assigned:
----
(new Random()).nextInt()
----