@Test public void deleteAidHashRuleMultipleTest() throws NoSuchFieldException, IllegalAccessException { addItem(AID_BASIC, HASH_BASIC, RULE_BASIC); addItem(AID_BASIC1, HASH_BASIC1, RULE_BASIC1); addItem(AID_BASIC2, HASH_BASIC2, RULE_BASIC2); addItem(AID_BASIC3, HASH_BASIC3, RULE_BASIC3); assertEquals("init length", 4, getLength()); deleteAidHashRule(TestUtils.concatByteArray(AID_BASIC, HASH_BASIC, RULE_BASIC), (short) 0, (byte) AID_BASIC.length, (short) AID_BASIC.length, (byte) HASH_BASIC.length, (short) (AID_BASIC.length + HASH_BASIC.length), (byte) RULE_BASIC.length); deleteAidHashRule(TestUtils.concatByteArray(AID_BASIC1, HASH_BASIC1, RULE_BASIC1), (short) 0, (byte) AID_BASIC1.length, (short) AID_BASIC1.length, (byte) HASH_BASIC1.length, (short) (AID_BASIC1.length + HASH_BASIC1.length), (byte) RULE_BASIC1.length); deleteAidHashRule(TestUtils.concatByteArray(AID_BASIC2, HASH_BASIC2, RULE_BASIC2), (short) 0, (byte) AID_BASIC2.length, (short) AID_BASIC2.length, (byte) HASH_BASIC2.length, (short) (AID_BASIC2.length + HASH_BASIC2.length), (byte) RULE_BASIC2.length); deleteAidHashRule(TestUtils.concatByteArray(AID_BASIC3, HASH_BASIC3, RULE_BASIC3), (short) 0, (byte) AID_BASIC3.length, (short) AID_BASIC3.length, (byte) HASH_BASIC3.length, (short) (AID_BASIC3.length + HASH_BASIC3.length), (byte) RULE_BASIC3.length); assertEquals("length after deletion", 0, getLength()); }
static void deleteAidHashRule(byte[] buf, short aidOfs, byte aidLen, short hashOfs, byte hashLen, short ruleOfs, byte ruleLen) { RuleEntry re = searchAidHashRule(buf, aidOfs, aidLen, hashOfs, hashLen, ruleOfs, ruleLen); while (re != null) { JCSystem.beginTransaction(); re.remove(); re.recycle(); JCSystem.commitTransaction(); re = searchAidHashRule(buf, aidOfs, aidLen, hashOfs, hashLen, ruleOfs, ruleLen); } }
RuleEntry { static void deleteAidHashRule(byte[] buf, short aidOfs, byte aidLen, short hashOfs, byte hashLen, short ruleOfs, byte ruleLen) { RuleEntry re = searchAidHashRule(buf, aidOfs, aidLen, hashOfs, hashLen, ruleOfs, ruleLen); while (re != null) { JCSystem.beginTransaction(); re.remove(); re.recycle(); JCSystem.commitTransaction(); re = searchAidHashRule(buf, aidOfs, aidLen, hashOfs, hashLen, ruleOfs, ruleLen); } } }
RuleEntry { static void deleteAidHashRule(byte[] buf, short aidOfs, byte aidLen, short hashOfs, byte hashLen, short ruleOfs, byte ruleLen) { RuleEntry re = searchAidHashRule(buf, aidOfs, aidLen, hashOfs, hashLen, ruleOfs, ruleLen); while (re != null) { JCSystem.beginTransaction(); re.remove(); re.recycle(); JCSystem.commitTransaction(); re = searchAidHashRule(buf, aidOfs, aidLen, hashOfs, hashLen, ruleOfs, ruleLen); } } private  RuleEntry(); }
RuleEntry { static void deleteAidHashRule(byte[] buf, short aidOfs, byte aidLen, short hashOfs, byte hashLen, short ruleOfs, byte ruleLen) { RuleEntry re = searchAidHashRule(buf, aidOfs, aidLen, hashOfs, hashLen, ruleOfs, ruleLen); while (re != null) { JCSystem.beginTransaction(); re.remove(); re.recycle(); JCSystem.commitTransaction(); re = searchAidHashRule(buf, aidOfs, aidLen, hashOfs, hashLen, ruleOfs, ruleLen); } } private  RuleEntry(); static RuleEntry getFirst(); byte getAidLength(); byte getHashLength(); byte getRuleLength(); RuleEntry getNext(); void setAid(byte[] buf, short ofs, byte len); void setHash(byte[] buf, short ofs, byte len); void setRule(byte[] buf, short ofs, byte len); }
RuleEntry { static void deleteAidHashRule(byte[] buf, short aidOfs, byte aidLen, short hashOfs, byte hashLen, short ruleOfs, byte ruleLen) { RuleEntry re = searchAidHashRule(buf, aidOfs, aidLen, hashOfs, hashLen, ruleOfs, ruleLen); while (re != null) { JCSystem.beginTransaction(); re.remove(); re.recycle(); JCSystem.commitTransaction(); re = searchAidHashRule(buf, aidOfs, aidLen, hashOfs, hashLen, ruleOfs, ruleLen); } } private  RuleEntry(); static RuleEntry getFirst(); byte getAidLength(); byte getHashLength(); byte getRuleLength(); RuleEntry getNext(); void setAid(byte[] buf, short ofs, byte len); void setHash(byte[] buf, short ofs, byte len); void setRule(byte[] buf, short ofs, byte len);  }