Program: 30537
Project: 30537
Buggy source:
public TickRateModulation onTick(){
  boolean changed=false;
  LinkedList<IAEItemStack> changes=new LinkedList<IAEItemStack>();
  int high=0;
  list.resetStatus();
  for (  ItemSlot is : adaptor) {
    CachedItemStack old=memory.get(is.slot);
    high=Math.max(high,is.slot);
    ItemStack newIS=is == null || is.isExtractable == false && mode == StorageFilter.EXTACTABLE_ONLY ? null : is.getItemStack();
    ItemStack oldIS=old == null ? null : old.itemStack;
    if (isDiffrent(newIS,oldIS)) {
      CachedItemStack cis=new CachedItemStack(is.getItemStack());
      memory.put(is.slot,cis);
      if (old != null && old.aeStack != null) {
        old.aeStack.setStackSize(-old.aeStack.getStackSize());
        changes.add(old.aeStack);
      }
      if (cis != null && cis.aeStack != null) {
        changes.add(cis.aeStack);
        list.add(cis.aeStack);
      }
      changed=true;
    }
 else     if (is != null) {
      int newSize=(newIS == null ? 0 : newIS.stackSize);
      int diff=newSize - (oldIS == null ? 0 : oldIS.stackSize);
      IAEItemStack stack=(old == null || old.aeStack == null ? AEApi.instance().storage().createItemStack(newIS) : old.aeStack.copy());
      if (stack != null) {
        stack.setStackSize(newSize);
        list.add(stack);
      }
      if (diff != 0 && stack != null) {
        CachedItemStack cis=new CachedItemStack(is.getItemStack());
        memory.put(is.slot,cis);
        IAEItemStack a=stack.copy();
        a.setStackSize(diff);
        changes.add(a);
        changed=true;
      }
    }
  }
  NavigableMap<Integer,CachedItemStack> end=memory.tailMap(high,false);
  if (!end.isEmpty()) {
    for (    CachedItemStack cis : end.values()) {
      IAEItemStack a=cis.aeStack.copy();
      a.setStackSize(-a.getStackSize());
      changes.add(a);
      changed=true;
    }
    end.clear();
  }
  if (!changes.isEmpty())   postDiffrence(changes);
  return changed ? TickRateModulation.URGENT : TickRateModulation.SLOWER;
}

Fixed version (ground truth):
public TickRateModulation onTick(){
  boolean changed=false;
  LinkedList<IAEItemStack> changes=new LinkedList<IAEItemStack>();
  int high=0;
  list.resetStatus();
  for (  ItemSlot is : adaptor) {
    CachedItemStack old=memory.get(is.slot);
    high=Math.max(high,is.slot);
    ItemStack newIS=is == null || is.isExtractable == false && mode == StorageFilter.EXTACTABLE_ONLY ? null : is.getItemStack();
    ItemStack oldIS=old == null ? null : old.itemStack;
    if (isDiffrent(newIS,oldIS)) {
      CachedItemStack cis=new CachedItemStack(is.getItemStack());
      memory.put(is.slot,cis);
      if (old != null && old.aeStack != null) {
        old.aeStack.setStackSize(-old.aeStack.getStackSize());
        changes.add(old.aeStack);
      }
      if (cis != null && cis.aeStack != null) {
        changes.add(cis.aeStack);
        list.add(cis.aeStack);
      }
      changed=true;
    }
 else     if (is != null) {
      int newSize=(newIS == null ? 0 : newIS.stackSize);
      int diff=newSize - (oldIS == null ? 0 : oldIS.stackSize);
      IAEItemStack stack=(old == null || old.aeStack == null ? AEApi.instance().storage().createItemStack(newIS) : old.aeStack.copy());
      if (stack != null) {
        stack.setStackSize(newSize);
        list.add(stack);
      }
      if (diff != 0 && stack != null) {
        CachedItemStack cis=new CachedItemStack(is.getItemStack());
        memory.put(is.slot,cis);
        IAEItemStack a=stack.copy();
        a.setStackSize(diff);
        changes.add(a);
        changed=true;
      }
    }
  }
  NavigableMap<Integer,CachedItemStack> end=memory.tailMap(high,false);
  if (!end.isEmpty()) {
    for (    CachedItemStack cis : end.values()) {
      if (cis != null) {
        IAEItemStack a=cis.aeStack.copy();
        a.setStackSize(-a.getStackSize());
        changes.add(a);
        changed=true;
      }
    }
    end.clear();
  }
  if (!changes.isEmpty())   postDiffrence(changes);
  return changed ? TickRateModulation.URGENT : TickRateModulation.SLOWER;
}