Program: 133489
Project: 133489
Buggy source:
/** 
 * This operation handles a re-draw of EntryComposites that have been recently changed. This method attempts to avoid a complete redraw of all EntryComposites and only re-draws those that have been recently changed.
 */
public void refresh(){
  List<Entry> entries=dataComp.retrieveAllEntries();
  if (!entries.isEmpty() && emptyLabel != null) {
    emptyLabel.dispose();
    emptyLabel=null;
  }
  for (int i=0; i < entries.size(); i++) {
    Entry entry=dataComp.retrieveAllEntries().get(i);
    EntryComposite entryComp=entryMap.get(i);
    if (entryComp != null && !entry.getValue().equals(entryComp.entry.getValue())) {
      entry.setValue(entryComp.entry.getValue());
    }
  }
  int maxIterations=entries.size() > entryMap.size() ? entries.size() : entryMap.size();
  for (int i=0; i < maxIterations; i++) {
    Entry entry=(i < entries.size() ? entries.get(i) : null);
    EntryComposite entryComp=(i < entryMap.size() ? entryMap.get(i) : null);
    String value=(entryComp != null ? entryComp.entry.getValue() : (entry != null ? entry.getValue() : "String_Node_Str"));
    if (entry == null || !entry.isReady()) {
      disposeEntry(i);
      continue;
    }
 else     if (entryComp == null && entry.isReady()) {
      renderEntry(entry,i);
      entryComp=entryMap.get(i);
      entryComp.setEntryValue(value);
      entryComp.refresh();
    }
 else {
      for (int j=0; j < entry.getAllowedValues().size(); j++) {
        String allowedValue=entry.getAllowedValues().get(j);
        if (!entryComp.entry.getAllowedValues().contains(allowedValue)) {
          disposeEntry(i);
          renderEntry(entry,i);
          entryComp=entryMap.get(i);
          entryComp.setEntryValue(value);
          entryComp.refresh();
        }
      }
    }
  }
  layout();
  return;
}

Fixed version (ground truth):
/** 
 * This operation handles a re-draw of EntryComposites that have been recently changed. This method attempts to avoid a complete redraw of all EntryComposites and only re-draws those that have been recently changed.
 */
public void refresh(){
  List<Entry> entries=dataComp.retrieveAllEntries();
  if (!entries.isEmpty() && emptyLabel != null) {
    emptyLabel.dispose();
    emptyLabel=null;
  }
  for (int i=0; i < entries.size(); i++) {
    Entry entry=dataComp.retrieveAllEntries().get(i);
    EntryComposite entryComp=entryMap.get(i);
    if (entryComp != null && !entry.getValue().equals(entryComp.entry.getValue())) {
      entryComp.entry.setValue(entry.getValue());
    }
  }
  int maxIterations=entries.size() > entryMap.size() ? entries.size() : entryMap.size();
  for (int i=0; i < maxIterations; i++) {
    Entry entry=(i < entries.size() ? entries.get(i) : null);
    EntryComposite entryComp=(i < entryMap.size() ? entryMap.get(i) : null);
    String value=(entryComp != null ? entryComp.entry.getValue() : (entry != null ? entry.getValue() : "String_Node_Str"));
    if (entry == null || !entry.isReady()) {
      disposeEntry(i);
      continue;
    }
 else     if (entryComp == null && entry.isReady()) {
      renderEntry(entry,i);
      entryComp=entryMap.get(i);
      entryComp.setEntryValue(value);
      entryComp.refresh();
    }
 else {
      for (int j=0; j < entry.getAllowedValues().size(); j++) {
        String allowedValue=entry.getAllowedValues().get(j);
        if (!entryComp.entry.getAllowedValues().contains(allowedValue)) {
          disposeEntry(i);
          renderEntry(entry,i);
          entryComp=entryMap.get(i);
          entryComp.setEntryValue(value);
          entryComp.refresh();
        }
      }
    }
  }
  layout();
  return;
}