Program: 72188
Project: 72188
Buggy source:
/** 
 * Draws image at the contentByte
 * @param image the ImageArea specified from the layout
 */
protected void drawImage(IImageArea image){
  int imageX=currentX + getX(image);
  int imageY=currentY + getY(image);
  IImageContent imageContent=((IImageContent)image.getContent());
  InputStream in=null;
  boolean isSvg=false;
  int height=getHeight(image);
  int width=getWidth(image);
  String helpText=imageContent.getHelpText();
  try {
    String uri=imageContent.getURI();
    String extension=imageContent.getExtension();
switch (imageContent.getImageSource()) {
case IImageContent.IMAGE_FILE:
case IImageContent.IMAGE_URL:
      if (null == uri)       return;
    if (uri != null && uri.endsWith("String_Node_Str")) {
      isSvg=true;
    }
  if (isSvg) {
    pageGraphic.drawImage(uri,transSvgToArray(uri),extension,imageX,imageY,height,width,helpText);
  }
 else {
    pageGraphic.drawImage(uri,extension,imageX,imageY,height,width,helpText);
  }
break;
case IImageContent.IMAGE_NAME:
case IImageContent.IMAGE_EXPRESSION:
byte[] data=imageContent.getData();
if (null == data) return;
in=new ByteArrayInputStream(data);
isSvg=((imageContent.getMIMEType() != null) && imageContent.getMIMEType().equalsIgnoreCase("String_Node_Str")) || ((uri != null) && uri.toLowerCase().endsWith("String_Node_Str")) || ((imageContent.getExtension() != null) && imageContent.getExtension().toLowerCase().endsWith("String_Node_Str"));
if (isSvg) data=transSvgToArray(in);
pageGraphic.drawImage(uri,data,extension,imageX,imageY,height,width,helpText);
break;
}
if (in == null) return;
}
 catch (Throwable t) {
log(t,Level.WARNING);
}
 finally {
if (in != null) {
try {
in.close();
in=null;
}
 catch (IOException e) {
log(e,Level.WARNING);
}
}
}
}

Fixed version (ground truth):
/** 
 * Draws image at the contentByte
 * @param image the ImageArea specified from the layout
 */
protected void drawImage(IImageArea image){
  int imageX=currentX + getX(image);
  int imageY=currentY + getY(image);
  IImageContent imageContent=((IImageContent)image.getContent());
  InputStream in=null;
  int height=getHeight(image);
  int width=getWidth(image);
  String helpText=imageContent.getHelpText();
  try {
    String uri=imageContent.getURI();
    String extension=imageContent.getExtension();
switch (imageContent.getImageSource()) {
case IImageContent.IMAGE_FILE:
case IImageContent.IMAGE_URL:
      if (null == uri)       return;
    if (SvgFile.isSvg(uri)) {
      pageGraphic.drawImage(uri,SvgFile.transSvgToArray(uri),extension,imageX,imageY,height,width,helpText);
    }
 else {
      pageGraphic.drawImage(uri,extension,imageX,imageY,height,width,helpText);
    }
  break;
case IImageContent.IMAGE_NAME:
case IImageContent.IMAGE_EXPRESSION:
byte[] data=imageContent.getData();
if (null == data) return;
in=new ByteArrayInputStream(data);
String mimeType=imageContent.getMIMEType();
if (SvgFile.isSvg(mimeType,uri,extension)) data=SvgFile.transSvgToArray(in);
pageGraphic.drawImage(uri,data,extension,imageX,imageY,height,width,helpText);
break;
}
if (in == null) return;
}
 catch (Throwable t) {
log(t,Level.WARNING);
}
 finally {
if (in != null) {
try {
in.close();
in=null;
}
 catch (IOException e) {
log(e,Level.WARNING);
}
}
}
}