Program: 173938
Project: 173938
Buggy source:
private void populateStockPanel(){
  int depth=0;
  Point origin=new Point(20,0);
  Dimension size=new Dimension(40,40);
  StockSpace[][] market=stockMarket.getStockChart();
  JLabel priceLabel;
  JLayeredPane layeredPane;
  ArrayList tokenList;
  Color bgColour;
  Color fgColour;
  PublicCompany co;
  StockToken token;
  stockGrid.setColumns(market[0].length);
  stockGrid.setRows(market.length);
  for (int i=0; i < market.length; i++) {
    for (int j=0; j < market[0].length; j++) {
      layeredPane=new JLayeredPane();
      priceLabel=new JLabel();
      stockPanel.add(layeredPane);
      priceLabel.setBounds(1,1,size.width,size.height);
      priceLabel.setOpaque(true);
      layeredPane.add(priceLabel,new Integer(0),depth);
      layeredPane.moveToBack(priceLabel);
      layeredPane.setPreferredSize(new Dimension(40,30));
      try {
        priceLabel.setText(Integer.toString(market[i][j].getPrice()));
      }
 catch (      NullPointerException e) {
        priceLabel.setText("String_Node_Str");
      }
      try {
        priceLabel.setBackground(stringToColor(market[i][j].getColour()));
      }
 catch (      NullPointerException e) {
        priceLabel.setBackground(Color.WHITE);
      }
      try {
        if (market[i][j].isStart()) {
          priceLabel.setBorder(BorderFactory.createLineBorder(Color.red,2));
        }
      }
 catch (      NullPointerException e) {
      }
      try {
        if (market[i][j].hasTokens()) {
          tokenList=market[i][j].getTokens();
          for (int k=0; k < tokenList.size(); k++) {
            co=(PublicCompany)tokenList.get(k);
            bgColour=co.getBgColour();
            fgColour=co.getFgColour();
            token=new StockToken(fgColour,bgColour);
            token.setBounds(origin.x,origin.y,size.width,size.height);
            layeredPane.add(token,new Integer(0),depth);
            layeredPane.moveToFront(token);
            origin.y+=6;
          }
        }
      }
 catch (      NullPointerException e) {
      }
    }
  }
}

Fixed version (ground truth):
private void populateStockPanel(){
  int depth=0;
  Dimension size=new Dimension(40,40);
  StockSpace[][] market=stockMarket.getStockChart();
  JLabel priceLabel;
  JLayeredPane layeredPane;
  ArrayList tokenList;
  stockGrid.setColumns(market[0].length);
  stockGrid.setRows(market.length);
  for (int i=0; i < market.length; i++) {
    for (int j=0; j < market[0].length; j++) {
      layeredPane=new JLayeredPane();
      priceLabel=new JLabel();
      stockPanel.add(layeredPane);
      priceLabel.setBounds(1,1,size.width,size.height);
      priceLabel.setOpaque(true);
      layeredPane.add(priceLabel,new Integer(0),depth);
      layeredPane.moveToBack(priceLabel);
      layeredPane.setPreferredSize(new Dimension(40,30));
      try {
        priceLabel.setText(Integer.toString(market[i][j].getPrice()));
      }
 catch (      NullPointerException e) {
        priceLabel.setText("String_Node_Str");
      }
      try {
        priceLabel.setBackground(stringToColor(market[i][j].getColour()));
      }
 catch (      NullPointerException e) {
        priceLabel.setBackground(Color.WHITE);
      }
      try {
        if (market[i][j].isStart()) {
          priceLabel.setBorder(BorderFactory.createLineBorder(Color.red,2));
        }
      }
 catch (      NullPointerException e) {
      }
      try {
        if (market[i][j].hasTokens()) {
          tokenList=market[i][j].getTokens();
          placeToken(tokenList,layeredPane);
        }
      }
 catch (      NullPointerException e) {
      }
    }
  }
}