Program: 173498
Project: 173498
Buggy source:
/** 
 * To configure all public companies from the &lt;PublicCompany&gt; XML element
 */
public void configureFromXML(Tag tag) throws ConfigurationException {
  longName=tag.getAttributeAsString("String_Node_Str",getId());
  infoText="String_Node_Str" + longName;
  alias=tag.getAttributeAsString("String_Node_Str",alias);
  fgHexColour=tag.getAttributeAsString("String_Node_Str",fgHexColour);
  fgColour=Util.parseColour(fgHexColour);
  bgHexColour=tag.getAttributeAsString("String_Node_Str",bgHexColour);
  bgColour=Util.parseColour(bgHexColour);
  floatPerc=tag.getAttributeAsInteger("String_Node_Str",floatPerc);
  startSpace=tag.getAttributeAsString("String_Node_Str");
  fixedPrice=tag.getAttributeAsInteger("String_Node_Str",0);
  numberOfBaseTokens=tag.getAttributeAsInteger("String_Node_Str",1);
  certsAreInitiallyAvailable=tag.getAttributeAsBoolean("String_Node_Str",certsAreInitiallyAvailable);
  canBeRestarted=tag.getAttributeAsBoolean("String_Node_Str",canBeRestarted);
  Tag shareUnitTag=tag.getChild("String_Node_Str");
  if (shareUnitTag != null) {
    shareUnit=IntegerState.create(this,"String_Node_Str",shareUnitTag.getAttributeAsInteger("String_Node_Str",DEFAULT_SHARE_UNIT));
    shareUnitsForSharePrice=shareUnitTag.getAttributeAsInteger("String_Node_Str",shareUnitsForSharePrice);
  }
  Tag homeBaseTag=tag.getChild("String_Node_Str");
  if (homeBaseTag != null) {
    homeHexNames=homeBaseTag.getAttributeAsString("String_Node_Str");
    homeCityNumber=homeBaseTag.getAttributeAsInteger("String_Node_Str",1);
    homeAllCitiesBlocked=homeBaseTag.getAttributeAsBoolean("String_Node_Str",false);
  }
  Tag destinationTag=tag.getChild("String_Node_Str");
  if (destinationTag != null) {
    destinationHexName=destinationTag.getAttributeAsString("String_Node_Str");
  }
  Tag privateBuyTag=tag.getChild("String_Node_Str");
  if (privateBuyTag != null) {
    canBuyPrivates=true;
  }
  Tag canUseSpecTag=tag.getChild("String_Node_Str");
  if (canUseSpecTag != null)   canUseSpecialProperties=true;
  Tag infoTag=tag.getChild("String_Node_Str");
  if (infoTag != null) {
    String infoKey=infoTag.getAttributeAsString("String_Node_Str");
    String[] infoParms=infoTag.getAttributeAsString("String_Node_Str","String_Node_Str").split("String_Node_Str");
    infoText+="String_Node_Str" + LocalText.getText(infoKey,(Object[])infoParms);
  }
  parentInfoText+=SpecialProperty.configure(this,tag);
  poolPaysOut=poolPaysOut || tag.getChild("String_Node_Str") != null;
  ipoPaysOut=ipoPaysOut || tag.getChild("String_Node_Str") != null;
  Tag floatTag=tag.getChild("String_Node_Str");
  if (floatTag != null) {
    floatPerc=floatTag.getAttributeAsInteger("String_Node_Str",floatPerc);
    String sharePriceAttr=floatTag.getAttributeAsString("String_Node_Str");
    if (Util.hasValue(sharePriceAttr)) {
      sharePriceUpOnFloating=sharePriceAttr.equalsIgnoreCase("String_Node_Str");
    }
  }
  Tag priceTag=tag.getChild("String_Node_Str");
  if (priceTag != null) {
    hasStockPrice=priceTag.getAttributeAsBoolean("String_Node_Str",true);
    hasParPrice=priceTag.getAttributeAsBoolean("String_Node_Str",hasStockPrice);
  }
  Tag payoutTag=tag.getChild("String_Node_Str");
  if (payoutTag != null) {
    String split=payoutTag.getAttributeAsString("String_Node_Str","String_Node_Str");
    splitAlways=split.equalsIgnoreCase("String_Node_Str");
    splitAllowed=split.equalsIgnoreCase("String_Node_Str");
    payoutMustExceedPriceToMove=payoutTag.getAttributeAsBoolean("String_Node_Str",false);
  }
  Tag ownSharesTag=tag.getChild("String_Node_Str");
  if (ownSharesTag != null) {
    canHoldOwnShares=true;
    treasuryPaysOut=true;
    maxPercOfOwnShares=ownSharesTag.getAttributeAsInteger("String_Node_Str",maxPercOfOwnShares);
  }
  Tag trainsTag=tag.getChild("String_Node_Str");
  if (trainsTag != null) {
    trainLimit=trainsTag.getAttributeAsIntegerArray("String_Node_Str",trainLimit);
    mustOwnATrain=trainsTag.getAttributeAsBoolean("String_Node_Str",mustOwnATrain);
  }
  Tag initialTrainTag=tag.getChild("String_Node_Str");
  if (initialTrainTag != null) {
    initialTrainType=initialTrainTag.getAttributeAsString("String_Node_Str");
    initialTrainCost=initialTrainTag.getAttributeAsInteger("String_Node_Str",initialTrainCost);
    initialTrainTradeable=initialTrainTag.getAttributeAsBoolean("String_Node_Str",initialTrainTradeable);
  }
  Tag firstTrainTag=tag.getChild("String_Node_Str");
  if (firstTrainTag != null) {
    String typeName=firstTrainTag.getAttributeAsString("String_Node_Str","String_Node_Str");
    if (typeName.equalsIgnoreCase("String_Node_Str")) {
      privateToCloseOnFirstTrainName=firstTrainTag.getAttributeAsString("String_Node_Str");
    }
 else {
      throw new ConfigurationException("String_Node_Str");
    }
  }
  Tag capitalisationTag=tag.getChild("String_Node_Str");
  if (capitalisationTag != null) {
    String capType=capitalisationTag.getAttributeAsString("String_Node_Str","String_Node_Str");
    if (capType.equalsIgnoreCase("String_Node_Str")) {
      setCapitalisation(CAPITALISE_FULL);
    }
 else     if (capType.equalsIgnoreCase("String_Node_Str")) {
      setCapitalisation(CAPITALISE_INCREMENTAL);
    }
 else     if (capType.equalsIgnoreCase("String_Node_Str")) {
      setCapitalisation(CAPITALISE_WHEN_BOUGHT);
    }
 else {
      throw new ConfigurationException("String_Node_Str" + capType);
    }
  }
  Tag tileLaysTag=tag.getChild("String_Node_Str");
  if (tileLaysTag != null) {
    for (    Tag numberTag : tileLaysTag.getChildren("String_Node_Str")) {
      String colourString=numberTag.getAttributeAsString("String_Node_Str");
      if (colourString == null)       throw new ConfigurationException("String_Node_Str");
      String phaseString=numberTag.getAttributeAsString("String_Node_Str");
      if (phaseString == null)       throw new ConfigurationException("String_Node_Str");
      int number=numberTag.getAttributeAsInteger("String_Node_Str");
      Integer lays=new Integer(number);
      int validForTurns=numberTag.getAttributeAsInteger("String_Node_Str",0);
      String[] colours=colourString.split("String_Node_Str");
      HashMap<String,Integer> phaseMap;
      String[] phases=phaseString.split("String_Node_Str");
      for (int i=0; i < colours.length; i++) {
        if (extraTileLays == null)         extraTileLays=new HashMap<String,HashMap<String,Integer>>();
        extraTileLays.put(colours[i],(phaseMap=new HashMap<String,Integer>()));
        for (int k=0; k < phases.length; k++) {
          phaseMap.put(phases[k],lays);
        }
        if (validForTurns > 0) {
          if (turnsWithExtraTileLaysInit == null) {
            turnsWithExtraTileLaysInit=new HashMap<String,Integer>();
          }
          turnsWithExtraTileLaysInit.put(colours[i],validForTurns);
        }
      }
    }
  }
  List<Tag> certTags=tag.getChildren("String_Node_Str");
  if (certTags != null)   certificateTags=certTags;
  Tag baseTokenTag=tag.getChild("String_Node_Str");
  if (baseTokenTag != null) {
    Tag layCostTag=baseTokenTag.getChild("String_Node_Str");
    if (layCostTag != null) {
      baseTokenLayCostMethod=layCostTag.getAttributeAsString("String_Node_Str",baseTokenLayCostMethod);
      if (baseTokenLayCostMethod.equalsIgnoreCase(BASE_COST_SEQUENCE)) {
        baseTokenLayCostMethod=BASE_COST_SEQUENCE;
      }
 else       if (baseTokenLayCostMethod.equalsIgnoreCase(BASE_COST_DISTANCE)) {
        baseTokenLayCostMethod=BASE_COST_DISTANCE;
      }
 else {
        throw new ConfigurationException("String_Node_Str" + baseTokenLayCostMethod);
      }
      baseTokenLayCost=layCostTag.getAttributeAsIntegerArray("String_Node_Str");
    }
    Tag buyCostTag=baseTokenTag.getChild("String_Node_Str");
    if (buyCostTag != null) {
      baseTokensBuyCost=buyCostTag.getAttributeAsInteger("String_Node_Str",0);
    }
    Tag tokenLayTimeTag=baseTokenTag.getChild("String_Node_Str");
    if (tokenLayTimeTag != null) {
      String layTimeString=tokenLayTimeTag.getAttributeAsString("String_Node_Str");
      if (Util.hasValue(layTimeString)) {
        for (int i=0; i < tokenLayTimeNames.length; i++) {
          if (tokenLayTimeNames[i].equalsIgnoreCase(layTimeString)) {
            homeBaseTokensLayTime=i;
            break;
          }
        }
      }
    }
  }
  Tag sellSharesTag=tag.getChild("String_Node_Str");
  if (sellSharesTag != null) {
    mayTradeShares=true;
    mustHaveOperatedToTradeShares=sellSharesTag.getAttributeAsBoolean("String_Node_Str",mustHaveOperatedToTradeShares);
  }
  Tag loansTag=tag.getChild("String_Node_Str");
  if (loansTag != null) {
    maxNumberOfLoans=loansTag.getAttributeAsInteger("String_Node_Str",-1);
    valuePerLoan=loansTag.getAttributeAsInteger("String_Node_Str",0);
    loanInterestPct=loansTag.getAttributeAsInteger("String_Node_Str",0);
    maxLoansPerRound=loansTag.getAttributeAsInteger("String_Node_Str",-1);
  }
  Tag optionsTag=tag.getChild("String_Node_Str");
  if (optionsTag != null) {
    mustTradeTrainsAtFixedPrice=optionsTag.getAttributeAsBoolean("String_Node_Str",mustTradeTrainsAtFixedPrice);
    canClose=optionsTag.getAttributeAsBoolean("String_Node_Str",canClose);
  }
}

Fixed version (ground truth):
/** 
 * To configure all public companies from the &lt;PublicCompany&gt; XML element
 */
public void configureFromXML(Tag tag) throws ConfigurationException {
  longName=tag.getAttributeAsString("String_Node_Str",getId());
  infoText="String_Node_Str" + longName;
  alias=tag.getAttributeAsString("String_Node_Str",alias);
  fgHexColour=tag.getAttributeAsString("String_Node_Str",fgHexColour);
  fgColour=Util.parseColour(fgHexColour);
  bgHexColour=tag.getAttributeAsString("String_Node_Str",bgHexColour);
  bgColour=Util.parseColour(bgHexColour);
  floatPerc=tag.getAttributeAsInteger("String_Node_Str",floatPerc);
  startSpace=tag.getAttributeAsString("String_Node_Str");
  fixedPrice=tag.getAttributeAsInteger("String_Node_Str",0);
  numberOfBaseTokens=tag.getAttributeAsInteger("String_Node_Str",1);
  certsAreInitiallyAvailable=tag.getAttributeAsBoolean("String_Node_Str",certsAreInitiallyAvailable);
  canBeRestarted=tag.getAttributeAsBoolean("String_Node_Str",canBeRestarted);
  Tag shareUnitTag=tag.getChild("String_Node_Str");
  if (shareUnitTag != null) {
    shareUnit.set(shareUnitTag.getAttributeAsInteger("String_Node_Str",DEFAULT_SHARE_UNIT));
    shareUnitsForSharePrice=shareUnitTag.getAttributeAsInteger("String_Node_Str",shareUnitsForSharePrice);
  }
  Tag homeBaseTag=tag.getChild("String_Node_Str");
  if (homeBaseTag != null) {
    homeHexNames=homeBaseTag.getAttributeAsString("String_Node_Str");
    homeCityNumber=homeBaseTag.getAttributeAsInteger("String_Node_Str",1);
    homeAllCitiesBlocked=homeBaseTag.getAttributeAsBoolean("String_Node_Str",false);
  }
  Tag destinationTag=tag.getChild("String_Node_Str");
  if (destinationTag != null) {
    destinationHexName=destinationTag.getAttributeAsString("String_Node_Str");
  }
  Tag privateBuyTag=tag.getChild("String_Node_Str");
  if (privateBuyTag != null) {
    canBuyPrivates=true;
  }
  Tag canUseSpecTag=tag.getChild("String_Node_Str");
  if (canUseSpecTag != null)   canUseSpecialProperties=true;
  Tag infoTag=tag.getChild("String_Node_Str");
  if (infoTag != null) {
    String infoKey=infoTag.getAttributeAsString("String_Node_Str");
    String[] infoParms=infoTag.getAttributeAsString("String_Node_Str","String_Node_Str").split("String_Node_Str");
    infoText+="String_Node_Str" + LocalText.getText(infoKey,(Object[])infoParms);
  }
  parentInfoText+=SpecialProperty.configure(this,tag);
  poolPaysOut=poolPaysOut || tag.getChild("String_Node_Str") != null;
  ipoPaysOut=ipoPaysOut || tag.getChild("String_Node_Str") != null;
  Tag floatTag=tag.getChild("String_Node_Str");
  if (floatTag != null) {
    floatPerc=floatTag.getAttributeAsInteger("String_Node_Str",floatPerc);
    String sharePriceAttr=floatTag.getAttributeAsString("String_Node_Str");
    if (Util.hasValue(sharePriceAttr)) {
      sharePriceUpOnFloating=sharePriceAttr.equalsIgnoreCase("String_Node_Str");
    }
  }
  Tag priceTag=tag.getChild("String_Node_Str");
  if (priceTag != null) {
    hasStockPrice=priceTag.getAttributeAsBoolean("String_Node_Str",true);
    hasParPrice=priceTag.getAttributeAsBoolean("String_Node_Str",hasStockPrice);
  }
  Tag payoutTag=tag.getChild("String_Node_Str");
  if (payoutTag != null) {
    String split=payoutTag.getAttributeAsString("String_Node_Str","String_Node_Str");
    splitAlways=split.equalsIgnoreCase("String_Node_Str");
    splitAllowed=split.equalsIgnoreCase("String_Node_Str");
    payoutMustExceedPriceToMove=payoutTag.getAttributeAsBoolean("String_Node_Str",false);
  }
  Tag ownSharesTag=tag.getChild("String_Node_Str");
  if (ownSharesTag != null) {
    canHoldOwnShares=true;
    treasuryPaysOut=true;
    maxPercOfOwnShares=ownSharesTag.getAttributeAsInteger("String_Node_Str",maxPercOfOwnShares);
  }
  Tag trainsTag=tag.getChild("String_Node_Str");
  if (trainsTag != null) {
    trainLimit=trainsTag.getAttributeAsIntegerArray("String_Node_Str",trainLimit);
    mustOwnATrain=trainsTag.getAttributeAsBoolean("String_Node_Str",mustOwnATrain);
  }
  Tag initialTrainTag=tag.getChild("String_Node_Str");
  if (initialTrainTag != null) {
    initialTrainType=initialTrainTag.getAttributeAsString("String_Node_Str");
    initialTrainCost=initialTrainTag.getAttributeAsInteger("String_Node_Str",initialTrainCost);
    initialTrainTradeable=initialTrainTag.getAttributeAsBoolean("String_Node_Str",initialTrainTradeable);
  }
  Tag firstTrainTag=tag.getChild("String_Node_Str");
  if (firstTrainTag != null) {
    String typeName=firstTrainTag.getAttributeAsString("String_Node_Str","String_Node_Str");
    if (typeName.equalsIgnoreCase("String_Node_Str")) {
      privateToCloseOnFirstTrainName=firstTrainTag.getAttributeAsString("String_Node_Str");
    }
 else {
      throw new ConfigurationException("String_Node_Str");
    }
  }
  Tag capitalisationTag=tag.getChild("String_Node_Str");
  if (capitalisationTag != null) {
    String capType=capitalisationTag.getAttributeAsString("String_Node_Str","String_Node_Str");
    if (capType.equalsIgnoreCase("String_Node_Str")) {
      setCapitalisation(CAPITALISE_FULL);
    }
 else     if (capType.equalsIgnoreCase("String_Node_Str")) {
      setCapitalisation(CAPITALISE_INCREMENTAL);
    }
 else     if (capType.equalsIgnoreCase("String_Node_Str")) {
      setCapitalisation(CAPITALISE_WHEN_BOUGHT);
    }
 else {
      throw new ConfigurationException("String_Node_Str" + capType);
    }
  }
  Tag tileLaysTag=tag.getChild("String_Node_Str");
  if (tileLaysTag != null) {
    for (    Tag numberTag : tileLaysTag.getChildren("String_Node_Str")) {
      String colourString=numberTag.getAttributeAsString("String_Node_Str");
      if (colourString == null)       throw new ConfigurationException("String_Node_Str");
      String phaseString=numberTag.getAttributeAsString("String_Node_Str");
      if (phaseString == null)       throw new ConfigurationException("String_Node_Str");
      int number=numberTag.getAttributeAsInteger("String_Node_Str");
      Integer lays=new Integer(number);
      int validForTurns=numberTag.getAttributeAsInteger("String_Node_Str",0);
      String[] colours=colourString.split("String_Node_Str");
      HashMap<String,Integer> phaseMap;
      String[] phases=phaseString.split("String_Node_Str");
      for (int i=0; i < colours.length; i++) {
        if (extraTileLays == null)         extraTileLays=new HashMap<String,HashMap<String,Integer>>();
        extraTileLays.put(colours[i],(phaseMap=new HashMap<String,Integer>()));
        for (int k=0; k < phases.length; k++) {
          phaseMap.put(phases[k],lays);
        }
        if (validForTurns > 0) {
          if (turnsWithExtraTileLaysInit == null) {
            turnsWithExtraTileLaysInit=new HashMap<String,Integer>();
          }
          turnsWithExtraTileLaysInit.put(colours[i],validForTurns);
        }
      }
    }
  }
  List<Tag> certTags=tag.getChildren("String_Node_Str");
  if (certTags != null)   certificateTags=certTags;
  Tag baseTokenTag=tag.getChild("String_Node_Str");
  if (baseTokenTag != null) {
    Tag layCostTag=baseTokenTag.getChild("String_Node_Str");
    if (layCostTag != null) {
      baseTokenLayCostMethod=layCostTag.getAttributeAsString("String_Node_Str",baseTokenLayCostMethod);
      if (baseTokenLayCostMethod.equalsIgnoreCase(BASE_COST_SEQUENCE)) {
        baseTokenLayCostMethod=BASE_COST_SEQUENCE;
      }
 else       if (baseTokenLayCostMethod.equalsIgnoreCase(BASE_COST_DISTANCE)) {
        baseTokenLayCostMethod=BASE_COST_DISTANCE;
      }
 else {
        throw new ConfigurationException("String_Node_Str" + baseTokenLayCostMethod);
      }
      baseTokenLayCost=layCostTag.getAttributeAsIntegerArray("String_Node_Str");
    }
    Tag buyCostTag=baseTokenTag.getChild("String_Node_Str");
    if (buyCostTag != null) {
      baseTokensBuyCost=buyCostTag.getAttributeAsInteger("String_Node_Str",0);
    }
    Tag tokenLayTimeTag=baseTokenTag.getChild("String_Node_Str");
    if (tokenLayTimeTag != null) {
      String layTimeString=tokenLayTimeTag.getAttributeAsString("String_Node_Str");
      if (Util.hasValue(layTimeString)) {
        for (int i=0; i < tokenLayTimeNames.length; i++) {
          if (tokenLayTimeNames[i].equalsIgnoreCase(layTimeString)) {
            homeBaseTokensLayTime=i;
            break;
          }
        }
      }
    }
  }
  Tag sellSharesTag=tag.getChild("String_Node_Str");
  if (sellSharesTag != null) {
    mayTradeShares=true;
    mustHaveOperatedToTradeShares=sellSharesTag.getAttributeAsBoolean("String_Node_Str",mustHaveOperatedToTradeShares);
  }
  Tag loansTag=tag.getChild("String_Node_Str");
  if (loansTag != null) {
    maxNumberOfLoans=loansTag.getAttributeAsInteger("String_Node_Str",-1);
    valuePerLoan=loansTag.getAttributeAsInteger("String_Node_Str",0);
    loanInterestPct=loansTag.getAttributeAsInteger("String_Node_Str",0);
    maxLoansPerRound=loansTag.getAttributeAsInteger("String_Node_Str",-1);
  }
  Tag optionsTag=tag.getChild("String_Node_Str");
  if (optionsTag != null) {
    mustTradeTrainsAtFixedPrice=optionsTag.getAttributeAsBoolean("String_Node_Str",mustTradeTrainsAtFixedPrice);
    canClose=optionsTag.getAttributeAsBoolean("String_Node_Str",canClose);
  }
}