Details about the known misuse from the MUBench dataset.
Description:
Iterator.next() is invoked without prior check of hasNext().
Fix Description:
Violation Types:
missing/condition/value_or_state
In File:
org/apache/lucene/util/AttributeSource.java
In Method:
computeCurrentState()
Code with Misuse:
class AttributeSource {
private void computeCurrentState() {
currentState = new State();
State c = currentState;
Iterator it = attributeImpls.values().iterator();
c.attribute = (AttributeImpl) it.next();
while (it.hasNext()) {
c.next = new State();
c = c.next;
c.attribute = (AttributeImpl) it.next();
}
}
}