Program: 24961
Project: 24961
Buggy source:
/** 
 * When sdnv is updated, this function is called to cause all of the UI representations of sdnv to be updated as well. 
 * @param updatedFrom	Which UI element triggered the update; prevents loops.
 */
public void update(Type updatedFrom){
  if (updatingFrom != Type.NONE) {
    return;
  }
  boolean mustUpdate=false;
  try {
    if (updatedFrom == Type.INTEGER_DEC) {
      long newValue=Long.parseLong(mIntegerDecText.getText().toString(),10);
      if (newValue != sdnv.getValue()) {
        sdnv.setByValue(newValue);
        mustUpdate=true;
      }
    }
 else     if (updatedFrom == Type.INTEGER_HEX) {
      long newValue=Long.parseLong(mIntegerHexText.getText().toString(),16);
      if (newValue != sdnv.getValue()) {
        sdnv.setByValue(newValue);
        mustUpdate=true;
      }
    }
 else     if (updatedFrom == Type.SDNV_HEX) {
      Sdnv newSdnv=new Sdnv(mSdnvHexText.getText().toString(),16);
      if (newSdnv.equals(sdnv) == false) {
        sdnv=newSdnv;
        mustUpdate=true;
      }
    }
 else     if (updatedFrom == Type.SDNV_DEC) {
      Sdnv newSdnv=new Sdnv(mSdnvDecText.getText().toString(),10);
      if (newSdnv.equals(sdnv) == false) {
        sdnv=newSdnv;
        mustUpdate=true;
      }
    }
 else     if (updatedFrom == Type.DATE) {
      mustUpdate=true;
    }
  }
 catch (  NumberFormatException e) {
  }
  if (mustUpdate == false) {
    return;
  }
  updatingFrom=updatedFrom;
  if (updatingFrom != Type.INTEGER_DEC) {
    mIntegerDecText.setText(Long.toString(sdnv.getValue()));
  }
  if (updatingFrom != Type.INTEGER_HEX) {
    mIntegerHexText.setText(Long.toHexString(sdnv.getValue()));
  }
  if (updatingFrom != Type.SDNV_DEC) {
    mSdnvDecText.setText(sdnv.getBytesAsString());
  }
  if (updatingFrom != Type.SDNV_HEX) {
    mSdnvHexText.setText(sdnv.getBytesAsHexString());
  }
  updateDatesFromNumbers();
  updatingFrom=Type.NONE;
}

Fixed version (ground truth):
/** 
 * When sdnv is updated, this function is called to cause all of the UI representations of sdnv to be updated as well. 
 * @param updatedFrom	Which UI element triggered the update; prevents loops.
 */
public void update(Type updatedFrom){
  if (updatingFrom != Type.NONE) {
    return;
  }
  boolean mustUpdate=false;
  try {
    if (updatedFrom == Type.INTEGER_DEC) {
      long newValue=Long.parseLong(mIntegerDecText.getText().toString(),10);
      if (newValue != sdnv.getValue()) {
        try {
          sdnv.setByValue(newValue);
        }
 catch (        NumberFormatException e) {
          mIntegerDecText.setText(Long.toString(sdnv.getValue()));
        }
        mustUpdate=true;
      }
    }
 else     if (updatedFrom == Type.INTEGER_HEX) {
      long newValue=Long.parseLong(mIntegerHexText.getText().toString(),16);
      if (newValue != sdnv.getValue()) {
        try {
          sdnv.setByValue(newValue);
        }
 catch (        NumberFormatException e) {
          mIntegerHexText.setText(Long.toString(sdnv.getValue(),16));
        }
        mustUpdate=true;
      }
    }
 else     if (updatedFrom == Type.SDNV_HEX) {
      Sdnv newSdnv=new Sdnv(mSdnvHexText.getText().toString(),16);
      if (newSdnv.equals(sdnv) == false) {
        sdnv=newSdnv;
        mustUpdate=true;
      }
    }
 else     if (updatedFrom == Type.SDNV_DEC) {
      Sdnv newSdnv=new Sdnv(mSdnvDecText.getText().toString(),10);
      if (newSdnv.equals(sdnv) == false) {
        sdnv=newSdnv;
        mustUpdate=true;
      }
    }
 else     if (updatedFrom == Type.DATE) {
      mustUpdate=true;
    }
  }
 catch (  NumberFormatException e) {
  }
  if (mustUpdate == false) {
    return;
  }
  updatingFrom=updatedFrom;
  if (updatingFrom != Type.INTEGER_DEC) {
    mIntegerDecText.setText(Long.toString(sdnv.getValue()));
  }
  if (updatingFrom != Type.INTEGER_HEX) {
    mIntegerHexText.setText(Long.toHexString(sdnv.getValue()));
  }
  if (updatingFrom != Type.SDNV_DEC) {
    mSdnvDecText.setText(sdnv.getBytesAsString());
  }
  if (updatingFrom != Type.SDNV_HEX) {
    mSdnvHexText.setText(sdnv.getBytesAsHexString());
  }
  updateDatesFromNumbers();
  updatingFrom=Type.NONE;
}