Program: 168415
Project: 168415
Buggy source:
@Override public void displayExercise(){
  final EVExercise exercise=getDocument().getExercise();
  tbLaps.setModel(new AbstractTableModel(){
    public String getColumnName(    int col){
      return columnNames[col];
    }
    public int getRowCount(){
      if (exercise.getLapList() != null) {
        return exercise.getLapList().length;
      }
      return 0;
    }
    public int getColumnCount(){
      return columnNames.length;
    }
    /** 
 * Returns the class of the specified column (needes for sorting). 
 */
    @Override public Class<?> getColumnClass(    int col){
switch (col) {
case COLUMN_LAP:
case COLUMN_LAP_TIME:
case COLUMN_SPLIT_TIME:
case COLUMN_DISTANCE:
case COLUMN_ASCENT:
        return Integer.class;
case COLUMN_HEARTRATE:
case COLUMN_AVG_HEARTRATE:
case COLUMN_MAX_HEARTRATE:
case COLUMN_ALTITUDE:
case COLUMN_CADENCE:
case COLUMN_TEMPERATURE:
      return Short.class;
case COLUMN_END_SPEED:
case COLUMN_AVG_SPEED:
    return Float.class;
default :
  return Object.class;
}
}
public Object getValueAt(int row,int col){
Lap lap=exercise.getLapList()[row];
switch (col) {
case COLUMN_LAP:
return Integer.valueOf(row + 1);
case COLUMN_LAP_TIME:
int previousLapSplitTime=0;
if (row > 0) {
previousLapSplitTime=exercise.getLapList()[row - 1].getTimeSplit();
}
return Integer.valueOf(lap.getTimeSplit() - previousLapSplitTime);
case COLUMN_SPLIT_TIME:
return Integer.valueOf(lap.getTimeSplit());
case COLUMN_HEARTRATE:
return Short.valueOf(lap.getHeartRateSplit());
case COLUMN_AVG_HEARTRATE:
return Short.valueOf(lap.getHeartRateAVG());
case COLUMN_MAX_HEARTRATE:
return Short.valueOf(lap.getHeartRateMax());
case COLUMN_END_SPEED:
if (lap.getSpeed() != null) {
return new Float(lap.getSpeed().getSpeedEnd());
}
break;
case COLUMN_AVG_SPEED:
if (lap.getSpeed() != null) {
return new Float(lap.getSpeed().getSpeedAVG());
}
break;
case COLUMN_DISTANCE:
if (lap.getSpeed() != null) {
return Integer.valueOf(lap.getSpeed().getDistance());
}
break;
case COLUMN_CADENCE:
if ((lap.getSpeed() != null) && (exercise.getRecordingMode().isCadence())) {
return Short.valueOf(lap.getSpeed().getCadence());
}
break;
case COLUMN_ALTITUDE:
if (lap.getAltitude() != null) {
return Short.valueOf(lap.getAltitude().getAltitude());
}
break;
case COLUMN_ASCENT:
if ((lap.getAltitude() != null) && (exercise.getFileType() != EVExercise.ExerciseFileType.HRM)) {
return Integer.valueOf(lap.getAltitude().getAscent());
}
break;
case COLUMN_TEMPERATURE:
if (lap.getTemperature() != null) {
return Short.valueOf(lap.getTemperature().getTemperature());
}
break;
}
return null;
}
public boolean isCellEditable(int row,int col){
return false;
}
}
);
LapCellRenderer cellRenderer=new LapCellRenderer();
for (int i=0; i < COLUMN_COUNT; i++) {
tbLaps.getColumnModel().getColumn(i).setCellRenderer(cellRenderer);
}
}

Fixed version (ground truth):
@Override public void displayExercise(){
  final EVExercise exercise=getDocument().getExercise();
  tbLaps.setModel(new AbstractTableModel(){
    public String getColumnName(    int col){
      return columnNames[col];
    }
    public int getRowCount(){
      if (exercise.getLapList() != null) {
        return exercise.getLapList().length;
      }
      return 0;
    }
    public int getColumnCount(){
      return columnNames.length;
    }
    /** 
 * Returns the class of the specified column (needes for sorting). 
 */
    @Override public Class<?> getColumnClass(    int col){
switch (col) {
case COLUMN_LAP:
case COLUMN_LAP_TIME:
case COLUMN_SPLIT_TIME:
case COLUMN_DISTANCE:
case COLUMN_ASCENT:
        return Integer.class;
case COLUMN_HEARTRATE:
case COLUMN_AVG_HEARTRATE:
case COLUMN_MAX_HEARTRATE:
case COLUMN_ALTITUDE:
case COLUMN_CADENCE:
case COLUMN_TEMPERATURE:
      return Short.class;
case COLUMN_END_SPEED:
case COLUMN_AVG_SPEED:
    return Float.class;
default :
  return Object.class;
}
}
public Object getValueAt(int row,int col){
Lap lap=exercise.getLapList()[row];
switch (col) {
case COLUMN_LAP:
return Integer.valueOf(row + 1);
case COLUMN_LAP_TIME:
int previousLapSplitTime=0;
if (row > 0) {
previousLapSplitTime=exercise.getLapList()[row - 1].getTimeSplit();
}
return Integer.valueOf(lap.getTimeSplit() - previousLapSplitTime);
case COLUMN_SPLIT_TIME:
return Integer.valueOf(lap.getTimeSplit());
case COLUMN_HEARTRATE:
return Short.valueOf(lap.getHeartRateSplit());
case COLUMN_AVG_HEARTRATE:
return Short.valueOf(lap.getHeartRateAVG());
case COLUMN_MAX_HEARTRATE:
return Short.valueOf(lap.getHeartRateMax());
case COLUMN_END_SPEED:
if (lap.getSpeed() != null) {
return Float.valueOf(lap.getSpeed().getSpeedEnd());
}
break;
case COLUMN_AVG_SPEED:
if (lap.getSpeed() != null) {
return new Float(lap.getSpeed().getSpeedAVG());
}
break;
case COLUMN_DISTANCE:
if (lap.getSpeed() != null) {
return Integer.valueOf(lap.getSpeed().getDistance());
}
break;
case COLUMN_CADENCE:
if ((lap.getSpeed() != null) && (exercise.getRecordingMode().isCadence())) {
return Short.valueOf(lap.getSpeed().getCadence());
}
break;
case COLUMN_ALTITUDE:
if (lap.getAltitude() != null) {
return Short.valueOf(lap.getAltitude().getAltitude());
}
break;
case COLUMN_ASCENT:
if ((lap.getAltitude() != null) && (exercise.getFileType() != EVExercise.ExerciseFileType.HRM)) {
return Integer.valueOf(lap.getAltitude().getAscent());
}
break;
case COLUMN_TEMPERATURE:
if (lap.getTemperature() != null) {
return Short.valueOf(lap.getTemperature().getTemperature());
}
break;
}
return null;
}
public boolean isCellEditable(int row,int col){
return false;
}
}
);
LapCellRenderer cellRenderer=new LapCellRenderer();
for (int i=0; i < COLUMN_COUNT; i++) {
tbLaps.getColumnModel().getColumn(i).setCellRenderer(cellRenderer);
}
}