1 23 package org.hammurapi.inspectors.testcases.violations; 24 25 import org.hammurapi.inspectors.testcases.HammurapiTestCasesException; 26 27 32 public class ForIteratorRuleViolationTestCase { 33 34 private static org.apache.log4j.Logger logger = 35 org.apache.log4j.Logger.getRootLogger(); 36 37 38 public void searchObj(final java.util.Iterator iter, final Object anObj) 39 throws HammurapiTestCasesException { 40 if (iter.hasNext()) { 41 42 for (Object obj = iter.next(); iter.hasNext();) { 44 45 if (obj.equals(anObj)) { 46 throw new HammurapiTestCasesException(obj.toString()); 47 } 48 obj = iter.next(); 49 } 50 } 51 } 52 } 53 54 | Popular Tags |