Source:
<code>public boolean matches(TlvDataObjectContainer tlvContainer) { Iterator<TlvDataObject> tlvIterator; int counter, diffCounter, currentWorkingIndex, highestAlreadyEncounteredIndex;; TlvDataObject tlvDataObject; TlvSpecification currentTlvSpecification; <START> boolean tagMatch; <END> counter = 0; highestAlreadyEncounteredIndex = 0; tlvIterator = tlvContainer.iterator(); while(tlvIterator.hasNext()) { tlvDataObject = tlvIterator.next(); currentWorkingIndex = this.getFirstIndexOfSubTag(tlvDataObject.getTlvTag()); if(currentWorkingIndex < 0) { if(!this.allowUnspecifiedSubTags) { log(ApduSpecification.class, "unexpected tag " + tlvDataObject.getTlvTag()); return false; } } else{ currentTlvSpecification = get(currentWorkingIndex); if(currentTlvSpecification.getRequired() == REQ_MISMATCH) { log(ApduSpecification.class, "tag " + tlvDataObject.getTlvTag() + " not allowed"); return false; } if(currentTlvSpecification.getRequired() == REQ_MATCH) { counter++; } if(isStrictOrder) { if(currentWorkingIndex < highestAlreadyEncounteredIndex) { log(ApduSpecification.class, "tag " + tlvDataObject.getTlvTag() + " is out of order"); return false; } else{ highestAlreadyEncounteredIndex = currentWorkingIndex; } } tagMatch = currentTlvSpecification.matches(tlvDataObject); if(!tagMatch) { log(ApduSpecification.class, "error"); return false; } } } diffCounter = this.getNoOfTagsMatchingRequirement(REQ_MATCH) - counter; if(diffCounter > 0) { if(diffCounter == 1) { log(ApduSpecification.class, "missing " + diffCounter + " more mandatory tag"); return false; } else{ log(ApduSpecification.class, "missing " + diffCounter + " more mandatory tags"); return false; } } return true; }</code><technical_language>this variable is assigned read once, obsolete</technical_language>

Target:
public boolean matches(TlvDataObjectContainer tlvContainer) { Iterator<TlvDataObject> tlvIterator; int counter, diffCounter, currentWorkingIndex, highestAlreadyEncounteredIndex;; TlvDataObject tlvDataObject; TlvSpecification currentTlvSpecification; counter = 0; highestAlreadyEncounteredIndex = 0; tlvIterator = tlvContainer.iterator(); while(tlvIterator.hasNext()) { tlvDataObject = tlvIterator.next(); currentWorkingIndex = this.getFirstIndexOfSubTag(tlvDataObject.getTlvTag()); if(currentWorkingIndex < 0) { if(!this.allowUnspecifiedSubTags) { log(ApduSpecification.class, "unexpected tag " + tlvDataObject.getTlvTag()); return false; } } else{ currentTlvSpecification = get(currentWorkingIndex); if(currentTlvSpecification.getRequired() == REQ_MISMATCH) { log(ApduSpecification.class, "tag " + tlvDataObject.getTlvTag() + " not allowed"); return false; } if(currentTlvSpecification.getRequired() == REQ_MATCH) { counter++; } if(isStrictOrder) { if(currentWorkingIndex < highestAlreadyEncounteredIndex) { log(ApduSpecification.class, "tag " + tlvDataObject.getTlvTag() + " is out of order"); return false; } else{ highestAlreadyEncounteredIndex = currentWorkingIndex; } } if(!currentTlvSpecification.matches(tlvDataObject)) { log(ApduSpecification.class, "error"); return false; } } } diffCounter = this.getNoOfTagsMatchingRequirement(REQ_MATCH) - counter; if(diffCounter > 0) { if(diffCounter == 1) { log(ApduSpecification.class, "missing " + diffCounter + " more mandatory tag"); return false; } else{ log(ApduSpecification.class, "missing " + diffCounter + " more mandatory tags"); return false; } } return true; }