Program: 19978
Project: 19978
Buggy source:
/** 
 * Tallentaa pelaajan highscoret.
 * @param _score Pelaajan pisteet
 * @param scoreList 
 * @return 
 */
public final int[] saveHighScores(int _score,int[] _scoreList){
  FileOutputStream fos=null;
  int[] scores=new int[5];
  boolean checked=false;
  int index=0;
  int temp=0;
  while (checked != true) {
    if (_score > _scoreList[index]) {
      temp=_scoreList[index];
      _scoreList[index]=_score;
      _score=temp;
    }
 else     if (index >= 4) {
      checked=true;
    }
    index++;
  }
  scores=_scoreList;
  File xmlHighScores=new File(Environment.getExternalStorageDirectory() + "String_Node_Str");
  try {
    xmlHighScores.createNewFile();
  }
 catch (  Exception e) {
    e.printStackTrace();
    Log.e("String_Node_Str","String_Node_Str" + e.getMessage());
  }
  try {
    fos=new FileOutputStream(xmlHighScores);
  }
 catch (  Exception e) {
    e.printStackTrace();
    Log.e("String_Node_Str","String_Node_Str" + e.getMessage());
  }
  XmlSerializer serializer=Xml.newSerializer();
  try {
    serializer.setOutput(fos,"String_Node_Str");
    serializer.startDocument(null,Boolean.valueOf(false));
    serializer.setFeature("String_Node_Str",true);
    serializer.startTag(null,"String_Node_Str");
    for (int i=0; i < scores.length; ++i) {
      serializer.startTag(null,"String_Node_Str");
      serializer.attribute(null,"String_Node_Str",String.valueOf(i));
      serializer.attribute(null,"String_Node_Str",String.valueOf(_scoreList[i]));
      serializer.endTag(null,"String_Node_Str");
    }
    serializer.endTag(null,"String_Node_Str");
    serializer.endDocument();
    serializer.flush();
    fos.close();
  }
 catch (  Exception e) {
    e.printStackTrace();
    Log.e("String_Node_Str","String_Node_Str" + e.getMessage());
  }
  return scores;
}

Fixed version (ground truth):
/** 
 * Tallentaa pelaajan highscoret.
 * @param _score Pelaajan pisteet
 * @param scoreList 
 * @return 
 */
public final int[] saveHighScores(int _score,int[] _scoreList){
  FileOutputStream fos=null;
  int[] scores=new int[5];
  boolean checked=false;
  int index=0;
  int temp=0;
  while (checked != true) {
    if (index <= 4) {
      if (_score > _scoreList[index]) {
        temp=_scoreList[index];
        _scoreList[index]=_score;
        _score=temp;
      }
    }
 else {
      checked=true;
    }
    index++;
  }
  scores=_scoreList;
  File xmlHighScores=new File(Environment.getExternalStorageDirectory() + "String_Node_Str");
  try {
    xmlHighScores.createNewFile();
  }
 catch (  Exception e) {
    e.printStackTrace();
    Log.e("String_Node_Str","String_Node_Str" + e.getMessage());
  }
  try {
    fos=new FileOutputStream(xmlHighScores);
  }
 catch (  Exception e) {
    e.printStackTrace();
    Log.e("String_Node_Str","String_Node_Str" + e.getMessage());
  }
  XmlSerializer serializer=Xml.newSerializer();
  try {
    serializer.setOutput(fos,"String_Node_Str");
    serializer.startDocument(null,Boolean.valueOf(false));
    serializer.setFeature("String_Node_Str",true);
    serializer.startTag(null,"String_Node_Str");
    for (int i=0; i < scores.length; ++i) {
      serializer.startTag(null,"String_Node_Str");
      serializer.attribute(null,"String_Node_Str",String.valueOf(i));
      serializer.attribute(null,"String_Node_Str",String.valueOf(_scoreList[i]));
      serializer.endTag(null,"String_Node_Str");
    }
    serializer.endTag(null,"String_Node_Str");
    serializer.endDocument();
    serializer.flush();
    fos.close();
  }
 catch (  Exception e) {
    e.printStackTrace();
    Log.e("String_Node_Str","String_Node_Str" + e.getMessage());
  }
  return scores;
}