Program: 30672
Project: 30672
Buggy source:
public IAEStack injectItems(IAEStack input,Actionable type,BaseActionSource src){
  if (input instanceof IAEItemStack && type == Actionable.MODULATE) {
    IAEItemStack what=(IAEItemStack)input;
    IAEItemStack is=waitingFor.findPrecise(what);
    if (is != null && is.getStackSize() > 0) {
      waiting=false;
      postChange((IAEItemStack)input,src);
      if (is.getStackSize() >= input.getStackSize()) {
        is.decStackSize(input.getStackSize());
        markDirty();
        if (finalOutput.equals(input)) {
          finalOutput.decStackSize(input.getStackSize());
          if (finalOutput.getStackSize() <= 0)           completeJob();
          if (myLastLink != null)           return ((CraftingLink)myLastLink).injectItems((IAEItemStack)input);
          return input;
        }
        return inventory.injectItems(what,type,src);
      }
      IAEItemStack insert=what.copy();
      insert.setStackSize(is.getStackSize());
      what.decStackSize(is.getStackSize());
      is.setStackSize(0);
      if (finalOutput.equals(input)) {
        finalOutput.decStackSize(input.getStackSize());
        if (finalOutput.getStackSize() <= 0)         completeJob();
        if (myLastLink != null)         return ((CraftingLink)myLastLink).injectItems((IAEItemStack)input);
        return input;
      }
      inventory.injectItems(insert,type,src);
      markDirty();
      return what;
    }
  }
  return input;
}

Fixed version (ground truth):
public IAEStack injectItems(IAEStack input,Actionable type,BaseActionSource src){
  if (input instanceof IAEItemStack && type == Actionable.SIMULATE && false) {
    IAEItemStack what=(IAEItemStack)input.copy();
    IAEItemStack is=waitingFor.findPrecise(what);
    if (is != null && is.getStackSize() > 0) {
      if (is.getStackSize() >= what.getStackSize()) {
        if (finalOutput.equals(what)) {
          if (myLastLink != null)           return ((CraftingLink)myLastLink).injectItems((IAEItemStack)what,type);
          return what;
        }
        return null;
      }
      if (finalOutput.equals(what)) {
        if (myLastLink != null)         return ((CraftingLink)myLastLink).injectItems((IAEItemStack)what,type);
        return what;
      }
      IAEItemStack leftOver=what.copy();
      leftOver.decStackSize(is.getStackSize());
      return leftOver;
    }
  }
 else   if (input instanceof IAEItemStack && type == Actionable.MODULATE) {
    IAEItemStack what=(IAEItemStack)input;
    IAEItemStack is=waitingFor.findPrecise(what);
    if (is != null && is.getStackSize() > 0) {
      waiting=false;
      postChange((IAEItemStack)input,src);
      if (is.getStackSize() >= input.getStackSize()) {
        is.decStackSize(input.getStackSize());
        markDirty();
        if (finalOutput.equals(input)) {
          finalOutput.decStackSize(input.getStackSize());
          if (finalOutput.getStackSize() <= 0)           completeJob();
          if (myLastLink != null)           return ((CraftingLink)myLastLink).injectItems((IAEItemStack)input,type);
          return input;
        }
        return inventory.injectItems(what,type,src);
      }
      IAEItemStack insert=what.copy();
      insert.setStackSize(is.getStackSize());
      what.decStackSize(is.getStackSize());
      is.setStackSize(0);
      if (finalOutput.equals(input)) {
        finalOutput.decStackSize(input.getStackSize());
        if (finalOutput.getStackSize() <= 0)         completeJob();
        if (myLastLink != null)         return ((CraftingLink)myLastLink).injectItems((IAEItemStack)input,type);
        return input;
      }
      inventory.injectItems(insert,type,src);
      markDirty();
      return what;
    }
  }
  return input;
}