Program: 173810
Project: 173810
Buggy source:
/** 
 * @see rails.game.ConfigurableComponentI#configureFromXML(org.w3c.dom.Element)
 */
public void configureFromXML(Tag tag) throws ConfigurationException {
  trainClassName=tag.getAttributeAsString("String_Node_Str",trainClassName);
  try {
    trainClass=Class.forName(trainClassName).asSubclass(Train.class);
  }
 catch (  ClassNotFoundException e) {
    throw new ConfigurationException("String_Node_Str" + trainClassName + "String_Node_Str",e);
  }
  if (real) {
    trains=new ArrayList<TrainI>();
    name=tag.getAttributeAsString("String_Node_Str");
    if (name == null) {
      throw new ConfigurationException(LocalText.getText("String_Node_Str"));
    }
    cost=tag.getAttributeAsInteger("String_Node_Str");
    if (cost == 0) {
      throw new ConfigurationException(LocalText.getText("String_Node_Str"));
    }
    amount=tag.getAttributeAsInteger("String_Node_Str");
    if (amount == -1) {
      infiniteAmount=true;
    }
 else     if (amount <= 0) {
      throw new ConfigurationException(LocalText.getText("String_Node_Str"));
    }
    majorStops=tag.getAttributeAsInteger("String_Node_Str");
    if (majorStops == 0) {
      throw new ConfigurationException(LocalText.getText("String_Node_Str"));
    }
    minorStops=tag.getAttributeAsInteger("String_Node_Str");
    startedPhaseName=tag.getAttributeAsString("String_Node_Str","String_Node_Str");
    rustedTrainTypeName=tag.getAttributeAsString("String_Node_Str");
    releasedTrainTypeName=tag.getAttributeAsString("String_Node_Str");
    obsoleting=tag.getAttributeAsBoolean("String_Node_Str");
    initialPortfolio=tag.getAttributeAsString("String_Node_Str",initialPortfolio);
  }
 else {
    name="String_Node_Str";
    amount=0;
  }
  Tag reachTag=tag.getChild("String_Node_Str");
  if (reachTag != null) {
    reachBasis=reachTag.getAttributeAsString("String_Node_Str",reachBasis);
    countTowns=reachTag.getAttributeAsString("String_Node_Str",countTowns);
  }
  Tag scoreTag=tag.getChild("String_Node_Str");
  if (scoreTag != null) {
    scoreTowns=scoreTag.getAttributeAsString("String_Node_Str",scoreTowns);
    scoreCities=scoreTag.getAttributeAsString("String_Node_Str",scoreCities);
  }
  Tag swapTag=tag.getChild("String_Node_Str");
  if (swapTag != null) {
    firstExchangeCost=swapTag.getAttributeAsInteger("String_Node_Str",0);
    firstCanBeExchanged=(firstExchangeCost > 0);
  }
  if (real) {
    countHexes=reachBasis.equals("String_Node_Str");
    townCountIndicator=countTowns.equals("String_Node_Str") ? NO_TOWN_COUNT : minorStops > 0 ? TOWN_COUNT_MINOR : TOWN_COUNT_MAJOR;
    cityScoreFactor=scoreCities.equals("String_Node_Str") ? 2 : 1;
    townScoreFactor=scoreTowns.equals("String_Node_Str") ? 1 : 0;
    TrainI train;
    if (infiniteAmount) {
      try {
        train=trainClass.newInstance();
      }
 catch (      InstantiationException e) {
        throw new ConfigurationException("String_Node_Str" + trainClassName,e);
      }
catch (      IllegalAccessException e) {
        throw new ConfigurationException("String_Node_Str" + trainClassName + "String_Node_Str",e);
      }
      train.init(this,0);
      trains.add(train);
    }
 else {
      for (int i=0; i < amount; i++) {
        try {
          train=trainClass.newInstance();
        }
 catch (        InstantiationException e) {
          throw new ConfigurationException("String_Node_Str" + trainClassName,e);
        }
catch (        IllegalAccessException e) {
          throw new ConfigurationException("String_Node_Str" + trainClassName + "String_Node_Str",e);
        }
        train.init(this,i);
        trains.add(train);
      }
    }
  }
  numberBoughtFromIPO=new IntegerState(name + "String_Node_Str",0);
  available=new BooleanState(name + "String_Node_Str",false);
  rusted=new BooleanState(name + "String_Node_Str",false);
}

Fixed version (ground truth):
/** 
 * @see rails.game.ConfigurableComponentI#configureFromXML(org.w3c.dom.Element)
 */
public void configureFromXML(Tag tag) throws ConfigurationException {
  trainClassName=tag.getAttributeAsString("String_Node_Str",trainClassName);
  try {
    trainClass=Class.forName(trainClassName).asSubclass(Train.class);
  }
 catch (  ClassNotFoundException e) {
    throw new ConfigurationException("String_Node_Str" + trainClassName + "String_Node_Str",e);
  }
  if (real) {
    trains=new ArrayList<TrainI>();
    name=tag.getAttributeAsString("String_Node_Str");
    if (name == null) {
      throw new ConfigurationException(LocalText.getText("String_Node_Str"));
    }
    cost=tag.getAttributeAsInteger("String_Node_Str");
    if (cost == 0) {
      throw new ConfigurationException(LocalText.getText("String_Node_Str"));
    }
    amount=tag.getAttributeAsInteger("String_Node_Str");
    if (amount == -1) {
      infiniteAmount=true;
    }
 else     if (amount <= 0) {
      throw new ConfigurationException(LocalText.getText("String_Node_Str"));
    }
    majorStops=tag.getAttributeAsInteger("String_Node_Str");
    if (majorStops == 0) {
      throw new ConfigurationException(LocalText.getText("String_Node_Str"));
    }
    minorStops=tag.getAttributeAsInteger("String_Node_Str");
    startedPhaseName=tag.getAttributeAsString("String_Node_Str","String_Node_Str");
    rustedTrainTypeName=tag.getAttributeAsString("String_Node_Str");
    releasedTrainTypeName=tag.getAttributeAsString("String_Node_Str");
    obsoleting=tag.getAttributeAsBoolean("String_Node_Str");
    initialPortfolio=tag.getAttributeAsString("String_Node_Str",initialPortfolio);
  }
 else {
    name="String_Node_Str";
    amount=0;
  }
  Tag reachTag=tag.getChild("String_Node_Str");
  if (reachTag != null) {
    reachBasis=reachTag.getAttributeAsString("String_Node_Str",reachBasis);
    countTowns=reachTag.getAttributeAsString("String_Node_Str",countTowns);
  }
  Tag scoreTag=tag.getChild("String_Node_Str");
  if (scoreTag != null) {
    scoreTowns=scoreTag.getAttributeAsString("String_Node_Str",scoreTowns);
    scoreCities=scoreTag.getAttributeAsString("String_Node_Str",scoreCities);
  }
  Tag swapTag=tag.getChild("String_Node_Str");
  if (swapTag != null) {
    firstExchangeCost=swapTag.getAttributeAsInteger("String_Node_Str",0);
    firstCanBeExchanged=(firstExchangeCost > 0);
  }
  if (real) {
    countHexes=reachBasis.equals("String_Node_Str");
    townCountIndicator=countTowns.equals("String_Node_Str") ? NO_TOWN_COUNT : minorStops > 0 ? TOWN_COUNT_MINOR : TOWN_COUNT_MAJOR;
    cityScoreFactor=scoreCities.equals("String_Node_Str") ? 2 : 1;
    townScoreFactor=scoreTowns.equals("String_Node_Str") ? 1 : 0;
    TrainI train;
    if (infiniteAmount) {
      train=createTrain();
      trains.add(train);
    }
 else {
      for (int i=0; i < amount; i++) {
        train=createTrain();
        trains.add(train);
      }
    }
  }
  numberBoughtFromIPO=new IntegerState(name + "String_Node_Str",0);
  available=new BooleanState(name + "String_Node_Str",false);
  rusted=new BooleanState(name + "String_Node_Str",false);
}