Program: 173854
Project: 173854
Buggy source:
private void init(){
  certPerPlayer=new Field[nc][np];
  certPerPlayerButton=new ClickField[nc][np];
  certInIPO=new Field[nc];
  certInIPOButton=new ClickField[nc];
  certInPool=new Field[nc];
  certInPoolButton=new ClickField[nc];
  parPrice=new Field[nc];
  currPrice=new Field[nc];
  compCash=new Field[nc];
  compRevenue=new Field[nc];
  compTrains=new Field[nc];
  compPrivates=new Field[nc];
  playerCash=new Field[np];
  playerPrivates=new Field[np];
  playerWorth=new Field[np];
  upperPlayerCaption=new Caption[np];
  lowerPlayerCaption=new Caption[np];
  certPerPlayerXOffset=1;
  certPerPlayerYOffset=2;
  certInIPOXOffset=np + 1;
  certInIPOYOffset=2;
  certInPoolXOffset=np + 2;
  certInPoolYOffset=2;
  parPriceXOffset=np + 3;
  parPriceYOffset=2;
  currPriceXOffset=np + 4;
  currPriceYOffset=2;
  compCashXOffset=np + 5;
  compCashYOffset=2;
  compRevenueXOffset=np + 6;
  compRevenueYOffset=2;
  compTrainsXOffset=np + 7;
  compTrainsYOffset=2;
  compPrivatesXOffset=np + 8;
  compPrivatesYOffset=2;
  playerCashXOffset=1;
  playerCashYOffset=nc + 2;
  playerPrivatesXOffset=1;
  playerPrivatesYOffset=nc + 3;
  playerWorthXOffset=1;
  playerWorthYOffset=nc + 4;
  bankCashXOffset=np + 2;
  bankCashYOffset=nc + 3;
  poolTrainsXOffset=np + 3;
  poolTrainsYOffset=nc + 3;
  newTrainsXOffset=np + 5;
  newTrainsYOffset=nc + 3;
  futureTrainsXOffset=np + 6;
  futureTrainsYOffset=nc + 3;
  addField(new Caption("String_Node_Str"),0,0,1,2,WIDE_RIGHT + WIDE_BOTTOM);
  addField(new Caption("String_Node_Str"),certPerPlayerXOffset,0,np,1,0);
  for (int i=0; i < np; i++) {
    playerIndex.put(players[i],new Integer(i));
    f=upperPlayerCaption[i]=new Caption(players[i].getName());
    addField(f,certPerPlayerXOffset + i,1,1,1,WIDE_BOTTOM);
  }
  addField(new Caption("String_Node_Str"),certInIPOXOffset,0,2,1,WIDE_LEFT + WIDE_RIGHT);
  addField(new Caption("String_Node_Str"),certInIPOXOffset,1,1,1,WIDE_LEFT + WIDE_BOTTOM);
  addField(new Caption("String_Node_Str"),certInPoolXOffset,1,1,1,WIDE_RIGHT + WIDE_BOTTOM);
  addField(new Caption("String_Node_Str"),parPriceXOffset,0,2,1,WIDE_RIGHT);
  addField(new Caption("String_Node_Str"),parPriceXOffset,1,1,1,WIDE_BOTTOM);
  addField(new Caption("String_Node_Str"),currPriceXOffset,1,1,1,WIDE_RIGHT + WIDE_BOTTOM);
  addField(new Caption("String_Node_Str"),compCashXOffset,0,4,1,0);
  addField(new Caption("String_Node_Str"),compCashXOffset,1,1,1,WIDE_BOTTOM);
  addField(new Caption("String_Node_Str"),compRevenueXOffset,1,1,1,WIDE_BOTTOM);
  addField(new Caption("String_Node_Str"),compTrainsXOffset,1,1,1,WIDE_BOTTOM);
  addField(new Caption("String_Node_Str"),compPrivatesXOffset,1,1,1,WIDE_BOTTOM);
  addField(new Caption("String_Node_Str"),compPrivatesXOffset + 1,0,1,2,WIDE_LEFT + WIDE_BOTTOM);
  for (int i=0; i < nc; i++) {
    c=companies[i];
    companyIndex.put(c,new Integer(i));
    f=new Caption(c.getName());
    f.setForeground(c.getFgColour());
    f.setBackground(c.getBgColour());
    addField(f,0,certPerPlayerYOffset + i,1,1,WIDE_RIGHT);
    for (int j=0; j < np; j++) {
      f=certPerPlayer[i][j]=new Field(players[j].getPortfolio().getShareModel(c));
      addField(f,certPerPlayerXOffset + j,certPerPlayerYOffset + i,1,1,0);
      f=certPerPlayerButton[i][j]=new ClickField("String_Node_Str","String_Node_Str","String_Node_Str",this,buySellGroup);
      addField(f,certPerPlayerXOffset + j,certPerPlayerYOffset + i,1,1,0);
    }
    f=certInIPO[i]=new Field(Bank.getIpo().getShareModel(c));
    addField(f,certInIPOXOffset,certInIPOYOffset + i,1,1,WIDE_LEFT);
    f=certInIPOButton[i]=new ClickField(certInIPO[i].getText(),"String_Node_Str","String_Node_Str",this,buySellGroup);
    f.setVisible(false);
    addField(f,certInIPOXOffset,certInIPOYOffset + i,1,1,WIDE_LEFT);
    certInIPO[i].setPreferredSize(certInIPOButton[i].getPreferredSize());
    f=certInPool[i]=new Field(Bank.getPool().getShareModel(c));
    addField(f,certInPoolXOffset,certInPoolYOffset + i,1,1,WIDE_RIGHT);
    f=certInPoolButton[i]=new ClickField(certInPool[i].getText(),"String_Node_Str","String_Node_Str",this,buySellGroup);
    f.setVisible(false);
    addField(f,certInPoolXOffset,certInPoolYOffset + i,1,1,WIDE_RIGHT);
    certInPool[i].setPreferredSize(certInIPOButton[i].getPreferredSize());
    f=parPrice[i]=new Field(c.getParPriceModel());
    addField(f,parPriceXOffset,parPriceYOffset + i,1,1,0);
    f=currPrice[i]=new Field(c.getCurrentPriceModel());
    addField(f,currPriceXOffset,currPriceYOffset + i,1,1,WIDE_RIGHT);
    f=compCash[i]=new Field(c.getCashModel());
    addField(f,compCashXOffset,compCashYOffset + i,1,1,0);
    f=compRevenue[i]=new Field(c.getLastRevenueModel());
    addField(f,compRevenueXOffset,compRevenueYOffset + i,1,1,0);
    f=compTrains[i]=new Field(c.getPortfolio().getTrainsModel().option(TrainsModel.FULL_LIST));
    addField(f,compTrainsXOffset,compTrainsYOffset + i,1,1,0);
    f=compPrivates[i]=new Field(c.getPortfolio().getPrivatesModel().option(PrivatesModel.SPACE));
    addField(f,compPrivatesXOffset,compPrivatesYOffset + i,1,1,0);
    f=new Caption(c.getName());
    f.setForeground(c.getFgColour());
    f.setBackground(c.getBgColour());
    addField(f,compPrivatesXOffset + 1,compPrivatesYOffset + i,1,1,WIDE_LEFT);
  }
  addField(new Caption("String_Node_Str"),0,playerCashYOffset,1,1,WIDE_TOP + WIDE_RIGHT);
  for (int i=0; i < np; i++) {
    f=playerCash[i]=new Field(players[i].getCashModel());
    addField(f,playerCashXOffset + i,playerCashYOffset,1,1,WIDE_TOP);
  }
  addField(new Caption("String_Node_Str"),0,playerPrivatesYOffset,1,1,WIDE_RIGHT);
  for (int i=0; i < np; i++) {
    f=playerPrivates[i]=new Field(players[i].getPortfolio().getPrivatesModel().option(PrivatesModel.BREAK));
    addField(f,playerPrivatesXOffset + i,playerPrivatesYOffset,1,1,0);
  }
  addField(new Caption("String_Node_Str"),0,playerWorthYOffset,1,1,WIDE_RIGHT);
  for (int i=0; i < np; i++) {
    f=playerWorth[i]=new Field(players[i].getWorthModel(),true);
    addField(f,playerWorthXOffset + i,playerWorthYOffset,1,1,0);
  }
  for (int i=0; i < np; i++) {
    f=lowerPlayerCaption[i]=new Caption(players[i].getName());
    addField(f,i + 1,playerWorthYOffset + 1,1,1,WIDE_TOP);
  }
  addField(new Caption("String_Node_Str"),bankCashXOffset - 1,bankCashYOffset - 1,1,2,WIDE_TOP + WIDE_LEFT);
  addField(new Caption("String_Node_Str"),bankCashXOffset,bankCashYOffset - 1,1,1,WIDE_TOP);
  bankCash=new Field(Bank.getInstance().getCashModel());
  addField(bankCash,bankCashXOffset,bankCashYOffset,1,1,0);
  addField(new Caption("String_Node_Str"),poolTrainsXOffset,poolTrainsYOffset - 1,2,1,WIDE_TOP + WIDE_RIGHT);
  poolTrains=new Field(Bank.getPool().getTrainsModel().option(TrainsModel.FULL_LIST));
  addField(poolTrains,poolTrainsXOffset,poolTrainsYOffset,2,1,WIDE_RIGHT);
  addField(new Caption("String_Node_Str"),newTrainsXOffset,newTrainsYOffset - 1,1,1,WIDE_TOP);
  newTrains=new Field(Bank.getIpo().getTrainsModel().option(TrainsModel.ABBR_LIST));
  addField(newTrains,newTrainsXOffset,newTrainsYOffset,1,1,0);
  dummyButton=new ClickField("String_Node_Str","String_Node_Str","String_Node_Str",this,buySellGroup);
  addField(new Caption("String_Node_Str"),futureTrainsXOffset,futureTrainsYOffset - 1,3,1,WIDE_LEFT + WIDE_TOP);
  futureTrains=new Field(Bank.getUnavailable().getTrainsModel().option(TrainsModel.ABBR_LIST));
  addField(futureTrains,futureTrainsXOffset,futureTrainsYOffset,3,1,WIDE_LEFT);
  dummyButton=new ClickField("String_Node_Str","String_Node_Str","String_Node_Str",this,buySellGroup);
}

Fixed version (ground truth):
private void init(){
  certPerPlayer=new Field[nc][np];
  certPerPlayerButton=new ClickField[nc][np];
  certInIPO=new Field[nc];
  certInIPOButton=new ClickField[nc];
  certInPool=new Field[nc];
  certInPoolButton=new ClickField[nc];
  parPrice=new Field[nc];
  currPrice=new Field[nc];
  compCash=new Field[nc];
  compRevenue=new Field[nc];
  compTrains=new Field[nc];
  compPrivates=new Field[nc];
  playerCash=new Field[np];
  playerPrivates=new Field[np];
  playerWorth=new Field[np];
  playerCertCount=new Field[np];
  upperPlayerCaption=new Caption[np];
  lowerPlayerCaption=new Caption[np];
  certPerPlayerXOffset=1;
  certPerPlayerYOffset=2;
  certInIPOXOffset=np + 1;
  certInIPOYOffset=2;
  certInPoolXOffset=np + 2;
  certInPoolYOffset=2;
  parPriceXOffset=np + 3;
  parPriceYOffset=2;
  currPriceXOffset=np + 4;
  currPriceYOffset=2;
  compCashXOffset=np + 5;
  compCashYOffset=2;
  compRevenueXOffset=np + 6;
  compRevenueYOffset=2;
  compTrainsXOffset=np + 7;
  compTrainsYOffset=2;
  compPrivatesXOffset=np + 8;
  compPrivatesYOffset=2;
  playerCashXOffset=1;
  playerCashYOffset=nc + 2;
  playerPrivatesXOffset=1;
  playerPrivatesYOffset=nc + 3;
  playerWorthXOffset=1;
  playerWorthYOffset=nc + 4;
  playerCertCountXOffset=1;
  playerCertCountYOffset=nc + 5;
  certLimitXOffset=np + 2;
  certLimitYOffset=playerCertCountYOffset;
  bankCashXOffset=np + 2;
  bankCashYOffset=nc + 3;
  poolTrainsXOffset=np + 3;
  poolTrainsYOffset=nc + 3;
  newTrainsXOffset=np + 5;
  newTrainsYOffset=nc + 3;
  futureTrainsXOffset=np + 6;
  futureTrainsYOffset=nc + 3;
  addField(new Caption("String_Node_Str"),0,0,1,2,WIDE_RIGHT + WIDE_BOTTOM);
  addField(new Caption("String_Node_Str"),certPerPlayerXOffset,0,np,1,0);
  for (int i=0; i < np; i++) {
    playerIndex.put(players[i],new Integer(i));
    f=upperPlayerCaption[i]=new Caption(players[i].getName());
    addField(f,certPerPlayerXOffset + i,1,1,1,WIDE_BOTTOM);
  }
  addField(new Caption("String_Node_Str"),certInIPOXOffset,0,2,1,WIDE_LEFT + WIDE_RIGHT);
  addField(new Caption("String_Node_Str"),certInIPOXOffset,1,1,1,WIDE_LEFT + WIDE_BOTTOM);
  addField(new Caption("String_Node_Str"),certInPoolXOffset,1,1,1,WIDE_RIGHT + WIDE_BOTTOM);
  addField(new Caption("String_Node_Str"),parPriceXOffset,0,2,1,WIDE_RIGHT);
  addField(new Caption("String_Node_Str"),parPriceXOffset,1,1,1,WIDE_BOTTOM);
  addField(new Caption("String_Node_Str"),currPriceXOffset,1,1,1,WIDE_RIGHT + WIDE_BOTTOM);
  addField(new Caption("String_Node_Str"),compCashXOffset,0,4,1,0);
  addField(new Caption("String_Node_Str"),compCashXOffset,1,1,1,WIDE_BOTTOM);
  addField(new Caption("String_Node_Str"),compRevenueXOffset,1,1,1,WIDE_BOTTOM);
  addField(new Caption("String_Node_Str"),compTrainsXOffset,1,1,1,WIDE_BOTTOM);
  addField(new Caption("String_Node_Str"),compPrivatesXOffset,1,1,1,WIDE_BOTTOM);
  addField(new Caption("String_Node_Str"),compPrivatesXOffset + 1,0,1,2,WIDE_LEFT + WIDE_BOTTOM);
  for (int i=0; i < nc; i++) {
    c=companies[i];
    companyIndex.put(c,new Integer(i));
    f=new Caption(c.getName());
    f.setForeground(c.getFgColour());
    f.setBackground(c.getBgColour());
    addField(f,0,certPerPlayerYOffset + i,1,1,WIDE_RIGHT);
    for (int j=0; j < np; j++) {
      f=certPerPlayer[i][j]=new Field(players[j].getPortfolio().getShareModel(c));
      addField(f,certPerPlayerXOffset + j,certPerPlayerYOffset + i,1,1,0);
      f=certPerPlayerButton[i][j]=new ClickField("String_Node_Str","String_Node_Str","String_Node_Str",this,buySellGroup);
      addField(f,certPerPlayerXOffset + j,certPerPlayerYOffset + i,1,1,0);
    }
    f=certInIPO[i]=new Field(Bank.getIpo().getShareModel(c));
    addField(f,certInIPOXOffset,certInIPOYOffset + i,1,1,WIDE_LEFT);
    f=certInIPOButton[i]=new ClickField(certInIPO[i].getText(),"String_Node_Str","String_Node_Str",this,buySellGroup);
    f.setVisible(false);
    addField(f,certInIPOXOffset,certInIPOYOffset + i,1,1,WIDE_LEFT);
    certInIPO[i].setPreferredSize(certInIPOButton[i].getPreferredSize());
    f=certInPool[i]=new Field(Bank.getPool().getShareModel(c));
    addField(f,certInPoolXOffset,certInPoolYOffset + i,1,1,WIDE_RIGHT);
    f=certInPoolButton[i]=new ClickField(certInPool[i].getText(),"String_Node_Str","String_Node_Str",this,buySellGroup);
    f.setVisible(false);
    addField(f,certInPoolXOffset,certInPoolYOffset + i,1,1,WIDE_RIGHT);
    certInPool[i].setPreferredSize(certInIPOButton[i].getPreferredSize());
    f=parPrice[i]=new Field(c.getParPriceModel());
    addField(f,parPriceXOffset,parPriceYOffset + i,1,1,0);
    f=currPrice[i]=new Field(c.getCurrentPriceModel());
    addField(f,currPriceXOffset,currPriceYOffset + i,1,1,WIDE_RIGHT);
    f=compCash[i]=new Field(c.getCashModel());
    addField(f,compCashXOffset,compCashYOffset + i,1,1,0);
    f=compRevenue[i]=new Field(c.getLastRevenueModel());
    addField(f,compRevenueXOffset,compRevenueYOffset + i,1,1,0);
    f=compTrains[i]=new Field(c.getPortfolio().getTrainsModel().option(TrainsModel.FULL_LIST));
    addField(f,compTrainsXOffset,compTrainsYOffset + i,1,1,0);
    f=compPrivates[i]=new Field(c.getPortfolio().getPrivatesModel().option(PrivatesModel.SPACE));
    addField(f,compPrivatesXOffset,compPrivatesYOffset + i,1,1,0);
    f=new Caption(c.getName());
    f.setForeground(c.getFgColour());
    f.setBackground(c.getBgColour());
    addField(f,compPrivatesXOffset + 1,compPrivatesYOffset + i,1,1,WIDE_LEFT);
  }
  addField(new Caption("String_Node_Str"),0,playerCashYOffset,1,1,WIDE_TOP + WIDE_RIGHT);
  for (int i=0; i < np; i++) {
    f=playerCash[i]=new Field(players[i].getCashModel());
    addField(f,playerCashXOffset + i,playerCashYOffset,1,1,WIDE_TOP);
  }
  addField(new Caption("String_Node_Str"),0,playerPrivatesYOffset,1,1,WIDE_RIGHT);
  for (int i=0; i < np; i++) {
    f=playerPrivates[i]=new Field(players[i].getPortfolio().getPrivatesModel().option(PrivatesModel.BREAK));
    addField(f,playerPrivatesXOffset + i,playerPrivatesYOffset,1,1,0);
  }
  addField(new Caption("String_Node_Str"),0,playerWorthYOffset,1,1,WIDE_RIGHT);
  for (int i=0; i < np; i++) {
    f=playerWorth[i]=new Field(players[i].getWorthModel(),true);
    addField(f,playerWorthXOffset + i,playerWorthYOffset,1,1,0);
  }
  addField(new Caption("String_Node_Str"),0,playerCertCountYOffset,1,1,WIDE_RIGHT + WIDE_TOP);
  for (int i=0; i < np; i++) {
    f=playerCertCount[i]=new Field(players[i].getCertCountModel(),true);
    addField(f,playerCertCountXOffset + i,playerCertCountYOffset,1,1,WIDE_TOP);
  }
  for (int i=0; i < np; i++) {
    f=lowerPlayerCaption[i]=new Caption(players[i].getName());
    addField(f,i + 1,playerCertCountYOffset + 1,1,1,WIDE_TOP);
  }
  addField(new Caption("String_Node_Str"),certLimitXOffset - 1,certLimitYOffset,1,1,WIDE_TOP + WIDE_LEFT);
  addField(new Field("String_Node_Str" + Player.getCertLimit()),certLimitXOffset,certLimitYOffset,1,1,WIDE_TOP);
  addField(new Caption("String_Node_Str"),bankCashXOffset - 1,bankCashYOffset - 1,1,2,WIDE_TOP + WIDE_LEFT);
  addField(new Caption("String_Node_Str"),bankCashXOffset,bankCashYOffset - 1,1,1,WIDE_TOP);
  bankCash=new Field(Bank.getInstance().getCashModel());
  addField(bankCash,bankCashXOffset,bankCashYOffset,1,1,0);
  addField(new Caption("String_Node_Str"),poolTrainsXOffset,poolTrainsYOffset - 1,2,1,WIDE_TOP + WIDE_RIGHT);
  poolTrains=new Field(Bank.getPool().getTrainsModel().option(TrainsModel.FULL_LIST));
  addField(poolTrains,poolTrainsXOffset,poolTrainsYOffset,2,1,WIDE_RIGHT);
  addField(new Caption("String_Node_Str"),newTrainsXOffset,newTrainsYOffset - 1,1,1,WIDE_TOP);
  newTrains=new Field(Bank.getIpo().getTrainsModel().option(TrainsModel.ABBR_LIST));
  addField(newTrains,newTrainsXOffset,newTrainsYOffset,1,1,0);
  dummyButton=new ClickField("String_Node_Str","String_Node_Str","String_Node_Str",this,buySellGroup);
  addField(new Caption("String_Node_Str"),futureTrainsXOffset,futureTrainsYOffset - 1,3,1,WIDE_LEFT + WIDE_TOP);
  futureTrains=new Field(Bank.getUnavailable().getTrainsModel().option(TrainsModel.ABBR_LIST));
  addField(futureTrains,futureTrainsXOffset,futureTrainsYOffset,3,1,WIDE_LEFT);
  dummyButton=new ClickField("String_Node_Str","String_Node_Str","String_Node_Str",this,buySellGroup);
}