Program: 71338
Project: 71338
Buggy source:
public static Image getImage(IImageContent content){
  Image image=null;
  try {
    String uri=content.getURI();
    String mimeType=content.getMIMEType();
    String extension=content.getExtension();
    if (FlashFile.isFlash(mimeType,uri,extension)) {
      return null;
    }
switch (content.getImageSource()) {
case IImageContent.IMAGE_FILE:
      ReportDesignHandle design=content.getReportContent().getDesign().getReportDesign();
    URL url=design.findResource(uri,IResourceLocator.IMAGE);
  InputStream in=url.openStream();
try {
  byte[] buffer;
  if (SvgFile.isSvg(content.getURI())) {
    buffer=SvgFile.transSvgToArray(in);
  }
 else {
    ArrayList<Byte> bytes=new ArrayList<Byte>();
    int data=in.read();
    while (data != -1) {
      bytes.add((byte)data);
      data=in.read();
    }
    buffer=new byte[bytes.size()];
    for (int i=0; i < buffer.length; i++) {
      buffer[i]=bytes.get(i);
    }
  }
  image=Image.getInstance(buffer);
}
 catch (Exception ex) {
  logger.log(Level.WARNING,ex.getMessage(),ex);
}
 finally {
  in.close();
}
break;
case IImageContent.IMAGE_NAME:
case IImageContent.IMAGE_EXPRESSION:
byte[] data=content.getData();
in=new ByteArrayInputStream(data);
if (SvgFile.isSvg(mimeType,uri,extension)) data=SvgFile.transSvgToArray(in);
image=Image.getInstance(data);
break;
case IImageContent.IMAGE_URL:
if (SvgFile.isSvg(uri)) {
image=Image.getInstance(SvgFile.transSvgToArray(uri));
}
 else {
image=Image.getInstance(new URL(content.getURI()));
}
break;
default :
assert(false);
}
}
 catch (Exception e) {
logger.log(Level.SEVERE,e.getLocalizedMessage());
}
return image;
}

Fixed version (ground truth):
public static Image getImage(IImageContent content){
  Image image=null;
  try {
    String uri=content.getURI();
    String mimeType=content.getMIMEType();
    String extension=content.getExtension();
switch (content.getImageSource()) {
case IImageContent.IMAGE_FILE:
      ReportDesignHandle design=content.getReportContent().getDesign().getReportDesign();
    URL url=design.findResource(uri,IResourceLocator.IMAGE);
  InputStream in=url.openStream();
try {
  byte[] buffer;
  if (SvgFile.isSvg(content.getURI())) {
    buffer=SvgFile.transSvgToArray(in);
  }
 else {
    ArrayList<Byte> bytes=new ArrayList<Byte>();
    int data=in.read();
    while (data != -1) {
      bytes.add((byte)data);
      data=in.read();
    }
    buffer=new byte[bytes.size()];
    for (int i=0; i < buffer.length; i++) {
      buffer[i]=bytes.get(i);
    }
  }
  image=Image.getInstance(buffer);
}
 catch (Exception ex) {
  logger.log(Level.WARNING,ex.getMessage(),ex);
}
 finally {
  in.close();
}
break;
case IImageContent.IMAGE_NAME:
case IImageContent.IMAGE_EXPRESSION:
byte[] data=content.getData();
in=new ByteArrayInputStream(data);
if (SvgFile.isSvg(mimeType,uri,extension)) data=SvgFile.transSvgToArray(in);
image=Image.getInstance(data);
break;
case IImageContent.IMAGE_URL:
if (SvgFile.isSvg(uri)) {
image=Image.getInstance(SvgFile.transSvgToArray(uri));
}
 else {
image=Image.getInstance(new URL(content.getURI()));
}
break;
default :
assert(false);
}
}
 catch (Exception e) {
logger.log(Level.SEVERE,e.getLocalizedMessage());
}
return image;
}