Program: 74031
Project: 74031
Buggy source:
private void addColumn(ColumnEvent event,IReportContent report,ITableContent table){
  Column col=new Column(report);
  DimensionHandle handle=null;
  try {
switch (event.type) {
case ColumnEvent.ROW_EDGE_CHANGE:
      handle=crosstabItem.getColumnWidth(crosstabItem.getDimension(ROW_AXIS_TYPE,event.dimensionIndex).getLevel(event.levelIndex).getCell());
    break;
case ColumnEvent.MEASURE_HEADER_CHANGE:
  for (int i=0; i < crosstabItem.getMeasureCount(); i++) {
    MeasureViewHandle mv=crosstabItem.getMeasure(i);
    if (mv.getHeader() != null) {
      handle=crosstabItem.getColumnWidth(mv.getHeader());
      break;
    }
  }
break;
case ColumnEvent.COLUMN_EDGE_CHANGE:
if (crosstabItem.getMeasureCount() > 0) {
int mx=event.measureIndex >= 0 ? event.measureIndex : 0;
handle=crosstabItem.getColumnWidth(crosstabItem.getMeasure(mx).getCell());
}
 else {
DimensionViewHandle dv=crosstabItem.getDimension(COLUMN_AXIS_TYPE,crosstabItem.getDimensionCount(COLUMN_AXIS_TYPE) - 1);
handle=crosstabItem.getColumnWidth(dv.getLevel(dv.getLevelCount() - 1).getCell());
}
break;
case ColumnEvent.COLUMN_TOTAL_CHANGE:
if (crosstabItem.getMeasureCount() > 0) {
int mx=event.measureIndex >= 0 ? event.measureIndex : 0;
DimensionViewHandle dv=crosstabItem.getDimension(COLUMN_AXIS_TYPE,event.dimensionIndex);
LevelViewHandle lv=dv.getLevel(event.levelIndex);
handle=crosstabItem.getColumnWidth(crosstabItem.getMeasure(mx).getAggregationCell(rowDimension,rowLevel,dv.getCubeDimensionName(),lv.getCubeLevelName()));
}
 else {
DimensionViewHandle dv=crosstabItem.getDimension(COLUMN_AXIS_TYPE,event.dimensionIndex);
handle=crosstabItem.getColumnWidth(dv.getLevel(event.levelIndex).getAggregationHeader());
}
break;
case ColumnEvent.GRAND_TOTAL_CHANGE:
if (crosstabItem.getMeasureCount() > 0) {
int mx=event.measureIndex >= 0 ? event.measureIndex : 0;
handle=crosstabItem.getColumnWidth(crosstabItem.getMeasure(mx).getAggregationCell(rowDimension,rowLevel,null,null));
}
 else {
handle=crosstabItem.getColumnWidth(crosstabItem.getGrandTotal(COLUMN_AXIS_TYPE));
}
break;
case ColumnEvent.MEASURE_CHANGE:
int mx=event.measureIndex >= 0 ? event.measureIndex : 0;
handle=crosstabItem.getColumnWidth(crosstabItem.getMeasure(mx).getCell());
break;
}
}
 catch (CrosstabException e) {
logger.log(Level.SEVERE,Messages.getString("String_Node_Str"),e);
}
if (handle != null) {
DimensionType width=ContentUtil.createDimension(handle);
if (width != null) {
col.setWidth(width);
}
}
table.addColumn(col);
}

Fixed version (ground truth):
private void addColumn(ColumnEvent event,IReportContent report,ITableContent table){
  Column col=new Column(report);
  DimensionHandle handle=null;
  try {
switch (event.type) {
case ColumnEvent.ROW_EDGE_CHANGE:
      col.setColumnHeaderState(true);
    handle=crosstabItem.getColumnWidth(crosstabItem.getDimension(ROW_AXIS_TYPE,event.dimensionIndex).getLevel(event.levelIndex).getCell());
  break;
case ColumnEvent.MEASURE_HEADER_CHANGE:
col.setColumnHeaderState(true);
for (int i=0; i < crosstabItem.getMeasureCount(); i++) {
MeasureViewHandle mv=crosstabItem.getMeasure(i);
if (mv.getHeader() != null) {
  handle=crosstabItem.getColumnWidth(mv.getHeader());
  break;
}
}
break;
case ColumnEvent.COLUMN_EDGE_CHANGE:
if (crosstabItem.getMeasureCount() > 0) {
int mx=event.measureIndex >= 0 ? event.measureIndex : 0;
handle=crosstabItem.getColumnWidth(crosstabItem.getMeasure(mx).getCell());
}
 else {
DimensionViewHandle dv=crosstabItem.getDimension(COLUMN_AXIS_TYPE,crosstabItem.getDimensionCount(COLUMN_AXIS_TYPE) - 1);
handle=crosstabItem.getColumnWidth(dv.getLevel(dv.getLevelCount() - 1).getCell());
}
break;
case ColumnEvent.COLUMN_TOTAL_CHANGE:
if (crosstabItem.getMeasureCount() > 0) {
int mx=event.measureIndex >= 0 ? event.measureIndex : 0;
DimensionViewHandle dv=crosstabItem.getDimension(COLUMN_AXIS_TYPE,event.dimensionIndex);
LevelViewHandle lv=dv.getLevel(event.levelIndex);
handle=crosstabItem.getColumnWidth(crosstabItem.getMeasure(mx).getAggregationCell(rowDimension,rowLevel,dv.getCubeDimensionName(),lv.getCubeLevelName()));
}
 else {
DimensionViewHandle dv=crosstabItem.getDimension(COLUMN_AXIS_TYPE,event.dimensionIndex);
handle=crosstabItem.getColumnWidth(dv.getLevel(event.levelIndex).getAggregationHeader());
}
break;
case ColumnEvent.GRAND_TOTAL_CHANGE:
if (crosstabItem.getMeasureCount() > 0) {
int mx=event.measureIndex >= 0 ? event.measureIndex : 0;
handle=crosstabItem.getColumnWidth(crosstabItem.getMeasure(mx).getAggregationCell(rowDimension,rowLevel,null,null));
}
 else {
handle=crosstabItem.getColumnWidth(crosstabItem.getGrandTotal(COLUMN_AXIS_TYPE));
}
break;
case ColumnEvent.MEASURE_CHANGE:
int mx=event.measureIndex >= 0 ? event.measureIndex : 0;
handle=crosstabItem.getColumnWidth(crosstabItem.getMeasure(mx).getCell());
break;
}
}
 catch (CrosstabException e) {
logger.log(Level.SEVERE,Messages.getString("String_Node_Str"),e);
}
if (handle != null) {
DimensionType width=ContentUtil.createDimension(handle);
if (width != null) {
col.setWidth(width);
}
}
table.addColumn(col);
}