Program: 11188
Project: 11188
Buggy source:
private void bandCountChanged(){
  GridBagConstraints c;
  Integer[] outsideBackup=readIntegerFields(outsideFields);
  Integer[] minBackup=readIntegerFields(minFields);
  Integer[] maxBackup=readIntegerFields(maxFields);
  Integer[] replaceBackup=readIntegerFields(replaceFields);
  Integer[] otherwiseBackup=readIntegerFields(otherwiseFields);
  FocusListener fl=new FocusAdapter(){
    @Override public void focusLost(    FocusEvent e){
      JIntegerField jif=(JIntegerField)e.getSource();
      if (jif.getValue() == null)       jif.setValue(0);
    }
  }
;
  outsidePanel.removeAll();
  minPanel.removeAll();
  maxPanel.removeAll();
  withPanel.removeAll();
  otherwisePanel.removeAll();
  while (bandCombo.getItemCount() > 0) {
    bandCombo.removeItemAt(0);
  }
  outputBandCount=bandCount <= 0 ? 1 : elevationRadio.isSelected() ? 1 : bandCount == 3 && alphaCheck.isSelected() ? 4 : bandCount;
  outsideFields=new JIntegerField[outputBandCount];
  minFields=new JIntegerField[outputBandCount];
  maxFields=new JIntegerField[outputBandCount];
  replaceFields=new JIntegerField[outputBandCount];
  otherwiseFields=new JIntegerField[outputBandCount];
  for (int i=0; i < outputBandCount; i++) {
    outsideFields[i]=new JIntegerField(0);
    Dimension size=outsideFields[i].getPreferredSize();
    size.width=50;
    outsideFields[i].setMinimumSize(size);
    outsideFields[i].setPreferredSize(size);
    outsideFields[i].addFocusListener(fl);
    c=new GridBagConstraints();
    c.gridx=i;
    outsidePanel.add(outsideFields[i],c);
    minFields[i]=new JIntegerField(0);
    minFields[i].setMinimumSize(size);
    minFields[i].setPreferredSize(size);
    minFields[i].addFocusListener(fl);
    c=new GridBagConstraints();
    c.gridx=i;
    minPanel.add(minFields[i],c);
    maxFields[i]=new JIntegerField(0);
    maxFields[i].setMinimumSize(size);
    maxFields[i].setPreferredSize(size);
    maxFields[i].addFocusListener(fl);
    c=new GridBagConstraints();
    c.gridx=i;
    maxPanel.add(maxFields[i],c);
    replaceFields[i]=new JIntegerField(null);
    replaceFields[i].setMinimumSize(size);
    replaceFields[i].setPreferredSize(size);
    c=new GridBagConstraints();
    c.gridx=i;
    withPanel.add(replaceFields[i],c);
    otherwiseFields[i]=new JIntegerField(null);
    otherwiseFields[i].setMinimumSize(size);
    otherwiseFields[i].setPreferredSize(size);
    c=new GridBagConstraints();
    c.gridx=i;
    otherwisePanel.add(otherwiseFields[i],c);
    bandCombo.addItem(new Integer(i + 1));
  }
  writeIntegerFields(outsideFields,outsideBackup);
  writeIntegerFields(minFields,minBackup);
  writeIntegerFields(maxFields,maxBackup);
  writeIntegerFields(replaceFields,replaceBackup);
  writeIntegerFields(otherwiseFields,otherwiseBackup);
  enableFields();
}

Fixed version (ground truth):
private void bandCountChanged(){
  GridBagConstraints c;
  Object[] outsideBackup=readNumberFields(outsideFields);
  Object[] minBackup=readNumberFields(minFields);
  Object[] maxBackup=readNumberFields(maxFields);
  Object[] replaceBackup=readNumberFields(replaceFields);
  Object[] otherwiseBackup=readNumberFields(otherwiseFields);
  FocusListener fl=new FocusAdapter(){
    @Override public void focusLost(    FocusEvent e){
      if (e.getSource() instanceof JLongField) {
        JLongField jif=(JLongField)e.getSource();
        if (jif.getValue() == null)         jif.setValue(0l);
      }
 else       if (e.getSource() instanceof JDoubleField) {
        JDoubleField jdf=(JDoubleField)e.getSource();
        if (jdf.getValue() == null)         jdf.setValue(0d);
      }
    }
  }
;
  outsidePanel.removeAll();
  minPanel.removeAll();
  maxPanel.removeAll();
  withPanel.removeAll();
  otherwisePanel.removeAll();
  while (bandCombo.getItemCount() > 0) {
    bandCombo.removeItemAt(0);
  }
  outputBandCount=bandCount <= 0 ? 1 : elevationRadio.isSelected() ? 1 : bandCount == 3 && alphaCheck.isSelected() ? 4 : bandCount;
  boolean isFloat=isFloat();
  outsideFields=new JTextField[outputBandCount];
  minFields=new JTextField[outputBandCount];
  maxFields=new JTextField[outputBandCount];
  replaceFields=new JTextField[outputBandCount];
  otherwiseFields=new JTextField[outputBandCount];
  for (int i=0; i < outputBandCount; i++) {
    if (isFloat)     outsideFields[i]=new JDoubleField(0d);
 else     outsideFields[i]=new JLongField(0l);
    Dimension size=outsideFields[i].getPreferredSize();
    size.width=50;
    outsideFields[i].setMinimumSize(size);
    outsideFields[i].setPreferredSize(size);
    outsideFields[i].addFocusListener(fl);
    c=new GridBagConstraints();
    c.gridx=i;
    outsidePanel.add(outsideFields[i],c);
    if (isFloat)     minFields[i]=new JDoubleField(0d);
 else     minFields[i]=new JLongField(0l);
    minFields[i].setMinimumSize(size);
    minFields[i].setPreferredSize(size);
    minFields[i].addFocusListener(fl);
    c=new GridBagConstraints();
    c.gridx=i;
    minPanel.add(minFields[i],c);
    if (isFloat)     maxFields[i]=new JDoubleField(0d);
 else     maxFields[i]=new JLongField(0l);
    maxFields[i].setMinimumSize(size);
    maxFields[i].setPreferredSize(size);
    maxFields[i].addFocusListener(fl);
    c=new GridBagConstraints();
    c.gridx=i;
    maxPanel.add(maxFields[i],c);
    if (isFloat)     replaceFields[i]=new JDoubleField(null);
 else     replaceFields[i]=new JLongField(null);
    replaceFields[i].setMinimumSize(size);
    replaceFields[i].setPreferredSize(size);
    c=new GridBagConstraints();
    c.gridx=i;
    withPanel.add(replaceFields[i],c);
    if (isFloat)     otherwiseFields[i]=new JDoubleField(null);
 else     otherwiseFields[i]=new JLongField(null);
    otherwiseFields[i].setMinimumSize(size);
    otherwiseFields[i].setPreferredSize(size);
    c=new GridBagConstraints();
    c.gridx=i;
    otherwisePanel.add(otherwiseFields[i],c);
    bandCombo.addItem(new Integer(i + 1));
  }
  writeNumberFields(outsideFields,outsideBackup);
  writeNumberFields(minFields,minBackup);
  writeNumberFields(maxFields,maxBackup);
  writeNumberFields(replaceFields,replaceBackup);
  writeNumberFields(otherwiseFields,otherwiseBackup);
  enableFields();
}