Program: 66246
Project: 66246
Buggy source:
public final void renderLegendGraphic(IPrimitiveRenderer ipr,Legend lg,Fill fPaletteEntry,Bounds bo) throws ChartException {
  if ((bo.getWidth() == 0) && (bo.getHeight() == 0)) {
    return;
  }
  final BarSeries bs=(BarSeries)getSeries();
  final ColorDefinition cd=bs.getRiserOutline();
  final LineAttributes lia=goFactory.createLineAttributes(cd == null ? null : goFactory.copyOf(cd),LineStyle.SOLID_LITERAL,1);
  if (fPaletteEntry == null) {
    fPaletteEntry=goFactory.RED();
  }
 else   if (fPaletteEntry instanceof MultipleFill) {
    fPaletteEntry=((MultipleFill)fPaletteEntry).getFills().get(0);
  }
  Location[] loaFrontFace=null;
  double dSeriesThickness=0;
switch (bs.getRiser().getValue()) {
case RiserType.RECTANGLE:
case RiserType.TUBE:
    if (bs.getRiser().getValue() == RiserType.RECTANGLE && getModel().getDimension() != ChartDimension.TWO_DIMENSIONAL_LITERAL) {
      dSeriesThickness=3 * getDeviceScale();
    }
  if (bs.getRiser().getValue() == RiserType.TUBE) {
    dSeriesThickness=2 * getDeviceScale();
  }
loaFrontFace=new Location[4];
loaFrontFace[0]=goFactory.createLocation(bo.getLeft(),bo.getTop() + dSeriesThickness);
loaFrontFace[1]=goFactory.createLocation(bo.getLeft(),bo.getTop() + bo.getHeight());
loaFrontFace[2]=goFactory.createLocation(bo.getLeft() + bo.getWidth(),bo.getTop() + bo.getHeight());
loaFrontFace[3]=goFactory.createLocation(bo.getLeft() + bo.getWidth(),bo.getTop() + dSeriesThickness);
break;
case RiserType.TRIANGLE:
case RiserType.CONE:
loaFrontFace=new Location[3];
loaFrontFace[0]=goFactory.createLocation(bo.getLeft(),bo.getTop() + bo.getHeight());
loaFrontFace[1]=goFactory.createLocation(bo.getLeft() + bo.getWidth() / 2,bo.getTop());
loaFrontFace[2]=goFactory.createLocation(bo.getLeft() + bo.getWidth(),bo.getTop() + bo.getHeight());
break;
default :
throw new ChartException(ChartEngineExtensionPlugin.ID,ChartException.RENDERING,"String_Node_Str",new Object[]{bs.getRiser().getName()},Messages.getResourceBundle(getRunTimeContext().getULocale()));
}
if (bs.getRiser().getValue() == RiserType.TUBE) {
renderRiserTube2D(ipr,StructureSource.createLegend(lg),null,loaFrontFace,fPaletteEntry,lia,getModel().getDimension(),2 * getDeviceScale(),false,false,false,false,false,0);
}
 else if (bs.getRiser().getValue() == RiserType.CONE) {
renderRiserCone2D(ipr,StructureSource.createLegend(lg),null,loaFrontFace,fPaletteEntry,lia,getModel().getDimension(),2 * getDeviceScale(),false,false,false,false,false,2 * getDeviceScale(),0);
}
 else if (bs.getRiser().getValue() == RiserType.TRIANGLE) {
ChartDimension cdim=getModel().getDimension();
if (cdim != ChartDimension.TWO_DIMENSIONAL_LITERAL) {
adjustLocationsWithTriangle2D(loaFrontFace,0,2 * getDeviceScale(),2 * getDeviceScale());
}
renderRiserTriangle2D(ipr,StructureSource.createLegend(lg),loaFrontFace,fPaletteEntry,lia,cdim == ChartDimension.THREE_DIMENSIONAL_LITERAL ? ChartDimension.TWO_DIMENSIONAL_WITH_DEPTH_LITERAL : cdim,0d,2 * getDeviceScale(),false,0);
}
 else {
renderPlane(ipr,StructureSource.createLegend(lg),loaFrontFace,fPaletteEntry,lia,getModel().getDimension(),3 * getDeviceScale(),false);
}
}

Fixed version (ground truth):
public final void renderLegendGraphic(IPrimitiveRenderer ipr,Legend lg,Fill fPaletteEntry,Bounds bo) throws ChartException {
  if ((bo.getWidth() == 0) && (bo.getHeight() == 0)) {
    return;
  }
  final BarSeries bs=(BarSeries)getSeries();
  final ColorDefinition cd=bs.getRiserOutline();
  final LineAttributes lia=goFactory.createLineAttributes(cd == null ? null : goFactory.copyOf(cd),LineStyle.SOLID_LITERAL,1);
  if (fPaletteEntry == null) {
    fPaletteEntry=goFactory.RED();
  }
 else   if (fPaletteEntry instanceof MultipleFill) {
    fPaletteEntry=((MultipleFill)fPaletteEntry).getFills().get(0);
  }
  Location[] loaFrontFace=null;
  double dSeriesThickness=0;
switch (bs.getRiser().getValue()) {
case RiserType.RECTANGLE:
case RiserType.TUBE:
    if (bs.getRiser().getValue() == RiserType.RECTANGLE && getModel().getDimension() != ChartDimension.TWO_DIMENSIONAL_LITERAL) {
      dSeriesThickness=3 * getDeviceScale();
    }
  if (bs.getRiser().getValue() == RiserType.TUBE) {
    dSeriesThickness=2 * getDeviceScale();
  }
loaFrontFace=new Location[4];
loaFrontFace[0]=goFactory.createLocation(bo.getLeft(),bo.getTop() + dSeriesThickness);
loaFrontFace[1]=goFactory.createLocation(bo.getLeft(),bo.getTop() + bo.getHeight());
loaFrontFace[2]=goFactory.createLocation(bo.getLeft() + bo.getWidth(),bo.getTop() + bo.getHeight());
loaFrontFace[3]=goFactory.createLocation(bo.getLeft() + bo.getWidth(),bo.getTop() + dSeriesThickness);
break;
case RiserType.TRIANGLE:
case RiserType.CONE:
loaFrontFace=new Location[3];
loaFrontFace[0]=goFactory.createLocation(bo.getLeft(),bo.getTop() + bo.getHeight());
loaFrontFace[1]=goFactory.createLocation(bo.getLeft() + bo.getWidth() / 2,bo.getTop());
loaFrontFace[2]=goFactory.createLocation(bo.getLeft() + bo.getWidth(),bo.getTop() + bo.getHeight());
break;
default :
throw new ChartException(ChartEngineExtensionPlugin.ID,ChartException.RENDERING,"String_Node_Str",new Object[]{bs.getRiser().getName()},Messages.getResourceBundle(getRunTimeContext().getULocale()));
}
if (bs.getRiser().getValue() == RiserType.TUBE) {
renderRiserTube2D(ipr,StructureSource.createLegend(lg),null,loaFrontFace,fPaletteEntry,lia,getModel().getDimension(),2 * getDeviceScale(),false,false,false,false,false,0,null);
}
 else if (bs.getRiser().getValue() == RiserType.CONE) {
renderRiserCone2D(ipr,StructureSource.createLegend(lg),null,loaFrontFace,fPaletteEntry,lia,getModel().getDimension(),2 * getDeviceScale(),false,false,false,false,false,2 * getDeviceScale(),0,null);
}
 else if (bs.getRiser().getValue() == RiserType.TRIANGLE) {
ChartDimension cdim=getModel().getDimension();
if (cdim != ChartDimension.TWO_DIMENSIONAL_LITERAL) {
adjustLocationsWithTriangle2D(loaFrontFace,0,2 * getDeviceScale(),2 * getDeviceScale());
}
renderRiserTriangle2D(ipr,StructureSource.createLegend(lg),loaFrontFace,fPaletteEntry,lia,cdim == ChartDimension.THREE_DIMENSIONAL_LITERAL ? ChartDimension.TWO_DIMENSIONAL_WITH_DEPTH_LITERAL : cdim,0d,2 * getDeviceScale(),false,0,null);
}
 else {
renderPlane(ipr,StructureSource.createLegend(lg),loaFrontFace,fPaletteEntry,lia,getModel().getDimension(),3 * getDeviceScale(),false);
}
}