Program: 75954
Project: 75954
Buggy source:
public void fillArc(ArcRenderEvent are) throws ChartException {
  Fill flBackground=validateMultipleFill(are.getBackground());
  if (isFullTransparent(flBackground)) {
    return;
  }
  Bounds bo=BoundsImpl.create(are.getTopLeft().getX(),are.getTopLeft().getY(),are.getWidth(),are.getHeight());
  final Rectangle r=new Rectangle((int)((bo.getLeft() + dTranslateX) * dScale),(int)((bo.getTop() + dTranslateY) * dScale),(int)Math.ceil(bo.getWidth() * dScale),(int)Math.ceil(bo.getHeight() * dScale));
  Path pt=new Path(((SwtDisplayServer)_ids).getDevice());
  if (are.getInnerRadius() >= 0 && (are.getOuterRadius() > 0 && are.getInnerRadius() < are.getOuterRadius()) || (are.getInnerRadius() > 0 && are.getOuterRadius() <= 0)) {
    Bounds rctOuter, rctInner;
    if (are.getOuterRadius() > 0) {
      rctOuter=BoundsImpl.create(((bo.getLeft() + dTranslateX + (bo.getWidth() / 2d - are.getOuterRadius())) * dScale),((bo.getTop() + dTranslateY + (bo.getHeight() / 2d - are.getOuterRadius())) * dScale),(2 * are.getOuterRadius() * dScale),(2 * are.getOuterRadius() * dScale));
    }
 else {
      rctOuter=BoundsImpl.create(((bo.getLeft() + dTranslateX) * dScale),((bo.getTop() + dTranslateY) * dScale),(bo.getWidth() * dScale),(bo.getHeight() * dScale));
    }
    if (are.getInnerRadius() > 0) {
      rctInner=BoundsImpl.create(((bo.getLeft() + dTranslateX + (bo.getWidth() / 2d - are.getInnerRadius())) * dScale),((bo.getTop() + dTranslateY + (bo.getHeight() / 2d - are.getInnerRadius())) * dScale),(2 * are.getInnerRadius() * dScale),(2 * are.getInnerRadius() * dScale));
    }
 else {
      rctInner=BoundsImpl.create(((bo.getLeft() + dTranslateX + bo.getWidth() / 2d) * dScale),((bo.getTop() + dTranslateY + bo.getHeight() / 2d) * dScale),0,0);
    }
    double startAngle=Math.toRadians(-are.getStartAngle());
    double stopAngle=Math.toRadians(-are.getStartAngle() - are.getAngleExtent());
    double xsOuter=(rctOuter.getLeft() + (Math.cos(startAngle) * 0.5 + 0.5) * rctOuter.getWidth());
    double ysOuter=(rctOuter.getTop() + (Math.sin(startAngle) * 0.5 + 0.5) * rctOuter.getHeight());
    double xeInner=(rctInner.getLeft() + (Math.cos(stopAngle) * 0.5 + 0.5) * rctInner.getWidth());
    double yeInner=(rctInner.getTop() + (Math.sin(stopAngle) * 0.5 + 0.5) * rctInner.getHeight());
    pt.addArc((float)rctOuter.getLeft(),(float)rctOuter.getTop(),(float)rctOuter.getWidth(),(float)rctOuter.getHeight(),(float)are.getStartAngle(),(float)are.getAngleExtent());
    pt.lineTo((float)xeInner,(float)yeInner);
    pt.addArc((float)rctInner.getLeft(),(float)rctInner.getTop(),(float)rctInner.getWidth(),(float)rctInner.getHeight(),(float)(are.getStartAngle() + are.getAngleExtent()),(float)-are.getAngleExtent());
    pt.lineTo((float)xsOuter,(float)ysOuter);
  }
 else {
    if (are.getStyle() == ArcRenderEvent.SECTOR || (are.getStyle() == ArcRenderEvent.CLOSED && Math.abs(are.getAngleExtent()) >= 360)) {
      double xc=((are.getTopLeft().getX() + dTranslateX + are.getWidth() / 2d) * dScale);
      double yc=((are.getTopLeft().getY() + dTranslateY + are.getHeight() / 2d) * dScale);
      double xs=0, ys=0;
      double angle=Math.toRadians(-are.getStartAngle());
      xs=((are.getTopLeft().getX() + dTranslateX + (Math.cos(angle) * 0.5 + 0.5) * are.getWidth()) * dScale);
      ys=((are.getTopLeft().getY() + dTranslateY + (Math.sin(angle) * 0.5 + 0.5) * are.getHeight()) * dScale);
      if (are.getStyle() == ArcRenderEvent.CLOSED) {
        pt.addArc((float)((are.getTopLeft().getX() + dTranslateX) * dScale),(float)((are.getTopLeft().getY() + dTranslateY) * dScale),(float)(are.getWidth() * dScale),(float)(are.getHeight() * dScale),(float)are.getStartAngle(),(float)are.getAngleExtent());
        pt.lineTo((float)xs,(float)ys);
      }
 else       if (are.getStyle() == ArcRenderEvent.SECTOR) {
        pt.addArc((float)((are.getTopLeft().getX() + dTranslateX) * dScale),(float)((are.getTopLeft().getY() + dTranslateY) * dScale),(float)(are.getWidth() * dScale),(float)(are.getHeight() * dScale),(float)are.getStartAngle(),(float)are.getAngleExtent());
        pt.lineTo((float)xc,(float)yc);
        pt.lineTo((float)xs,(float)ys);
      }
    }
 else     if (are.getStyle() == ArcRenderEvent.OPEN || are.getStyle() == ArcRenderEvent.CLOSED) {
      double angle=Math.toRadians(-are.getStartAngle());
      double xs=((are.getTopLeft().getX() + dTranslateX + (Math.cos(angle) * 0.5 + 0.5) * are.getWidth()) * dScale);
      double ys=((are.getTopLeft().getY() + dTranslateY + (Math.sin(angle) * 0.5 + 0.5) * are.getHeight()) * dScale);
      pt.addArc((float)((are.getTopLeft().getX() + dTranslateX) * dScale),(float)((are.getTopLeft().getY() + dTranslateY) * dScale),(float)(are.getWidth() * dScale),(float)(are.getHeight() * dScale),(float)are.getStartAngle(),(float)are.getAngleExtent());
      pt.lineTo((float)xs,(float)ys);
    }
  }
  try {
    if (flBackground instanceof ColorDefinition) {
      fillPathColor(pt,(ColorDefinition)flBackground);
    }
 else     if (flBackground instanceof Gradient) {
      fillPathGradient(pt,(Gradient)flBackground,r);
    }
 else     if (flBackground instanceof org.eclipse.birt.chart.model.attribute.Image) {
      fillPathImage(pt,(org.eclipse.birt.chart.model.attribute.Image)flBackground);
    }
  }
  finally {
    pt.dispose();
  }
}

Fixed version (ground truth):
public void fillArc(ArcRenderEvent are) throws ChartException {
  Fill flBackground=validateMultipleFill(are.getBackground());
  if (isFullTransparent(flBackground) || are.getAngleExtent() == 0) {
    return;
  }
  Bounds bo=BoundsImpl.create(are.getTopLeft().getX(),are.getTopLeft().getY(),are.getWidth(),are.getHeight());
  final Rectangle r=new Rectangle((int)((bo.getLeft() + dTranslateX) * dScale),(int)((bo.getTop() + dTranslateY) * dScale),(int)Math.ceil(bo.getWidth() * dScale),(int)Math.ceil(bo.getHeight() * dScale));
  Path pt=new Path(((SwtDisplayServer)_ids).getDevice());
  if (are.getInnerRadius() >= 0 && (are.getOuterRadius() > 0 && are.getInnerRadius() < are.getOuterRadius()) || (are.getInnerRadius() > 0 && are.getOuterRadius() <= 0)) {
    Bounds rctOuter, rctInner;
    if (are.getOuterRadius() > 0) {
      rctOuter=BoundsImpl.create(((bo.getLeft() + dTranslateX + (bo.getWidth() / 2d - are.getOuterRadius())) * dScale),((bo.getTop() + dTranslateY + (bo.getHeight() / 2d - are.getOuterRadius())) * dScale),(2 * are.getOuterRadius() * dScale),(2 * are.getOuterRadius() * dScale));
    }
 else {
      rctOuter=BoundsImpl.create(((bo.getLeft() + dTranslateX) * dScale),((bo.getTop() + dTranslateY) * dScale),(bo.getWidth() * dScale),(bo.getHeight() * dScale));
    }
    if (are.getInnerRadius() > 0) {
      rctInner=BoundsImpl.create(((bo.getLeft() + dTranslateX + (bo.getWidth() / 2d - are.getInnerRadius())) * dScale),((bo.getTop() + dTranslateY + (bo.getHeight() / 2d - are.getInnerRadius())) * dScale),(2 * are.getInnerRadius() * dScale),(2 * are.getInnerRadius() * dScale));
    }
 else {
      rctInner=BoundsImpl.create(((bo.getLeft() + dTranslateX + bo.getWidth() / 2d) * dScale),((bo.getTop() + dTranslateY + bo.getHeight() / 2d) * dScale),0,0);
    }
    double startAngle=Math.toRadians(-are.getStartAngle());
    double stopAngle=Math.toRadians(-are.getStartAngle() - are.getAngleExtent());
    double xsOuter=(rctOuter.getLeft() + (Math.cos(startAngle) * 0.5 + 0.5) * rctOuter.getWidth());
    double ysOuter=(rctOuter.getTop() + (Math.sin(startAngle) * 0.5 + 0.5) * rctOuter.getHeight());
    double xeInner=(rctInner.getLeft() + (Math.cos(stopAngle) * 0.5 + 0.5) * rctInner.getWidth());
    double yeInner=(rctInner.getTop() + (Math.sin(stopAngle) * 0.5 + 0.5) * rctInner.getHeight());
    pt.addArc((float)rctOuter.getLeft(),(float)rctOuter.getTop(),(float)rctOuter.getWidth(),(float)rctOuter.getHeight(),(float)are.getStartAngle(),(float)are.getAngleExtent());
    pt.lineTo((float)xeInner,(float)yeInner);
    pt.addArc((float)rctInner.getLeft(),(float)rctInner.getTop(),(float)rctInner.getWidth(),(float)rctInner.getHeight(),(float)(are.getStartAngle() + are.getAngleExtent()),(float)-are.getAngleExtent());
    pt.lineTo((float)xsOuter,(float)ysOuter);
  }
 else {
    if (are.getStyle() == ArcRenderEvent.SECTOR || (are.getStyle() == ArcRenderEvent.CLOSED && Math.abs(are.getAngleExtent()) >= 360)) {
      double xc=((are.getTopLeft().getX() + dTranslateX + are.getWidth() / 2d) * dScale);
      double yc=((are.getTopLeft().getY() + dTranslateY + are.getHeight() / 2d) * dScale);
      double xs=0, ys=0;
      double angle=Math.toRadians(-are.getStartAngle());
      xs=((are.getTopLeft().getX() + dTranslateX + (Math.cos(angle) * 0.5 + 0.5) * are.getWidth()) * dScale);
      ys=((are.getTopLeft().getY() + dTranslateY + (Math.sin(angle) * 0.5 + 0.5) * are.getHeight()) * dScale);
      if (are.getStyle() == ArcRenderEvent.CLOSED) {
        pt.addArc((float)((are.getTopLeft().getX() + dTranslateX) * dScale),(float)((are.getTopLeft().getY() + dTranslateY) * dScale),(float)(are.getWidth() * dScale),(float)(are.getHeight() * dScale),(float)are.getStartAngle(),(float)are.getAngleExtent());
        pt.lineTo((float)xs,(float)ys);
      }
 else       if (are.getStyle() == ArcRenderEvent.SECTOR) {
        pt.addArc((float)((are.getTopLeft().getX() + dTranslateX) * dScale),(float)((are.getTopLeft().getY() + dTranslateY) * dScale),(float)(are.getWidth() * dScale),(float)(are.getHeight() * dScale),(float)are.getStartAngle(),(float)are.getAngleExtent());
        pt.lineTo((float)xc,(float)yc);
        pt.lineTo((float)xs,(float)ys);
      }
    }
 else     if (are.getStyle() == ArcRenderEvent.OPEN || are.getStyle() == ArcRenderEvent.CLOSED) {
      double angle=Math.toRadians(-are.getStartAngle());
      double xs=((are.getTopLeft().getX() + dTranslateX + (Math.cos(angle) * 0.5 + 0.5) * are.getWidth()) * dScale);
      double ys=((are.getTopLeft().getY() + dTranslateY + (Math.sin(angle) * 0.5 + 0.5) * are.getHeight()) * dScale);
      pt.addArc((float)((are.getTopLeft().getX() + dTranslateX) * dScale),(float)((are.getTopLeft().getY() + dTranslateY) * dScale),(float)(are.getWidth() * dScale),(float)(are.getHeight() * dScale),(float)are.getStartAngle(),(float)are.getAngleExtent());
      pt.lineTo((float)xs,(float)ys);
    }
  }
  try {
    if (flBackground instanceof ColorDefinition) {
      fillPathColor(pt,(ColorDefinition)flBackground);
    }
 else     if (flBackground instanceof Gradient) {
      fillPathGradient(pt,(Gradient)flBackground,r);
    }
 else     if (flBackground instanceof org.eclipse.birt.chart.model.attribute.Image) {
      fillPathImage(pt,(org.eclipse.birt.chart.model.attribute.Image)flBackground);
    }
  }
  finally {
    pt.dispose();
  }
}