Program: 76761
Project: 76761
Buggy source:
/** 
 * Gets the embedded image
 * @param embeddedImage the embedded image data
 * @return Returns the image,or null if the embedded image doesn't exist.
 */
public Image getImage(ModuleHandle handle,String name){
  String key=generateKey(handle,name);
  EmbeddedImage embeddedImage=handle.findImage(name);
  if (embeddedImage == null) {
    removeCachedImage(key);
    return null;
  }
  Image image=getImageRegistry().get(key);
  if (image != null) {
    return image;
  }
  InputStream in=null;
  try {
    if (key.toLowerCase().endsWith("String_Node_Str")) {
      JPEGTranscoder transcoder=new JPEGTranscoder();
      transcoder.addTranscodingHint(JPEGTranscoder.KEY_QUALITY,new Float(.8));
      TranscoderInput input=new TranscoderInput(new ByteArrayInputStream(embeddedImage.getData(handle.getModule())));
      ByteArrayOutputStream ostream=new ByteArrayOutputStream();
      TranscoderOutput output=new TranscoderOutput(ostream);
      try {
        transcoder.transcode(input,output);
      }
 catch (      TranscoderException e) {
      }
      ostream.flush();
      in=new ByteArrayInputStream(ostream.toByteArray());
    }
 else {
      in=new ByteArrayInputStream(embeddedImage.getData(handle.getModule()));
    }
  }
 catch (  Exception e) {
  }
 finally {
    if (in != null) {
      try {
        in.close();
      }
 catch (      IOException e) {
      }
    }
  }
  image=new Image(null,in);
  if (image != null) {
    getImageRegistry().put(key,image);
    if (DesignerConstants.TRACING_IMAGE_MANAGER_IMAGE_ADD) {
      System.out.println("String_Node_Str" + key + "String_Node_Str");
    }
  }
  return image;
}

Fixed version (ground truth):
/** 
 * Gets the embedded image
 * @param embeddedImage the embedded image data
 * @return Returns the image,or null if the embedded image doesn't exist.
 */
public Image getImage(ModuleHandle handle,String name){
  String key=generateKey(handle,name);
  EmbeddedImage embeddedImage=handle.findImage(name);
  if (embeddedImage == null) {
    removeCachedImage(key);
    return null;
  }
  Image image=getImageRegistry().get(key);
  if (image != null) {
    return image;
  }
  InputStream in=null;
  try {
    if (key.toLowerCase().endsWith("String_Node_Str")) {
      JPEGTranscoder transcoder=new JPEGTranscoder();
      transcoder.addTranscodingHint(JPEGTranscoder.KEY_QUALITY,new Float(.8));
      TranscoderInput input=new TranscoderInput(new ByteArrayInputStream(embeddedImage.getData(handle.getModule())));
      input.setURI(generateURL(handle.getFileName()).toString());
      ByteArrayOutputStream ostream=new ByteArrayOutputStream();
      TranscoderOutput output=new TranscoderOutput(ostream);
      try {
        transcoder.transcode(input,output);
      }
 catch (      TranscoderException e) {
      }
      ostream.flush();
      in=new ByteArrayInputStream(ostream.toByteArray());
    }
 else {
      in=new ByteArrayInputStream(embeddedImage.getData(handle.getModule()));
    }
  }
 catch (  Exception e) {
  }
 finally {
    if (in != null) {
      try {
        in.close();
      }
 catch (      IOException e) {
      }
    }
  }
  image=new Image(null,in);
  if (image != null) {
    getImageRegistry().put(key,image);
    if (DesignerConstants.TRACING_IMAGE_MANAGER_IMAGE_ADD) {
      System.out.println("String_Node_Str" + key + "String_Node_Str");
    }
  }
  return image;
}