=== on 18 Mar 2016, 10:46:21 Michael Gumowski wrote:
\[~ann.campbell.2] I removed the reference to ``++pmd:SimplifyStartsWith++`` and updated the RSPEC to only target ``++indexOf++``/``++lastIndexOf++``, as replacing ``++str.startWith("c")++`` by ``++!str.isEmpty && str.charAt(0) == 'c'++`` is really controversial (3 operations instead of 1? proof of efficiency should be done). Note that I didn't created a new RSPEC to cover that newly unmapped pmd rule. Similarly, the CodePro mapping is not valid anymore.


The part regarding ``++indexOf++`` is however still pretty valid and should be activated by default.

=== on 6 May 2020, 10:47:50 Johann Beleites wrote:
It seems as though this rule is not relevant (anymore). It is hard to find evidence that supports indexOf(char) being faster than indexOf(String). On the contrary, in current Java versions, you can collect evidence that points to the opposite being true. In either case, performance differences are not huge. In any case, it does not generally seem better to use the char instead of the String version of indexOf. Hence, I have deprecated this rule (see SONARJAVA-3339).

