Program: 75858
Project: 75858
Buggy source:
public void drawImage(ImageRenderEvent pre) throws ChartException {
  if (pre.getImage() == null || pre.getLocation() == null) {
    return;
  }
  java.awt.Image img=null;
  if (pre.getImage() instanceof EmbeddedImage) {
    try {
      byte[] data=Base64.decodeBase64(((EmbeddedImage)pre.getImage()).getData().getBytes());
      img=createImage(data);
    }
 catch (    Exception ilex) {
      throw new ChartException(ChartDeviceExtensionPlugin.ID,ChartException.RENDERING,ilex);
    }
  }
 else {
    try {
      final String sUrl=pre.getImage().getURL();
      img=(java.awt.Image)_ids.loadImage(new URL(sUrl));
    }
 catch (    ChartException ilex) {
      throw new ChartException(ChartDeviceExtensionPlugin.ID,ChartException.RENDERING,ilex);
    }
catch (    MalformedURLException muex) {
      throw new ChartException(ChartDeviceExtensionPlugin.ID,ChartException.RENDERING,muex);
    }
  }
  if (img == null) {
    return;
  }
  Location loc=pre.getLocation();
  Position pos=pre.getPosition();
  if (pos == null) {
    pos=Position.INSIDE_LITERAL;
  }
  ImageObserver io=(ImageObserver)_ids.getObserver();
  int width=img.getWidth(io);
  int height=img.getHeight(io);
  int x=(int)loc.getX();
  int y=(int)loc.getY();
switch (pos.getValue()) {
case Position.INSIDE:
case Position.OUTSIDE:
    x-=width / 2;
  y-=height / 2;
break;
case Position.LEFT:
x-=width;
y-=height / 2;
break;
case Position.RIGHT:
y-=height / 2;
break;
case Position.ABOVE:
x-=width / 2;
y-=height;
break;
case Position.BELOW:
x-=width / 2;
break;
}
_g2d.drawImage(img,x,y,width,height,io);
}

Fixed version (ground truth):
public void drawImage(ImageRenderEvent pre) throws ChartException {
  iv.modifyEvent(pre);
  if (pre.getImage() == null || pre.getLocation() == null) {
    return;
  }
  java.awt.Image img=null;
  if (pre.getImage() instanceof EmbeddedImage) {
    try {
      byte[] data=Base64.decodeBase64(((EmbeddedImage)pre.getImage()).getData().getBytes());
      img=createImage(data);
    }
 catch (    Exception ilex) {
      throw new ChartException(ChartDeviceExtensionPlugin.ID,ChartException.RENDERING,ilex);
    }
  }
 else {
    try {
      final String sUrl=pre.getImage().getURL();
      img=(java.awt.Image)_ids.loadImage(new URL(sUrl));
    }
 catch (    ChartException ilex) {
      throw new ChartException(ChartDeviceExtensionPlugin.ID,ChartException.RENDERING,ilex);
    }
catch (    MalformedURLException muex) {
      throw new ChartException(ChartDeviceExtensionPlugin.ID,ChartException.RENDERING,muex);
    }
  }
  if (img == null) {
    return;
  }
  Location loc=pre.getLocation();
  Position pos=pre.getPosition();
  if (pos == null) {
    pos=Position.INSIDE_LITERAL;
  }
  ImageObserver io=(ImageObserver)_ids.getObserver();
  int width=img.getWidth(io);
  int height=img.getHeight(io);
  int x=(int)loc.getX();
  int y=(int)loc.getY();
switch (pos.getValue()) {
case Position.INSIDE:
case Position.OUTSIDE:
    x-=width / 2;
  y-=height / 2;
break;
case Position.LEFT:
x-=width;
y-=height / 2;
break;
case Position.RIGHT:
y-=height / 2;
break;
case Position.ABOVE:
x-=width / 2;
y-=height;
break;
case Position.BELOW:
x-=width / 2;
break;
}
_g2d.drawImage(img,x,y,width,height,io);
}