View by Classes

Findings - Overview

info UseIndexOfChar (PMD)

String.indexOf(char) is faster than String.indexOf(String). (test code)

Further info on the wiki.
Use String.indexOf(char) when checking for the index of a single character; it executes faster.

public class Foo {
 void bar() {
  String s = "hello world";
  // avoid this
  if (s.indexOf("d") {}
  // instead do this
  if (s.indexOf('d') {}
 }
}

    

Additional info can be found at this http://pmd.sourceforge.net/rules/strings.html#UseIndexOfChar site.

3org.jcoderz.commons.connector.http.transport.ClientHandler
 [284:29],  [288:27],  [429:25]