Program: 96568
Project: 96568
Buggy source:
public void processPdu(Request request,MOServer server){
  if (request.getPhase() == Request.PHASE_INIT) {
    request.nextPhase();
  }
  OctetString context=request.getContext();
  SnmpRequest req=(SnmpRequest)request;
  try {
    SubRequestIterator it=(SubRequestIterator)request.iterator();
    while (it.hasNext()) {
      SubRequest sreq=it.nextSubRequest();
      if (!sreq.isComplete()) {
        DefaultMOContextScope scope=(DefaultMOContextScope)sreq.getScope();
        OID lowerBound=(OID)scope.getLowerBound().clone();
        scope.setLowerIncluded(false);
        OID upperBound=lowerBound.nextPeer();
        scope.setUpperBound(upperBound);
        scope.setUpperIncluded(false);
        processNextSubRequest(request,server,context,sreq);
        if (sreq.getStatus().getErrorStatus() == PDU.noError) {
          VariableBinding initialVB=(VariableBinding)sreq.getVariableBinding().clone();
          scope.setLowerIncluded(false);
          boolean first=true;
          while (!sreq.getVariableBinding().getVariable().equals(Null.endOfMibView)) {
            sreq.getStatus().setPhaseComplete(false);
            sreq.getStatus().setProcessed(false);
            sreq.setQuery(null);
            scope.setLowerBound(sreq.getVariableBinding().getOid());
            if (!first) {
              VariableBinding vb=(VariableBinding)sreq.getVariableBinding().clone();
              ((KaazingPDU)req.getResponse()).add(vb);
            }
            first=false;
            processNextSubRequest(request,server,context,sreq);
            if (sreq.getStatus().getErrorStatus() != PDU.noError) {
              break;
            }
          }
          sreq.getVariableBinding().setOid(initialVB.getOid());
          sreq.getVariableBinding().setVariable(initialVB.getVariable());
          sreq.getStatus().setPhaseComplete(true);
          sreq.getStatus().setProcessed(true);
        }
      }
    }
  }
 catch (  NoSuchElementException nsex) {
    if (logger.isDebugEnabled()) {
      logger.debug("String_Node_Str");
    }
  }
}

Fixed version (ground truth):
@Override public void processPdu(Request request,MOServer server){
  if (request.getPhase() == Request.PHASE_INIT) {
    request.nextPhase();
  }
  OctetString context=request.getContext();
  SnmpRequest req=(SnmpRequest)request;
  try {
    SubRequestIterator it=(SubRequestIterator)request.iterator();
    while (it.hasNext()) {
      SubRequest sreq=it.nextSubRequest();
      if (!sreq.isComplete()) {
        DefaultMOContextScope scope=(DefaultMOContextScope)sreq.getScope();
        OID lowerBound=(OID)scope.getLowerBound().clone();
        scope.setLowerIncluded(false);
        OID upperBound=lowerBound.nextPeer();
        scope.setUpperBound(upperBound);
        scope.setUpperIncluded(false);
        processNextSubRequest(request,server,context,sreq);
        if (sreq.getStatus().getErrorStatus() == PDU.noError) {
          VariableBinding initialVB=(VariableBinding)sreq.getVariableBinding().clone();
          scope.setLowerIncluded(false);
          boolean first=true;
          while (!sreq.getVariableBinding().getVariable().equals(Null.endOfMibView)) {
            sreq.getStatus().setPhaseComplete(false);
            sreq.getStatus().setProcessed(false);
            sreq.setQuery(null);
            scope.setLowerBound(sreq.getVariableBinding().getOid());
            if (!first) {
              VariableBinding vb=(VariableBinding)sreq.getVariableBinding().clone();
              ((KaazingPDU)req.getResponse()).add(vb);
            }
            first=false;
            processNextSubRequest(request,server,context,sreq);
            if (sreq.getStatus().getErrorStatus() != PDU.noError) {
              break;
            }
          }
          sreq.getVariableBinding().setOid(initialVB.getOid());
          sreq.getVariableBinding().setVariable(initialVB.getVariable());
          sreq.getStatus().setPhaseComplete(true);
          sreq.getStatus().setProcessed(true);
        }
      }
    }
  }
 catch (  NoSuchElementException nsex) {
    if (logger.isDebugEnabled()) {
      logger.debug("String_Node_Str");
    }
  }
}