1 23 package org.hammurapi.inspectors.testcases.fixes; 24 25 30 public class BraceRuleFixTestCase { 31 private static org.apache.log4j.Logger logger = 32 org.apache.log4j.Logger.getRootLogger(); 33 34 private static final int LOOP_CONST = 10; 35 private static final char CHAR_A = 'A'; 36 37 private Integer intVal; 38 39 40 public void procString(final String strToProc) { 41 if (strToProc == null) { 42 int c = 0; 43 44 for (int i = 0; i < LOOP_CONST; i++) { 46 c += i; 47 } 48 50 intVal = new Integer (c); 51 } 52 53 else if (strToProc.length() == 0) { 55 intVal = new Integer (0); 56 } 57 59 else { 60 int a = 0; 61 int c = 0; 62 63 while (a < strToProc.length()) { 65 if (strToProc.charAt(a)==CHAR_A) { 66 c++; 67 } 68 a++; 69 } 70 72 intVal = new Integer (c); 73 } 74 } 75 } 76 77 | Popular Tags |