1 package net.sourceforge.pmd.rules.strings; 2 3 import net.sourceforge.pmd.rules.AbstractPoorMethodCall; 4 5 7 public class UseIndexOfChar extends AbstractPoorMethodCall { 8 9 private static final String targetTypeName = "String"; 10 private static final String [] methodNames = new String [] { "indexOf", "lastIndexOf" }; 11 12 public UseIndexOfChar() { 13 super(); 14 } 15 16 20 protected String targetTypename() { 21 return targetTypeName; 22 } 23 24 28 protected String [] methodNames() { 29 return methodNames; 30 } 31 32 38 protected boolean isViolationArgument(int argIndex, String arg) { 39 40 return isSingleCharAsString(arg); 41 } 42 43 } 44 | Popular Tags |