Program: 77720
Project: 77720
Buggy source:
/** 
 * Handles the hyperlink, bookmark and drillthrough.
 * @param area			the area which needs to handle the hyperlink action.
 * @param curPos		the position of the container of current area.
 */
private void handleHyperlinkAction(IArea area,ContainerPosition curPos){
  IContent content=area.getContent();
  if (null != content) {
    int areaX=curPos.x + area.getX();
    int areaY=curPos.y + area.getY();
    IHyperlinkAction hlAction=content.getHyperlinkAction();
    if (null != hlAction)     try {
switch (hlAction.getType()) {
case IHyperlinkAction.ACTION_BOOKMARK:
        writer.addAnnotation(new PdfAnnotation(writer,layoutPointX2PDF(areaX),layoutPointY2PDF(areaY + area.getHeight()),layoutPointX2PDF(areaX + area.getWidth()),layoutPointY2PDF(areaY),createPdfAction(hlAction.getHyperlink(),hlAction.getBookmark(),hlAction.getTargetWindow(),IHyperlinkAction.ACTION_BOOKMARK)));
      break;
case IHyperlinkAction.ACTION_HYPERLINK:
    writer.addAnnotation(new PdfAnnotation(writer,layoutPointX2PDF(areaX),layoutPointY2PDF(areaY + area.getHeight()),layoutPointX2PDF(areaX + area.getWidth()),layoutPointY2PDF(areaY),createPdfAction(hlAction.getHyperlink(),null,hlAction.getTargetWindow(),IHyperlinkAction.ACTION_HYPERLINK)));
  break;
case IHyperlinkAction.ACTION_DRILLTHROUGH:
Action act=new Action(hlAction);
IHTMLActionHandler actionHandler=new HTMLActionHandler();
String link=actionHandler.getURL(act,context);
writer.addAnnotation(new PdfAnnotation(writer,layoutPointX2PDF(areaX),layoutPointY2PDF(areaY + area.getHeight()),layoutPointX2PDF(areaX + area.getWidth()),layoutPointY2PDF(areaY),createPdfAction(link.toString(),null,hlAction.getTargetWindow(),IHyperlinkAction.ACTION_DRILLTHROUGH)));
break;
}
}
 catch (Exception e) {
logger.log(Level.WARNING,e.getMessage(),e);
}
}
}

Fixed version (ground truth):
/** 
 * Handles the hyperlink, bookmark and drillthrough.
 * @param area			the area which needs to handle the hyperlink action.
 * @param curPos		the position of the container of current area.
 */
private void handleHyperlinkAction(IArea area,ContainerPosition curPos){
  IContent content=area.getContent();
  if (null != content) {
    int areaX=curPos.x + area.getX();
    int areaY=curPos.y + area.getY();
    IHyperlinkAction hlAction=content.getHyperlinkAction();
    if (null != hlAction)     try {
switch (hlAction.getType()) {
case IHyperlinkAction.ACTION_BOOKMARK:
        writer.addAnnotation(new PdfAnnotation(writer,layoutPointX2PDF(areaX),layoutPointY2PDF(areaY + area.getHeight()),layoutPointX2PDF(areaX + area.getWidth()),layoutPointY2PDF(areaY),createPdfAction(hlAction.getHyperlink(),hlAction.getBookmark(),hlAction.getTargetWindow(),IHyperlinkAction.ACTION_BOOKMARK)));
      break;
case IHyperlinkAction.ACTION_HYPERLINK:
    writer.addAnnotation(new PdfAnnotation(writer,layoutPointX2PDF(areaX),layoutPointY2PDF(areaY + area.getHeight()),layoutPointX2PDF(areaX + area.getWidth()),layoutPointY2PDF(areaY),createPdfAction(hlAction.getHyperlink(),null,hlAction.getTargetWindow(),IHyperlinkAction.ACTION_HYPERLINK)));
  break;
case IHyperlinkAction.ACTION_DRILLTHROUGH:
Action act=new Action(hlAction);
IHTMLActionHandler actionHandler=null;
Object ac=services.getOption(RenderOptionBase.ACTION_HANDLER);
if (ac != null && ac instanceof IHTMLActionHandler) {
actionHandler=(IHTMLActionHandler)ac;
}
String link=actionHandler.getURL(act,context);
writer.addAnnotation(new PdfAnnotation(writer,layoutPointX2PDF(areaX),layoutPointY2PDF(areaY + area.getHeight()),layoutPointX2PDF(areaX + area.getWidth()),layoutPointY2PDF(areaY),createPdfAction(link.toString(),null,hlAction.getTargetWindow(),IHyperlinkAction.ACTION_DRILLTHROUGH)));
break;
}
}
 catch (Exception e) {
logger.log(Level.WARNING,e.getMessage(),e);
}
}
}