1 23 package org.hammurapi.inspectors.testcases.violations; 24 25 30 public class BraceRuleViolationTestCase { 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 49 intVal = new Integer (c); 50 } 51 52 else if (strToProc.length() == 0) 54 intVal = new Integer (0); 55 57 else { 58 int a = 0; 59 int c = 0; 60 61 while (a < strToProc.length()) 63 if (strToProc.charAt(a)==CHAR_A) { 64 c++; 65 } 66 a++; 67 69 intVal = new Integer (c); 70 } 71 } 72 } 73 74 | Popular Tags |